update version
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
## 1.3.4
|
||||||
|
|
||||||
|
- Add `showFlagDialog` and `showFlagMain`
|
||||||
|
|
||||||
## 1.3.3
|
## 1.3.3
|
||||||
|
|
||||||
- Fix a bug in localization
|
- Fix a bug in localization
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ class _MyAppState extends State<MyApp> {
|
|||||||
// Initial selection and favorite can be one of code ('IT') OR dial_code('+39')
|
// Initial selection and favorite can be one of code ('IT') OR dial_code('+39')
|
||||||
initialSelection: 'IT',
|
initialSelection: 'IT',
|
||||||
favorite: ['+39', 'FR'],
|
favorite: ['+39', 'FR'],
|
||||||
|
showFlag: false,
|
||||||
|
showFlagDialog: true,
|
||||||
//Get the country information relevant to the initial selection
|
//Get the country information relevant to the initial selection
|
||||||
onInit: (code) => print("${code.name} ${code.dialCode}"),
|
onInit: (code) => print("${code.name} ${code.dialCode}"),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -35,6 +35,10 @@ class CountryCodePicker extends StatefulWidget {
|
|||||||
/// shows the flag
|
/// shows the flag
|
||||||
final bool showFlag;
|
final bool showFlag;
|
||||||
|
|
||||||
|
final bool showFlagMain;
|
||||||
|
|
||||||
|
final bool showFlagDialog;
|
||||||
|
|
||||||
/// contains the country codes to load only the specified countries.
|
/// contains the country codes to load only the specified countries.
|
||||||
final List<String> countryFilter;
|
final List<String> countryFilter;
|
||||||
|
|
||||||
@@ -56,6 +60,8 @@ class CountryCodePicker extends StatefulWidget {
|
|||||||
this.showOnlyCountryWhenClosed = false,
|
this.showOnlyCountryWhenClosed = false,
|
||||||
this.alignLeft = false,
|
this.alignLeft = false,
|
||||||
this.showFlag = true,
|
this.showFlag = true,
|
||||||
|
this.showFlagDialog,
|
||||||
|
this.showFlagMain,
|
||||||
this.builder,
|
this.builder,
|
||||||
this.flagWidth = 32.0,
|
this.flagWidth = 32.0,
|
||||||
this.enabled = true,
|
this.enabled = true,
|
||||||
@@ -100,7 +106,7 @@ class _CountryCodePickerState extends State<CountryCodePicker> {
|
|||||||
direction: Axis.horizontal,
|
direction: Axis.horizontal,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
if (widget.showFlag)
|
if (widget.showFlag || (widget.showFlagMain == true))
|
||||||
Flexible(
|
Flexible(
|
||||||
flex: widget.alignLeft ? 0 : 1,
|
flex: widget.alignLeft ? 0 : 1,
|
||||||
fit: widget.alignLeft ? FlexFit.tight : FlexFit.loose,
|
fit: widget.alignLeft ? FlexFit.tight : FlexFit.loose,
|
||||||
@@ -135,6 +141,9 @@ class _CountryCodePickerState extends State<CountryCodePicker> {
|
|||||||
@override
|
@override
|
||||||
void didUpdateWidget(CountryCodePicker oldWidget) {
|
void didUpdateWidget(CountryCodePicker oldWidget) {
|
||||||
super.didUpdateWidget(oldWidget);
|
super.didUpdateWidget(oldWidget);
|
||||||
|
|
||||||
|
_onInit(selectedItem);
|
||||||
|
|
||||||
if (oldWidget.initialSelection != widget.initialSelection) {
|
if (oldWidget.initialSelection != widget.initialSelection) {
|
||||||
if (widget.initialSelection != null) {
|
if (widget.initialSelection != null) {
|
||||||
selectedItem = elements.firstWhere(
|
selectedItem = elements.firstWhere(
|
||||||
@@ -161,9 +170,6 @@ class _CountryCodePickerState extends State<CountryCodePicker> {
|
|||||||
selectedItem = elements[0];
|
selectedItem = elements[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
//Change added: get the initial entered country information
|
|
||||||
_onInit(selectedItem);
|
|
||||||
|
|
||||||
favoriteElements = elements
|
favoriteElements = elements
|
||||||
.where((e) =>
|
.where((e) =>
|
||||||
widget.favorite.firstWhere(
|
widget.favorite.firstWhere(
|
||||||
@@ -184,7 +190,7 @@ class _CountryCodePickerState extends State<CountryCodePicker> {
|
|||||||
emptySearchBuilder: widget.emptySearchBuilder,
|
emptySearchBuilder: widget.emptySearchBuilder,
|
||||||
searchDecoration: widget.searchDecoration,
|
searchDecoration: widget.searchDecoration,
|
||||||
searchStyle: widget.searchStyle,
|
searchStyle: widget.searchStyle,
|
||||||
showFlag: widget.showFlag,
|
showFlag: widget.showFlag || (widget.showFlagDialog == true),
|
||||||
flagWidth: widget.flagWidth,
|
flagWidth: widget.flagWidth,
|
||||||
),
|
),
|
||||||
).then((e) {
|
).then((e) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: country_code_picker
|
name: country_code_picker
|
||||||
description: A flutter package for showing a country code selector. In addition it gives the possibility to select a list of favorites countries, as well as to search using a simple searchbox
|
description: A flutter package for showing a country code selector. In addition it gives the possibility to select a list of favorites countries, as well as to search using a simple searchbox
|
||||||
version: 1.3.3
|
version: 1.3.4
|
||||||
homepage: https://github.com/Salvatore-Giordano/CountryCodePicker
|
homepage: https://github.com/Salvatore-Giordano/CountryCodePicker
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
Reference in New Issue
Block a user