showBottomSheet static method

void showBottomSheet(
  1. BuildContext context,
  2. Widget widget, {
  3. Color? color,
  4. bool isScrollControlled = true,
  5. bool enableDrag = false,
  6. RouteSettings routeSettings = const RouteSettings(name: "bottomSheet"),
})

展示 bottomSheet

Implementation

static void showBottomSheet(
    BuildContext context,
    Widget widget, {
      Color? color,
      bool isScrollControlled = true,
      bool enableDrag = false,
      RouteSettings routeSettings = const RouteSettings(name: "bottomSheet"),
    }) {
  showModalBottomSheet(
      context: context,
      isScrollControlled: isScrollControlled,
      enableDrag: enableDrag,
      barrierColor: color ?? Colors.black.withAlpha(1),
      backgroundColor: Colors.transparent,
      useRootNavigator: true,
      routeSettings: routeSettings,
      builder: (context) {
        return widget;
      });
}