fix(drawer): scroll destinations, pin the utility footer
The drawer was a single Column with a Spacer pinning intro/Settings/About to the bottom. Once Calendar was added it overflowed a short screen (~94px), so Settings and About fell off-screen and their navigation tests couldn't tap them. Put the destinations in a scrolling ListView and keep the header and the utility footer pinned, so Settings/About stay reachable at any height. Fixes the about_screen/home_screen drawer navigation tests.
This commit is contained in:
parent
dcda349878
commit
a5f50314e4
1 changed files with 80 additions and 68 deletions
|
|
@ -27,78 +27,90 @@ class AppDrawer extends StatelessWidget {
|
|||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
const _DrawerHeader(),
|
||||
_DrawerItem(
|
||||
icon: const SeedGlyph(SeedGlyphs.jars, size: 23),
|
||||
label: t.menu.inventory,
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
context.push('/inventory');
|
||||
},
|
||||
),
|
||||
// Local, works offline — a reproduction-commitment ledger.
|
||||
_DrawerItem(
|
||||
icon: const Icon(Icons.volunteer_activism_outlined),
|
||||
label: t.menu.plantares,
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
context.push('/plantares');
|
||||
},
|
||||
),
|
||||
// Local sales ledger — also offline.
|
||||
_DrawerItem(
|
||||
icon: const Icon(Icons.sell_outlined),
|
||||
label: t.menu.sales,
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
context.push('/sales');
|
||||
},
|
||||
),
|
||||
// "What's due this month" — the aggregate crop calendar, offline.
|
||||
_DrawerItem(
|
||||
icon: const Icon(Icons.calendar_month),
|
||||
label: t.menu.calendar,
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
context.push('/calendar');
|
||||
},
|
||||
),
|
||||
_DrawerItem(
|
||||
icon: const Icon(Symbols.storefront),
|
||||
label: t.menu.market,
|
||||
divider: true,
|
||||
onTap: marketEnabled
|
||||
? () {
|
||||
// The destinations scroll; the header above and the utility footer
|
||||
// below stay pinned, so Settings/About are always reachable even on
|
||||
// a short screen (drawer used to overflow once Calendar was added).
|
||||
Expanded(
|
||||
child: ListView(
|
||||
padding: EdgeInsets.zero,
|
||||
children: [
|
||||
_DrawerItem(
|
||||
icon: const SeedGlyph(SeedGlyphs.jars, size: 23),
|
||||
label: t.menu.inventory,
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
context.push('/market');
|
||||
}
|
||||
: null,
|
||||
),
|
||||
_DrawerItem(
|
||||
icon: const Icon(Icons.person),
|
||||
label: t.menu.profile,
|
||||
onTap: marketEnabled
|
||||
? () {
|
||||
context.push('/inventory');
|
||||
},
|
||||
),
|
||||
// Local, works offline — a reproduction-commitment ledger.
|
||||
_DrawerItem(
|
||||
icon: const Icon(Icons.volunteer_activism_outlined),
|
||||
label: t.menu.plantares,
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
context.push('/profile');
|
||||
}
|
||||
: null,
|
||||
),
|
||||
_DrawerItem(
|
||||
icon: const UnreadBadge(child: Icon(Icons.chat_bubble)),
|
||||
label: t.menu.chat,
|
||||
onTap: marketEnabled
|
||||
? () {
|
||||
context.push('/plantares');
|
||||
},
|
||||
),
|
||||
// Local sales ledger — also offline.
|
||||
_DrawerItem(
|
||||
icon: const Icon(Icons.sell_outlined),
|
||||
label: t.menu.sales,
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
context.push('/messages');
|
||||
}
|
||||
: null,
|
||||
context.push('/sales');
|
||||
},
|
||||
),
|
||||
// "What's due this month" — the aggregate crop calendar.
|
||||
_DrawerItem(
|
||||
icon: const Icon(Icons.calendar_month),
|
||||
label: t.menu.calendar,
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
context.push('/calendar');
|
||||
},
|
||||
),
|
||||
_DrawerItem(
|
||||
icon: const Icon(Symbols.storefront),
|
||||
label: t.menu.market,
|
||||
divider: true,
|
||||
onTap: marketEnabled
|
||||
? () {
|
||||
Navigator.of(context).pop();
|
||||
context.push('/market');
|
||||
}
|
||||
: null,
|
||||
),
|
||||
_DrawerItem(
|
||||
icon: const Icon(Icons.person),
|
||||
label: t.menu.profile,
|
||||
onTap: marketEnabled
|
||||
? () {
|
||||
Navigator.of(context).pop();
|
||||
context.push('/profile');
|
||||
}
|
||||
: null,
|
||||
),
|
||||
_DrawerItem(
|
||||
icon: const UnreadBadge(child: Icon(Icons.chat_bubble)),
|
||||
label: t.menu.chat,
|
||||
onTap: marketEnabled
|
||||
? () {
|
||||
Navigator.of(context).pop();
|
||||
context.push('/messages');
|
||||
}
|
||||
: null,
|
||||
),
|
||||
_DrawerItem(
|
||||
icon: const Icon(Icons.favorite),
|
||||
label: t.menu.wishlist,
|
||||
),
|
||||
_DrawerItem(
|
||||
icon: const Icon(Icons.group),
|
||||
label: t.menu.following,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
_DrawerItem(
|
||||
icon: const Icon(Icons.favorite),
|
||||
label: t.menu.wishlist,
|
||||
),
|
||||
_DrawerItem(icon: const Icon(Icons.group), label: t.menu.following),
|
||||
const Spacer(),
|
||||
const Divider(height: 1),
|
||||
_DrawerItem(
|
||||
icon: const Icon(Icons.auto_stories_outlined),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue