From 7e27d7deade96d5e9bfde07a257fb986c5be05f7 Mon Sep 17 00:00:00 2001 From: -Daniel Ioannou Date: Sun, 28 Jan 2024 23:26:34 +0200 Subject: [PATCH 1/3] #132: Move emojiFontFamilyFallback into CountryListThemeData --- example/ios/Flutter/AppFrameworkInfo.plist | 2 +- example/ios/Runner.xcodeproj/project.pbxproj | 6 +++--- lib/country_picker.dart | 2 -- lib/src/country_list_bottom_sheet.dart | 4 ---- lib/src/country_list_theme_data.dart | 4 ++++ lib/src/country_list_view.dart | 8 ++------ 6 files changed, 10 insertions(+), 16 deletions(-) diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist index 4f8d4d2..8c6e561 100644 --- a/example/ios/Flutter/AppFrameworkInfo.plist +++ b/example/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 11.0 + 12.0 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 28ee8bf..d22e377 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -283,7 +283,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -369,7 +369,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -418,7 +418,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; diff --git a/lib/country_picker.dart b/lib/country_picker.dart index a9b823f..d19eb9d 100644 --- a/lib/country_picker.dart +++ b/lib/country_picker.dart @@ -58,7 +58,6 @@ void showCountryPicker({ bool showWorldWide = false, bool showSearch = true, bool useSafeArea = false, - List? emojiFontFamilyFallback, bool useRootNavigator = false, }) { assert( @@ -79,7 +78,6 @@ void showCountryPicker({ showWorldWide: showWorldWide, showSearch: showSearch, useSafeArea: useSafeArea, - emojiFontFamilyFallback: emojiFontFamilyFallback, useRootNavigator: useRootNavigator, ); } diff --git a/lib/src/country_list_bottom_sheet.dart b/lib/src/country_list_bottom_sheet.dart index bacc6ff..23aec37 100644 --- a/lib/src/country_list_bottom_sheet.dart +++ b/lib/src/country_list_bottom_sheet.dart @@ -18,7 +18,6 @@ void showCountryListBottomSheet({ bool showWorldWide = false, bool showSearch = true, bool useSafeArea = false, - List? emojiFontFamilyFallback, bool useRootNavigator = false, }) { showModalBottomSheet( @@ -38,7 +37,6 @@ void showCountryListBottomSheet({ searchAutofocus, showWorldWide, showSearch, - emojiFontFamilyFallback, customFlagBuilder, ), ).whenComplete(() { @@ -57,7 +55,6 @@ Widget _builder( bool searchAutofocus, bool showWorldWide, bool showSearch, - List? emojiFontFamilyFallback, CustomFlagBuilder? customFlagBuilder, ) { final device = MediaQuery.of(context).size.height; @@ -100,7 +97,6 @@ Widget _builder( searchAutofocus: searchAutofocus, showWorldWide: showWorldWide, showSearch: showSearch, - emojiFontFamilyFallback: emojiFontFamilyFallback, customFlagBuilder: customFlagBuilder, ), ); diff --git a/lib/src/country_list_theme_data.dart b/lib/src/country_list_theme_data.dart index 5c610f0..1e4f052 100644 --- a/lib/src/country_list_theme_data.dart +++ b/lib/src/country_list_theme_data.dart @@ -21,6 +21,9 @@ class CountryListThemeData { /// If null, set to 25 final double? flagSize; + ///Custom emoji font family fallback for flags icons + final List? emojiFontFamilyFallback; + ///The decoration used for the search field /// /// It defaults to a basic outline-bordered input decoration @@ -58,5 +61,6 @@ class CountryListThemeData { this.bottomSheetWidth, this.padding, this.margin, + this.emojiFontFamilyFallback, }); } diff --git a/lib/src/country_list_view.dart b/lib/src/country_list_view.dart index 02b18e0..def7bc0 100644 --- a/lib/src/country_list_view.dart +++ b/lib/src/country_list_view.dart @@ -45,9 +45,6 @@ class CountryListView extends StatefulWidget { /// An optional argument for hiding the search bar final bool showSearch; - ///Custom emoji fontfamily fallback for flags icons - final List? emojiFontFamilyFallback; - /// Custom builder function for flag widget final CustomFlagBuilder? customFlagBuilder; @@ -63,7 +60,6 @@ class CountryListView extends StatefulWidget { this.showWorldWide = false, this.showSearch = true, this.customFlagBuilder, - this.emojiFontFamilyFallback, }) : assert( exclude == null || countryFilter == null, 'Cannot provide both exclude and countryFilter', @@ -251,7 +247,7 @@ class _CountryListViewState extends State { : Utils.countryCodeToEmoji(country.countryCode), style: TextStyle( fontSize: widget.countryListTheme?.flagSize ?? 25, - fontFamilyFallback: widget.emojiFontFamilyFallback, + fontFamilyFallback: widget.countryListTheme?.emojiFontFamilyFallback, ), ); @@ -272,4 +268,4 @@ class _CountryListViewState extends State { } TextStyle get _defaultTextStyle => const TextStyle(fontSize: 16); -} \ No newline at end of file +} From 1a3ccdccb6eb1db00e68a9eff957154d059370ff Mon Sep 17 00:00:00 2001 From: -Daniel Ioannou Date: Mon, 29 Jan 2024 21:36:28 +0200 Subject: [PATCH 2/3] Increment version --- example/pubspec.lock | 2 +- pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/example/pubspec.lock b/example/pubspec.lock index bf4d5f5..9d042f6 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -47,7 +47,7 @@ packages: path: ".." relative: true source: path - version: "2.0.23" + version: "2.0.24" fake_async: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 0c27b5f..4965212 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: country_picker description: A flutter package to select a country from a list of countries. -version: 2.0.23 +version: 2.0.24 homepage: https://github.com/Daniel-Ioannou repository: https://github.com/Daniel-Ioannou/flutter_country_picker From 18151bd27470dcd83d7b31ce5a8a6a2285d9966b Mon Sep 17 00:00:00 2001 From: Daniel Ioannou Date: Mon, 29 Jan 2024 21:42:29 +0200 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e32c3ac..405487a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +## 2.0.24 + * Add option for bottom sheet Width. + ```Dart + showCountryPicker( + context: context, + countryListTheme: CountryListThemeData( + bottomSheetWidth: 500, // Optional. Country list modal Width + ), + onSelect: (Country country) => print('Select country: ${country.displayName}'), + ); + ``` + * Add `emojiFontFamilyFallback` + ## 2.0.23 * Export `CustomFlagBuilder` * Add parameter `useRootNavigator`