showCountryPickerDialog static method
Future<CountryData?>
showCountryPickerDialog({
- required BuildContext context,
- LayoutConfig? layoutConfig,
- Widget? closeIconWidget,
- CountryListConfig? countryListConfig,
- SearchStyle? searchStyle,
- 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,
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,
),
),
);
},
);
}