Skip to content
This repository was archived by the owner on Jul 12, 2024. It is now read-only.

Commit 8e3933e

Browse files
authored
Merge pull request #31 from langx/fix-filter-theme
"Refactor search and filter icons, update FiltersPage UI"
2 parents 46978c4 + a52dd1c commit 8e3933e

File tree

2 files changed

+28
-58
lines changed

2 files changed

+28
-58
lines changed

lib/pages/home/community.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ class _CommunityState extends ConsumerState<Community>
7373
Row(
7474
children: [
7575
IconButton(
76-
icon: const Icon(Icons.search, size: 30),
76+
icon: const Icon(Icons.search),
7777
onPressed: () {},
7878
),
7979
IconButton(
80-
icon: const Icon(Icons.filter_list, size: 30),
80+
icon: const Icon(Icons.filter_list),
8181
onPressed: () {
8282
Navigator.push(
8383
context,

lib/pages/home/filters.dart

+26-56
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ class FiltersPageState extends State<FiltersPage> {
2828
@override
2929
Widget build(BuildContext context) {
3030
return Scaffold(
31-
backgroundColor: Colors.white,
3231
appBar: AppBar(
3332
backgroundColor: Colors.yellow[700],
3433
leading: IconButton(
@@ -113,20 +112,9 @@ class FiltersPageState extends State<FiltersPage> {
113112
_buildFilterSection(
114113
title: 'Age',
115114
options: [
116-
Container(
117-
decoration: const BoxDecoration(
118-
border: Border(
119-
bottom: BorderSide(
120-
color: Colors.grey,
121-
width: 1.0,
122-
),
123-
),
124-
),
125-
child: ListTile(
126-
leading:
127-
Icon(Icons.calendar_today, color: Colors.yellow[700]),
128-
title: Text(rangeLable),
129-
),
115+
ListTile(
116+
leading: Icon(Icons.calendar_today, color: Colors.yellow[700]),
117+
title: Text(rangeLable),
130118
),
131119
Padding(
132120
padding: const EdgeInsets.symmetric(horizontal: 16.0),
@@ -162,7 +150,7 @@ class FiltersPageState extends State<FiltersPage> {
162150
),
163151
onPressed: () {},
164152
child: const Text(
165-
'APPLY',
153+
'Apply',
166154
style: TextStyle(fontSize: 16),
167155
),
168156
),
@@ -179,7 +167,6 @@ class FiltersPageState extends State<FiltersPage> {
179167
}) {
180168
return Card(
181169
elevation: 8.0,
182-
color: Colors.white,
183170
shape: RoundedRectangleBorder(
184171
borderRadius: BorderRadius.circular(16.0),
185172
),
@@ -190,7 +177,10 @@ class FiltersPageState extends State<FiltersPage> {
190177
crossAxisAlignment: CrossAxisAlignment.start,
191178
children: [
192179
ListTile(
193-
title: Text(title),
180+
title: Text(
181+
title,
182+
style: const TextStyle(fontSize: 25),
183+
),
194184
trailing: hasArrow ? const Icon(Icons.arrow_forward_ios) : null,
195185
),
196186
Column(children: options),
@@ -202,48 +192,28 @@ class FiltersPageState extends State<FiltersPage> {
202192

203193
Widget _buildOptionRow(String text, StatelessWidget icon, bool selection,
204194
BoolCallback onChange) {
205-
return Container(
206-
decoration: const BoxDecoration(
207-
border: Border(
208-
bottom: BorderSide(
209-
color: Colors.grey,
210-
width: 1.0,
211-
),
212-
),
213-
),
214-
child: ListTile(
215-
leading: icon,
216-
title: Text(text),
217-
trailing: Checkbox(
218-
activeColor: Colors.yellow[700],
219-
checkColor: Colors.black,
220-
value: selection,
221-
onChanged: onChange),
222-
),
195+
return ListTile(
196+
leading: icon,
197+
title: Text(text),
198+
trailing: Checkbox(
199+
activeColor: Colors.yellow[700],
200+
checkColor: Colors.black,
201+
value: selection,
202+
onChanged: onChange),
223203
);
224204
}
225205

226206
Widget _buildOptionRow2(String text, StatelessWidget icon) {
227-
return Container(
228-
decoration: const BoxDecoration(
229-
border: Border(
230-
bottom: BorderSide(
231-
color: Colors.grey,
232-
width: 1.0,
233-
),
234-
),
235-
),
236-
child: ListTile(
237-
leading: icon,
238-
title: Text(text),
239-
trailing: IconButton(
240-
iconSize: 30,
241-
icon: const Icon(Icons.chevron_right),
242-
onPressed: () {
243-
debugPrint("Print");
244-
},
245-
color: Colors.grey,
246-
),
207+
return ListTile(
208+
leading: icon,
209+
title: Text(text),
210+
trailing: IconButton(
211+
iconSize: 30,
212+
icon: const Icon(Icons.chevron_right),
213+
onPressed: () {
214+
debugPrint("Print");
215+
},
216+
color: Colors.grey,
247217
),
248218
);
249219
}

0 commit comments

Comments
 (0)