showWithHandler static method

BottomSheetHandler showWithHandler(
  1. BuildContext context, {
  2. bool useRootNavigator = false,
  3. String? title,
  4. String? message,
  5. required List<ActionSheetItem> actions,
  6. String? cancelText,
  7. bool showCancel = true,
})

Implementation

static BottomSheetHandler showWithHandler(
  BuildContext context, {
  bool useRootNavigator = false,
  String? title,
  String? message,
  required List<ActionSheetItem> actions,
  String? cancelText,
  bool showCancel = true,
}) {
  final handler = BottomSheetHandler();
  final route = ActionSheet.showModalBottomSheetBySystem(
    context: context,
    useRootNavigator: useRootNavigator,
    backgroundColor: Colors.transparent,
    builder: (buildContext) {
      return _createWidget(buildContext,
          title: title, message: message, actions: actions, showCancel: showCancel, cancelText: cancelText);
    },
  );
  final navigator = Navigator.of(context, rootNavigator: useRootNavigator);
  handler._navigatorState = navigator;
  handler._route = route;
  BottomSheetGuard.instance.trackRoute(route);
  return handler;
}