fix: wrap bottom bar menu button in Builder to get Scaffold context

Scaffold.of() requires a descendant context of the Scaffold widget.
Using the State's build context (which is the Scaffold's parent) caused
an assertion failure when tapping the 'Open folders' button.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Thomas SharedInbox
2026-05-27 22:05:39 +02:00
co-authored by Claude Sonnet 4.6
parent 907fdd06b1
commit 3df8b67002
+6 -4
View File
@@ -313,10 +313,12 @@ class _EmailListScreenState extends ConsumerState<EmailListScreen> {
return BottomAppBar(
child: Row(
children: [
IconButton(
icon: const Icon(Icons.menu),
tooltip: 'Open folders',
onPressed: () => Scaffold.of(context).openDrawer(),
Builder(
builder: (context) => IconButton(
icon: const Icon(Icons.menu),
tooltip: 'Open folders',
onPressed: () => Scaffold.of(context).openDrawer(),
),
),
],
),