modal_bottom_sheet icon indicating copy to clipboard operation
modal_bottom_sheet copied to clipboard

Expose RouteSettings in show...() methods.

Open JHBitencourt opened this issue 5 years ago • 1 comments

I can see that ModalBottomSheetRoute has a RouteSettings parameter that is passed on to PopupRoute.

It would be cool if we could use this route settings with showMaterialModalBottomSheet() for example.

Future<T> showMaterialModalBottomSheet<T>({
  ...,
  RouteSettings settings,
}) async {
final result = await Navigator.of(context, rootNavigator: useRootNavigator)
      .push(ModalBottomSheetRoute<T>(
    settings: settings,
  ));
  return result;
}

This way we could pass arguments to new routes:

RouteSettings(arguments: [someId])

JHBitencourt avatar Sep 28 '20 20:09 JHBitencourt

This is a great idea. I will take a look when I have more time 🙂

jamesblasco avatar Sep 28 '20 20:09 jamesblasco