Skip to content

Commit

Permalink
Merge pull request #17 from joshuachinemezu/feature/button-color
Browse files Browse the repository at this point in the history
Add ability to set custom background color
  • Loading branch information
hifiaz committed Sep 8, 2020
2 parents 862026a + 5337c3a commit 5b0b704
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -76,6 +78,7 @@ class _MyAppState extends State<MyApp> {
isShowCode: true,
isDownIcon: true,
initialSelection: '+62',
backgroundColor: Colors.transparent,
onChanged: (CountryCode code) {
print(code.name);
print(code.code);
Expand Down
4 changes: 3 additions & 1 deletion lib/country_list_pick.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ 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;
final bool isDownIcon;
final String initialSelection;
final bool showEnglishName;
final ValueChanged<CountryCode> onChanged;
final Color backgroundColor;

@override
_CountryListPickState createState() {
Expand Down Expand Up @@ -75,6 +76,7 @@ class _CountryListPickState extends State<CountryListPick> {
@override
Widget build(BuildContext context) {
return FlatButton(
color: widget.backgroundColor,
onPressed: () {
_awaitFromSelectScreen(context);
},
Expand Down

0 comments on commit 5b0b704

Please sign in to comment.