showCountryPicker function

Future<Country?> showCountryPicker({
  1. required BuildContext context,
  2. required Country defaultCountry,
})

Implementation

Future<Country?> showCountryPicker({
  required BuildContext context,
  required Country defaultCountry,
}) async {
  assert(Country.findCountryByIsoCode(defaultCountry.isoCode) != null);

  return await showDialog<Country>(
    context: context,
    barrierDismissible: true,
    builder: (BuildContext context) => _CountryPickerDialog(
      defaultCountry: defaultCountry,
      withBottomSheet: false,
    ),
  );
}