showCountryPickerBottomSheet static method

Future<CountryData?> showCountryPickerBottomSheet({
  1. required BuildContext context,
  2. Color? backgroundColor,
  3. LayoutConfig? layoutConfig,
  4. List<String>? favouriteCountries,
  5. CountryListConfig? countryListConfig,
  6. SearchStyle? searchStyle,
  7. Widget? closeIconWidget,
  8. ShapeBorder? shape,
  9. Color? barrierColor,
  10. bool? useSafeArea,
  11. bool? isDismissible,
  12. Offset? anchorPoint,
  13. Clip? clipBehavior,
  14. bool? showSearchBar,
  15. BoxConstraints? constraints,
  16. bool? isScrollControlled,
  17. Text? header,
  18. String? barrierLabel,
  19. WidgetBuilder? emptySearchBuilder,
  20. double? elevation,
  21. bool? enableDrag,
  22. RouteSettings? routeSettings,
  23. EdgeInsetsGeometry? countryTilePadding,
  24. double? scrollControlDisabledMaxHeightRatio,
  25. bool? showDragHandle,
  26. AnimationController? transitionAnimationController,
  27. bool? useRootNavigator,
})

Implementation

static Future<CountryData?> showCountryPickerBottomSheet(
    {required BuildContext context,
    Color? backgroundColor,
    LayoutConfig? layoutConfig,
    List<String>? favouriteCountries,
    CountryListConfig? countryListConfig,
    SearchStyle? searchStyle,
    Widget? closeIconWidget,
    ShapeBorder? shape,
    Color? barrierColor,
    bool? useSafeArea,
    bool? isDismissible,
    Offset? anchorPoint,
    Clip? clipBehavior,
    bool? showSearchBar,
    BoxConstraints? constraints,
    bool? isScrollControlled,
    Text? header,
    String? barrierLabel,
    WidgetBuilder? emptySearchBuilder,
    double? elevation,
    bool? enableDrag,
    RouteSettings? routeSettings,
    EdgeInsetsGeometry? countryTilePadding,
    double? scrollControlDisabledMaxHeightRatio,
    bool? showDragHandle,
    AnimationController? transitionAnimationController,
    bool? useRootNavigator}) async {
  return await showModalBottomSheet(
    backgroundColor:
        backgroundColor ?? Theme.of(context).bottomSheetTheme.backgroundColor,
    shape: shape,
    barrierColor:
        barrierColor ?? Theme.of(context).bottomSheetTheme.modalBarrierColor,
    useSafeArea: useSafeArea ?? false,
    isDismissible: isDismissible ?? true,
    anchorPoint: anchorPoint,
    constraints: constraints,
    clipBehavior:
        clipBehavior ?? Theme.of(context).bottomSheetTheme.clipBehavior,
    isScrollControlled: isScrollControlled ?? false,
    barrierLabel: barrierLabel,
    elevation: elevation ?? Theme.of(context).bottomSheetTheme.elevation,
    enableDrag: enableDrag ?? true,
    routeSettings: routeSettings,
    scrollControlDisabledMaxHeightRatio:
        scrollControlDisabledMaxHeightRatio ?? 9.0 / 16.0,
    showDragHandle: showDragHandle ?? false,
    transitionAnimationController: transitionAnimationController,
    useRootNavigator: useRootNavigator ?? false,
    context: context,
    builder: (_) {
      return CountrySelectionBottomSheet(
        favouriteCountries: favouriteCountries,
        searchStyle: searchStyle,
        countryListConfig: countryListConfig,
        layoutConfig: layoutConfig,
        showSearchBar: showSearchBar,
        header: header,
        emptySearchBuilder: emptySearchBuilder,
        closeIconWidget: closeIconWidget,
        countryTilePadding: countryTilePadding,
      );
    },
  );
}