💄 Optimize profile page
This commit is contained in:
@@ -788,5 +788,6 @@
|
|||||||
"addLink": "Add link",
|
"addLink": "Add link",
|
||||||
"linkKey": "Link Name",
|
"linkKey": "Link Name",
|
||||||
"linkValue": "URL",
|
"linkValue": "URL",
|
||||||
"debugOptions": "Debug Options"
|
"debugOptions": "Debug Options",
|
||||||
|
"joinedAt": "Joined at {}"
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
import 'package:gap/gap.dart';
|
import 'package:gap/gap.dart';
|
||||||
@@ -196,6 +197,15 @@ class AccountProfileScreen extends HookConsumerWidget {
|
|||||||
|
|
||||||
List<Widget> buildSubcolumn(SnAccount data) {
|
List<Widget> buildSubcolumn(SnAccount data) {
|
||||||
return [
|
return [
|
||||||
|
Row(
|
||||||
|
spacing: 6,
|
||||||
|
children: [
|
||||||
|
const Icon(Symbols.join, size: 17, fill: 1),
|
||||||
|
Text(
|
||||||
|
'joinedAt'.tr(args: [data.createdAt.formatCustom('yyyy-MM-dd')]),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
if (data.profile.birthday != null)
|
if (data.profile.birthday != null)
|
||||||
Row(
|
Row(
|
||||||
spacing: 6,
|
spacing: 6,
|
||||||
@@ -322,7 +332,7 @@ class AccountProfileScreen extends HookConsumerWidget {
|
|||||||
spacing: 2,
|
spacing: 2,
|
||||||
children: buildSubcolumn(data),
|
children: buildSubcolumn(data),
|
||||||
),
|
),
|
||||||
if (data.profile.timeZone.isNotEmpty)
|
if (data.profile.timeZone.isNotEmpty && !kIsWeb)
|
||||||
Column(
|
Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
@@ -367,7 +377,11 @@ class AccountProfileScreen extends HookConsumerWidget {
|
|||||||
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
if (!link.url.startsWith('http') && !link.url.contains('://')) {
|
||||||
|
launchUrlString('https://${link.url}');
|
||||||
|
} else {
|
||||||
launchUrlString(link.url);
|
launchUrlString(link.url);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -561,6 +575,7 @@ class AccountProfileScreen extends HookConsumerWidget {
|
|||||||
SliverToBoxAdapter(
|
SliverToBoxAdapter(
|
||||||
child: accountProfileBio(data).padding(top: 4),
|
child: accountProfileBio(data).padding(top: 4),
|
||||||
),
|
),
|
||||||
|
if (data.profile.links.isNotEmpty)
|
||||||
SliverToBoxAdapter(
|
SliverToBoxAdapter(
|
||||||
child: accountProfileLinks(data),
|
child: accountProfileLinks(data),
|
||||||
),
|
),
|
||||||
@@ -660,6 +675,7 @@ class AccountProfileScreen extends HookConsumerWidget {
|
|||||||
SliverToBoxAdapter(
|
SliverToBoxAdapter(
|
||||||
child: accountProfileBio(data).padding(horizontal: 4),
|
child: accountProfileBio(data).padding(horizontal: 4),
|
||||||
),
|
),
|
||||||
|
if (data.profile.links.isNotEmpty)
|
||||||
SliverToBoxAdapter(
|
SliverToBoxAdapter(
|
||||||
child: accountProfileLinks(
|
child: accountProfileLinks(
|
||||||
data,
|
data,
|
||||||
|
Reference in New Issue
Block a user