CountryCodePickerModal constructor

const CountryCodePickerModal({
  1. required bool localize,
  2. required Icon? favoritesIcon,
  3. required bool showSearchBar,
  4. required bool showDialCode,
  5. Widget? title,
  6. Color defaultAppbarBackgroundColor = Colors.white,
  7. Color defaultAppbarForegroundColor = Colors.black,
  8. Color defaultAppbarCloseIconBackgroundColor = const Color.fromARGB(255, 224, 224, 224),
  9. String defaultAppbarText = 'Select Country Code',
  10. IconData defaultAppbarCloseIcon = Icons.clear_rounded,
  11. String? focusedCountry,
  12. InputDecoration? searchBarDecoration,
  13. List<String> favorites = const [],
  14. List<String> filteredCountries = const [],
  15. TextStyle? countryTextStyle,
  16. TextStyle? dialCodeTextStyle,
  17. double? horizontalTitleGap,
  18. TextStyle? searchBarTextStyle,
  19. Key? key,
})

Widget that can be used on showing a modal as bottom sheet that contains all of the CountryCodes.

After pressing the CountryCode's ListTile, the widget pops and returns the selected CountryCode which can be manipulated.

Implementation

const CountryCodePickerModal({
  required this.localize,
  required this.favoritesIcon,
  required this.showSearchBar,
  required this.showDialCode,
  this.title,
  this.defaultAppbarBackgroundColor = Colors.white,
  this.defaultAppbarForegroundColor = Colors.black,
  this.defaultAppbarCloseIconBackgroundColor =
      const Color.fromARGB(255, 224, 224, 224),
  this.defaultAppbarText = 'Select Country Code',
  this.defaultAppbarCloseIcon = Icons.clear_rounded,
  this.focusedCountry,
  this.searchBarDecoration,
  this.favorites = const [],
  this.filteredCountries = const [],
  this.countryTextStyle,
  this.dialCodeTextStyle,
  this.horizontalTitleGap,
  this.searchBarTextStyle,
  super.key,
});