flutter/flutter

[State Restoration] Bottom Sheet

Opened this issue · 2 comments

To show a bottom sheet, one needs to call Scaffold.of(context).showBottomSheet, which takes a builder for the content to display when the bottom sheet is displayed. AFAICT, there's no straightforward way for users to make the bottom sheet state restorable and we may need to provide this support directly in the Scaffold widget.

First discovered trying to make the Flutter Gallery's bottom sheet demo state restorable.

We could add a showRestorableBottomSheet method. It would have to take a static builder callback similar to how restorablePush works on the navigator.

There isn't a way to restore state from modal bottom sheet, like the example for showDialog from State Restoration document), right?

Currently, _ModalBottomSheetRoute is private, so it's not possible to create it from a static method to use in pushRestorable, like is possible with DialogRoute.