From bb9300d7d153ceb35e219fd3a3efd479d0ad28f9 Mon Sep 17 00:00:00 2001 From: Joshua Chinemezu Date: Sun, 6 Sep 2020 19:03:47 +0400 Subject: [PATCH 1/2] Add ability to set custom background color --- lib/country_list_pick.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/country_list_pick.dart b/lib/country_list_pick.dart index bea5932..2355cce 100644 --- a/lib/country_list_pick.dart +++ b/lib/country_list_pick.dart @@ -14,7 +14,7 @@ class CountryListPick extends StatefulWidget { this.isShowCode, this.isShowTitle, this.initialSelection, - this.showEnglishName}); + this.showEnglishName, this.backgroundColor}); final bool isShowTitle; final bool isShowFlag; final bool isShowCode; @@ -22,6 +22,7 @@ class CountryListPick extends StatefulWidget { final String initialSelection; final bool showEnglishName; final ValueChanged onChanged; + final Color backgroundColor; @override _CountryListPickState createState() { @@ -75,6 +76,7 @@ class _CountryListPickState extends State { @override Widget build(BuildContext context) { return FlatButton( + color: widget.backgroundColor, onPressed: () { _awaitFromSelectScreen(context); }, From 5337c3aad0bcfcfa7561ff441d17b7a13df2418c Mon Sep 17 00:00:00 2001 From: Joshua Chinemezu Date: Sun, 6 Sep 2020 19:13:13 +0400 Subject: [PATCH 2/2] Update README --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 09c3b8e..e507670 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,10 @@ To use this plugin, add `country_list_pick` as a [dependency in your pubspec.yam isDownIcon: true, // to show country in English showEnglishName: true, - // to initial code number countrey + // to initial code number country initialSelection: '+62', + // to change background color of the widget + backgroundColor: Colors.transparent, // to get feedback data from picker onChanged: (CountryCode code) { // name of country @@ -76,6 +78,7 @@ class _MyAppState extends State { isShowCode: true, isDownIcon: true, initialSelection: '+62', + backgroundColor: Colors.transparent, onChanged: (CountryCode code) { print(code.name); print(code.code);