From af5f567a35ae42f67cafda8ec6145412cf16837d Mon Sep 17 00:00:00 2001 From: Hector Fernandez Date: Tue, 9 Feb 2021 00:07:37 +0100 Subject: [PATCH 1/2] feat: set the bg color of the input fields --- lib/country_selection_theme.dart | 4 ++++ lib/selection_list.dart | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/country_selection_theme.dart b/lib/country_selection_theme.dart index 4c5de38..feb16b9 100644 --- a/lib/country_selection_theme.dart +++ b/lib/country_selection_theme.dart @@ -7,6 +7,8 @@ class CountryTheme { final Color alphabetSelectedBackgroundColor; final Color alphabetTextColor; final Color alphabetSelectedTextColor; + final Color inputFieldBgColor; + final Color dividerTextColor; final bool isShowTitle; final bool isShowFlag; final bool isShowCode; @@ -23,6 +25,8 @@ class CountryTheme { this.alphabetSelectedBackgroundColor, this.alphabetTextColor, this.alphabetSelectedTextColor, + this.dividerTextColor, + this.inputFieldBgColor, this.isShowTitle, this.isShowFlag, this.isShowCode, diff --git a/lib/selection_list.dart b/lib/selection_list.dart index e5a5eb4..2d2a401 100644 --- a/lib/selection_list.dart +++ b/lib/selection_list.dart @@ -119,10 +119,10 @@ class _SelectionListState extends State { children: [ Padding( padding: const EdgeInsets.all(15.0), - child: Text(widget.theme?.searchText ?? 'SEARCH'), + child: Text(widget.theme?.searchText ?? 'SEARCH', style: TextStyle(color: widget.theme?.dividerTextColor ?? Colors.white)), ), Container( - color: Colors.white, + color: widget.theme?.inputFieldBgColor ?? Colors.white, child: TextField( controller: _controller, decoration: InputDecoration( @@ -142,10 +142,10 @@ class _SelectionListState extends State { Padding( padding: const EdgeInsets.all(15.0), child: - Text(widget.theme?.lastPickText ?? 'LAST PICK'), + Text(widget.theme?.lastPickText ?? 'LAST PICK', style: TextStyle(color: widget.theme?.dividerTextColor ?? Colors.white)), ), Container( - color: Colors.white, + color: widget.theme?.inputFieldBgColor ?? Colors.white, child: Material( color: Colors.transparent, child: ListTile( @@ -206,7 +206,7 @@ class _SelectionListState extends State { Widget getListCountry(CountryCode e) { return Container( height: 50, - color: Colors.white, + color: widget.theme?.inputFieldBgColor ?? Colors.white, child: Material( color: Colors.transparent, child: ListTile( From bf1554ca397f2a82b670927f1343694676ca2b57 Mon Sep 17 00:00:00 2001 From: Hector Fernandez Date: Tue, 9 Feb 2021 00:40:51 +0100 Subject: [PATCH 2/2] chore: set bg body color --- lib/country_selection_theme.dart | 2 ++ lib/selection_list.dart | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/country_selection_theme.dart b/lib/country_selection_theme.dart index feb16b9..f6769b8 100644 --- a/lib/country_selection_theme.dart +++ b/lib/country_selection_theme.dart @@ -9,6 +9,7 @@ class CountryTheme { final Color alphabetSelectedTextColor; final Color inputFieldBgColor; final Color dividerTextColor; + final Color bodyBgColor; final bool isShowTitle; final bool isShowFlag; final bool isShowCode; @@ -27,6 +28,7 @@ class CountryTheme { this.alphabetSelectedTextColor, this.dividerTextColor, this.inputFieldBgColor, + this.bodyBgColor, this.isShowTitle, this.isShowFlag, this.isShowCode, diff --git a/lib/selection_list.dart b/lib/selection_list.dart index 2d2a401..4f306fe 100644 --- a/lib/selection_list.dart +++ b/lib/selection_list.dart @@ -102,7 +102,7 @@ class _SelectionListState extends State { Widget scaffold = Scaffold( appBar: widget.appBar, body: Container( - color: Color(0xfff4f4f4), + color: widget.theme?.bodyBgColor ?? Color(0xfff4f4f4), child: LayoutBuilder(builder: (context, contrainsts) { diff = height - contrainsts.biggest.height; _heightscroller = (contrainsts.biggest.height) / _alphabet.length;