diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fd03c9..5945433 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ -## 1.1.8 -- Added Ability to render custom Widget instead of package one's, through [customWidget] param [@Saifallak](https://github.com/Saifallak). +## 1.2.0 +Added Ability to render custom Widget instead of package one's. + +Bug fix. ## 1.1.7 diff --git a/README.md b/README.md index ba1553f..2201ef2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Pub](https://img.shields.io/badge/Pub-1.1.7-orange.svg)](https://pub.dartlang.org/packages/country_code_picker) +[![Pub](https://img.shields.io/badge/Pub-1.1.8-orange.svg)](https://pub.dartlang.org/packages/country_code_picker) # country_code_picker diff --git a/lib/country_code_picker.dart b/lib/country_code_picker.dart index 97e9b46..dbef894 100644 --- a/lib/country_code_picker.dart +++ b/lib/country_code_picker.dart @@ -19,7 +19,7 @@ class CountryCodePicker extends StatefulWidget { final InputDecoration searchDecoration; final TextStyle searchStyle; final WidgetBuilder emptySearchBuilder; - final Widget customWidget; + final Function(CountryCode) builder; /// shows the name of the country instead of the dialcode final bool showOnlyCountryWhenClosed; @@ -52,7 +52,7 @@ class CountryCodePicker extends StatefulWidget { this.showOnlyCountryWhenClosed = false, this.alignLeft = false, this.showFlag = true, - this.customWidget, + this.builder, }); @override @@ -88,10 +88,10 @@ class _CountryCodePickerState extends State { @override Widget build(BuildContext context) { Widget _widget; - if (widget.customWidget != null) + if (widget.builder != null) _widget = InkWell( onTap: _showSelectionDialog, - child: widget.customWidget, + child: widget.builder(selectedItem), ); else { _widget = FlatButton(