fix(block2): back buttons on social screens + clear 'Share my seeds' button

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.
This commit is contained in:
vjrj 2026-07-10 12:40:08 +02:00
parent 30246f4292
commit 458502b12b
4 changed files with 15 additions and 13 deletions

View file

@ -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,
),

View file

@ -65,7 +65,7 @@ class _ChatListScreenState extends State<ChatListScreen> {
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
onTap: () => context.go('/chat/${c.peerPubkey}'),
onTap: () => context.push('/chat/${c.peerPubkey}'),
);
},
),

View file

@ -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,
),
],

View file

@ -148,13 +148,6 @@ class _MarketScreenState extends State<MarketScreen> {
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<MarketScreen> {
),
],
),
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}'),
);
},
);