showCountryPickerDialog static method

Future<CountryData?> showCountryPickerDialog({
  1. required BuildContext context,
  2. LayoutConfig? layoutConfig,
  3. Widget? closeIconWidget,
  4. CountryListConfig? countryListConfig,
  5. SearchStyle? searchStyle,
  6. List<String>? favouriteCountries,
  7. bool? isDismissible,
  8. Color? backgroundColor,
  9. BorderRadiusGeometry? borderRadius,
  10. bool? useSafeArea,
  11. AlignmentGeometry? alignment,
  12. Clip? clipBehavior,
  13. EdgeInsets? insetPadding,
  14. Color? shadowColor,
  15. Widget? header,
  16. Color? barrierColor,
  17. EdgeInsetsGeometry? countryTilePadding,
  18. bool? showSearchBar,
  19. Size? size,
  20. WidgetBuilder? emptySearchBuilder,
})

Implementation

static Future<CountryData?> showCountryPickerDialog({
  required BuildContext context,
  LayoutConfig? layoutConfig,
  Widget? closeIconWidget,
  CountryListConfig? countryListConfig,
  SearchStyle? searchStyle,

  /// favourite countries will be placed on the top of list.
  List<String>? favouriteCountries,
  bool? isDismissible,
  Color? backgroundColor,
  BorderRadiusGeometry? borderRadius,
  bool? useSafeArea,
  AlignmentGeometry? alignment,
  Clip? clipBehavior,
  EdgeInsets? insetPadding,
  Color? shadowColor,
  Widget? header,
  Color? barrierColor,
  EdgeInsetsGeometry? countryTilePadding,
  bool? showSearchBar,
  Size? size,
  WidgetBuilder? emptySearchBuilder,
}) async {
  return await showDialog(
    useSafeArea: useSafeArea ?? true,
    barrierDismissible: isDismissible ?? true,
    barrierColor: barrierColor,
    context: context,
    builder: (context) {
      return Center(
        child: Dialog(
          backgroundColor: Colors.transparent,
          shadowColor: shadowColor,
          insetPadding: insetPadding,
          clipBehavior: clipBehavior ?? Clip.none,
          alignment: alignment,
          child: CountrySelectionDialog(
            searchStyle: searchStyle,
            favouriteCountries: favouriteCountries,
            countryListConfig: countryListConfig,
            closeIconWidget: closeIconWidget,
            layoutConfig: layoutConfig,
            borderRadius: borderRadius,
            backGroundColor:
                backgroundColor ?? Theme.of(context).dialogBackgroundColor,
            countryTilePadding: countryTilePadding,
            emptySearchBuilder: emptySearchBuilder,
            showSearchBar: showSearchBar,
            size: size,
            header: header,
          ),
        ),
      );
    },
  );
}