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

Commit

Permalink
Merge pull request #31 from langx/fix-filter-theme
Browse files Browse the repository at this point in the history
"Refactor search and filter icons, update FiltersPage UI"
  • Loading branch information
xuelink authored Jun 29, 2024
2 parents 46978c4 + a52dd1c commit 8e3933e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 58 deletions.
4 changes: 2 additions & 2 deletions lib/pages/home/community.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ class _CommunityState extends ConsumerState<Community>
Row(
children: [
IconButton(
icon: const Icon(Icons.search, size: 30),
icon: const Icon(Icons.search),
onPressed: () {},
),
IconButton(
icon: const Icon(Icons.filter_list, size: 30),
icon: const Icon(Icons.filter_list),
onPressed: () {
Navigator.push(
context,
Expand Down
82 changes: 26 additions & 56 deletions lib/pages/home/filters.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class FiltersPageState extends State<FiltersPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
appBar: AppBar(
backgroundColor: Colors.yellow[700],
leading: IconButton(
Expand Down Expand Up @@ -113,20 +112,9 @@ class FiltersPageState extends State<FiltersPage> {
_buildFilterSection(
title: 'Age',
options: [
Container(
decoration: const BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
),
child: ListTile(
leading:
Icon(Icons.calendar_today, color: Colors.yellow[700]),
title: Text(rangeLable),
),
ListTile(
leading: Icon(Icons.calendar_today, color: Colors.yellow[700]),
title: Text(rangeLable),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
Expand Down Expand Up @@ -162,7 +150,7 @@ class FiltersPageState extends State<FiltersPage> {
),
onPressed: () {},
child: const Text(
'APPLY',
'Apply',
style: TextStyle(fontSize: 16),
),
),
Expand All @@ -179,7 +167,6 @@ class FiltersPageState extends State<FiltersPage> {
}) {
return Card(
elevation: 8.0,
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16.0),
),
Expand All @@ -190,7 +177,10 @@ class FiltersPageState extends State<FiltersPage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ListTile(
title: Text(title),
title: Text(
title,
style: const TextStyle(fontSize: 25),
),
trailing: hasArrow ? const Icon(Icons.arrow_forward_ios) : null,
),
Column(children: options),
Expand All @@ -202,48 +192,28 @@ class FiltersPageState extends State<FiltersPage> {

Widget _buildOptionRow(String text, StatelessWidget icon, bool selection,
BoolCallback onChange) {
return Container(
decoration: const BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
),
child: ListTile(
leading: icon,
title: Text(text),
trailing: Checkbox(
activeColor: Colors.yellow[700],
checkColor: Colors.black,
value: selection,
onChanged: onChange),
),
return ListTile(
leading: icon,
title: Text(text),
trailing: Checkbox(
activeColor: Colors.yellow[700],
checkColor: Colors.black,
value: selection,
onChanged: onChange),
);
}

Widget _buildOptionRow2(String text, StatelessWidget icon) {
return Container(
decoration: const BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
),
child: ListTile(
leading: icon,
title: Text(text),
trailing: IconButton(
iconSize: 30,
icon: const Icon(Icons.chevron_right),
onPressed: () {
debugPrint("Print");
},
color: Colors.grey,
),
return ListTile(
leading: icon,
title: Text(text),
trailing: IconButton(
iconSize: 30,
icon: const Icon(Icons.chevron_right),
onPressed: () {
debugPrint("Print");
},
color: Colors.grey,
),
);
}
Expand Down

0 comments on commit 8e3933e

Please sign in to comment.