showBottomSheet function

Future<Country?> showBottomSheet({
  1. required BuildContext context,
  2. required Country defaultCountry,
  3. required bool withBottomSheet,
})

Implementation

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

  return await showModalBottomSheet<Country>(
      context: context,
      backgroundColor: Colors.white,
      isScrollControlled: true,
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.circular(10.0),
      ),
      isDismissible: true,
      builder: (context) {
        return _CountryPickerDialog(
          defaultCountry: defaultCountry,
          withBottomSheet: withBottomSheet,
        );
      });
}