From 0e7bb9ab992c94361d5964b6f74da79faa3d2794 Mon Sep 17 00:00:00 2001 From: Moaz El-sawaf <43591891+moazelsawaf@users.noreply.github.com> Date: Thu, 15 Apr 2021 02:15:35 +0200 Subject: [PATCH 1/2] Remove the padding around the custom built picker By replacing the TextButton with GestureDetector, the padding around the custom built picker would be removed because the TextButton has a default padding while GestureDetector not. --- lib/country_list_pick.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/country_list_pick.dart b/lib/country_list_pick.dart index a67323a..6e3af01 100644 --- a/lib/country_list_pick.dart +++ b/lib/country_list_pick.dart @@ -97,8 +97,8 @@ class _CountryListPickState extends State { @override Widget build(BuildContext context) { - return TextButton( - onPressed: () { + return GestureDetector( + onTap: () { _awaitFromSelectScreen(context, widget.appBar, widget.theme); }, child: widget.pickerBuilder != null From 5185d1f273f1f9c40bb148bf39c39e0e933fdf21 Mon Sep 17 00:00:00 2001 From: Moaz El-sawaf <43591891+moazelsawaf@users.noreply.github.com> Date: Thu, 15 Apr 2021 02:33:22 +0200 Subject: [PATCH 2/2] Change the background color --- lib/selection_list.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/selection_list.dart b/lib/selection_list.dart index d8e979b..2e728bb 100644 --- a/lib/selection_list.dart +++ b/lib/selection_list.dart @@ -6,6 +6,8 @@ import 'package:flutter/services.dart'; import 'country_list_pick.dart'; +const Color kBackgroundColor = Color(0xFFFBFBFB); + class SelectionList extends StatefulWidget { SelectionList(this.elements, this.initialSelection, {Key? key, @@ -97,7 +99,7 @@ class _SelectionListState extends State { child: Text(widget.theme?.searchText ?? 'SEARCH'), ), Container( - color: Colors.white, + color: kBackgroundColor, child: TextField( controller: _controller, decoration: InputDecoration( @@ -120,7 +122,7 @@ class _SelectionListState extends State { Text(widget.theme?.lastPickText ?? 'LAST PICK'), ), Container( - color: Colors.white, + color: kBackgroundColor, child: Material( color: Colors.transparent, child: ListTile( @@ -181,7 +183,7 @@ class _SelectionListState extends State { Widget getListCountry(CountryCode e) { return Container( height: 50, - color: Colors.white, + color: kBackgroundColor, child: Material( color: Colors.transparent, child: ListTile(