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:
co-authored by
Claude Sonnet 4.6
parent
e1ccfabfdd
commit
ef3d278c5f
@@ -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(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user