diff --git a/lib/screens/account.dart b/lib/screens/account.dart index 451746af..7fb55920 100644 --- a/lib/screens/account.dart +++ b/lib/screens/account.dart @@ -203,7 +203,7 @@ class AccountScreen extends HookConsumerWidget { ], ).padding(horizontal: 16, vertical: 12), onTap: () { - context.pushNamed('developerHub'); + context.goNamed('developerHub'); }, ), ).height(140), diff --git a/lib/screens/creators/hub.dart b/lib/screens/creators/hub.dart index 9e55238d..515c6b24 100644 --- a/lib/screens/creators/hub.dart +++ b/lib/screens/creators/hub.dart @@ -522,7 +522,7 @@ class CreatorHubScreen extends HookConsumerWidget { return AppScaffold( isNoBackground: false, appBar: AppBar( - leading: const PageBackButton(), + leading: const PageBackButton(backTo: '/account'), title: Text('creatorHub').tr(), actions: [ if (!isWideScreen(context)) diff --git a/lib/screens/developers/hub.dart b/lib/screens/developers/hub.dart index dd09e062..4a10970b 100644 --- a/lib/screens/developers/hub.dart +++ b/lib/screens/developers/hub.dart @@ -181,7 +181,7 @@ class _ConsoleAppBar extends StatelessWidget implements PreferredSizeWidget { @override Widget build(BuildContext context) { return AppBar( - leading: const PageBackButton(), + leading: const PageBackButton(backTo: '/account'), title: Text('developerHub').tr(), actions: [ if (currentProject != null) diff --git a/lib/screens/realm/realm_detail.g.dart b/lib/screens/realm/realm_detail.g.dart index e6e5c849..0167453b 100644 --- a/lib/screens/realm/realm_detail.g.dart +++ b/lib/screens/realm/realm_detail.g.dart @@ -276,7 +276,7 @@ class _RealmIdentityProviderElement String get realmSlug => (origin as RealmIdentityProvider).realmSlug; } -String _$realmChatRoomsHash() => r'54d36010221cd298f5ee0059259059f8b8aaff7b'; +String _$realmChatRoomsHash() => r'5f199906fb287b109e2a2d2a81dcb6675bdcb816'; /// See also [realmChatRooms]. @ProviderFor(realmChatRooms) diff --git a/lib/widgets/account/account_name.dart b/lib/widgets/account/account_name.dart index 46616578..cc206c07 100644 --- a/lib/widgets/account/account_name.dart +++ b/lib/widgets/account/account_name.dart @@ -36,11 +36,13 @@ const kVerificationMarkColors = [ class AccountName extends StatelessWidget { final SnAccount account; final TextStyle? style; + final String? textOverride; final bool ignorePermissions; const AccountName({ super.key, required this.account, this.style, + this.textOverride, this.ignorePermissions = false, }); @@ -177,7 +179,7 @@ class AccountName extends StatelessWidget { child: ShaderMask( shaderCallback: (bounds) => gradient.createShader(bounds), child: Text( - account.nick, + textOverride ?? account.nick, style: nameStyle.copyWith(color: Colors.white), maxLines: 1, overflow: TextOverflow.ellipsis, diff --git a/lib/widgets/app_scaffold.dart b/lib/widgets/app_scaffold.dart index 6402a1e1..5b658c30 100644 --- a/lib/widgets/app_scaffold.dart +++ b/lib/widgets/app_scaffold.dart @@ -370,12 +370,18 @@ class PageBackButton extends StatelessWidget { final Color? color; final List? shadows; final VoidCallback? onWillPop; - const PageBackButton({super.key, this.shadows, this.onWillPop, this.color}); + final String? backTo; + const PageBackButton({ + super.key, + this.shadows, + this.onWillPop, + this.color, + this.backTo, + }); @override Widget build(BuildContext context) { - final hasPageAction = - !kIsWeb && Platform.isMacOS; + final hasPageAction = !kIsWeb && Platform.isMacOS; if (hasPageAction && isWideScreen(context)) return const SizedBox.shrink(); @@ -385,7 +391,7 @@ class PageBackButton extends StatelessWidget { if (context.canPop()) { context.pop(); } else { - context.go('/'); + context.go(backTo ?? '/'); } }, icon: Icon( diff --git a/lib/widgets/post/post_shared.dart b/lib/widgets/post/post_shared.dart index d4176216..731cde30 100644 --- a/lib/widgets/post/post_shared.dart +++ b/lib/widgets/post/post_shared.dart @@ -570,7 +570,9 @@ class PostHeader extends StatelessWidget { } : null, child: ProfilePictureWidget( - file: item.publisher.picture, + file: + item.publisher.picture ?? + item.publisher.account?.profile.picture, radius: 16, borderRadius: item.publisher.type == 0 ? null : 6, ), @@ -586,11 +588,17 @@ class PostHeader extends StatelessWidget { children: [ Flexible( child: - Text( - item.publisher.nick, - maxLines: 1, - overflow: TextOverflow.ellipsis, - ).bold(), + item.publisher.account != null + ? AccountName( + account: item.publisher.account!, + textOverride: item.publisher.nick, + style: TextStyle(fontWeight: FontWeight.bold), + ) + : Text( + item.publisher.nick, + maxLines: 1, + overflow: TextOverflow.ellipsis, + ).bold(), ), if (item.publisher.verification != null) VerificationMark(mark: item.publisher.verification!),