From b96b6e45ccb865b148524b268936521f65afff50 Mon Sep 17 00:00:00 2001 From: vjrj Date: Fri, 10 Jul 2026 12:40:08 +0200 Subject: [PATCH] fix(block2): back buttons on social screens + clear 'Share my seeds' button MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two UX reports: - Market/Messages (and Profile/Chat) had no back button — they were opened with context.go (replaces the stack). Switched the drawer entries, home Market card, offer 'Message' link and inbox taps to context.push, so the AppBar shows a back arrow to return. - The market's upload icon (tooltip-only) was unclear. Replaced it with a labelled FloatingActionButton.extended 'Share my seeds' (campaign icon); the config gear stays in the AppBar. Analyzer clean. --- apps/app_seeds/lib/ui/app_drawer.dart | 6 +++--- apps/app_seeds/lib/ui/chat_list_screen.dart | 2 +- apps/app_seeds/lib/ui/home_screen.dart | 2 +- apps/app_seeds/lib/ui/market_screen.dart | 18 ++++++++++-------- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/apps/app_seeds/lib/ui/app_drawer.dart b/apps/app_seeds/lib/ui/app_drawer.dart index 642c1ed..1b25003 100644 --- a/apps/app_seeds/lib/ui/app_drawer.dart +++ b/apps/app_seeds/lib/ui/app_drawer.dart @@ -41,7 +41,7 @@ class AppDrawer extends StatelessWidget { onTap: marketEnabled ? () { Navigator.of(context).pop(); - context.go('/market'); + context.push('/market'); } : null, ), @@ -51,7 +51,7 @@ class AppDrawer extends StatelessWidget { onTap: marketEnabled ? () { Navigator.of(context).pop(); - context.go('/profile'); + context.push('/profile'); } : null, ), @@ -61,7 +61,7 @@ class AppDrawer extends StatelessWidget { onTap: marketEnabled ? () { Navigator.of(context).pop(); - context.go('/messages'); + context.push('/messages'); } : null, ), diff --git a/apps/app_seeds/lib/ui/chat_list_screen.dart b/apps/app_seeds/lib/ui/chat_list_screen.dart index 9c87bdb..e91a716 100644 --- a/apps/app_seeds/lib/ui/chat_list_screen.dart +++ b/apps/app_seeds/lib/ui/chat_list_screen.dart @@ -65,7 +65,7 @@ class _ChatListScreenState extends State { maxLines: 1, overflow: TextOverflow.ellipsis, ), - onTap: () => context.go('/chat/${c.peerPubkey}'), + onTap: () => context.push('/chat/${c.peerPubkey}'), ); }, ), diff --git a/apps/app_seeds/lib/ui/home_screen.dart b/apps/app_seeds/lib/ui/home_screen.dart index a9c9612..656406f 100644 --- a/apps/app_seeds/lib/ui/home_screen.dart +++ b/apps/app_seeds/lib/ui/home_screen.dart @@ -87,7 +87,7 @@ class HomeScreen extends StatelessWidget { subtitle: t.home.openMarketSubtitle, tag: marketEnabled ? null : t.common.comingSoon, onTap: marketEnabled - ? () => context.go('/market') + ? () => context.push('/market') : null, ), ], diff --git a/apps/app_seeds/lib/ui/market_screen.dart b/apps/app_seeds/lib/ui/market_screen.dart index 41a8906..9f418a7 100644 --- a/apps/app_seeds/lib/ui/market_screen.dart +++ b/apps/app_seeds/lib/ui/market_screen.dart @@ -148,13 +148,6 @@ class _MarketScreenState extends State { appBar: AppBar( title: Text(t.market.title), actions: [ - if (cubit != null && (cubit.isOnline || widget.outbox != null)) - IconButton( - key: const Key('market.shareMine'), - icon: const Icon(Icons.ios_share_outlined), - tooltip: t.market.shareMine, - onPressed: _shareMine, - ), IconButton( key: const Key('market.config'), icon: const Icon(Icons.tune), @@ -163,6 +156,15 @@ class _MarketScreenState extends State { ), ], ), + floatingActionButton: + cubit != null && (cubit.isOnline || widget.outbox != null) + ? FloatingActionButton.extended( + key: const Key('market.shareMine'), + onPressed: _shareMine, + icon: const Icon(Icons.campaign_outlined), + label: Text(t.market.shareMine), + ) + : null, body: _loading || cubit == null ? const Center(child: CircularProgressIndicator()) : BlocProvider.value( @@ -232,7 +234,7 @@ class MarketBody extends StatelessWidget { return _OfferCard( offer: o, mine: mine, - onContact: mine ? null : () => context.go('/chat/${o.authorPubkeyHex}'), + onContact: mine ? null : () => context.push('/chat/${o.authorPubkeyHex}'), ); }, );