Skip to content

Commit ce39e92

Browse files
Akshatji800jesec
authored andcommitted
Modifies applied filter display UI
1 parent 40bcaae commit ce39e92

File tree

2 files changed

+104
-108
lines changed

2 files changed

+104
-108
lines changed

lib/Components/filter_by_status.dart

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ class _FilterByStatusState extends State<FilterByStatus> {
4848
fontSize: 24,
4949
fontWeight: FontWeight.bold)),
5050
ListTile(
51+
leading: Icon(
52+
Icons.star_sharp,
53+
size: 20,
54+
),
55+
minLeadingWidth: 2,
56+
visualDensity: VisualDensity(horizontal: -4, vertical: -2),
5157
title: Text('All',
5258
style: TextStyle(
5359
color: ThemeProvider.theme.textTheme.bodyText1?.color,
@@ -66,6 +72,12 @@ class _FilterByStatusState extends State<FilterByStatus> {
6672
),
6773
),
6874
ListTile(
75+
leading: Icon(
76+
Icons.download,
77+
size: 20,
78+
),
79+
minLeadingWidth: 2,
80+
visualDensity: VisualDensity(horizontal: -4, vertical: -2),
6981
title: Text('Downloading',
7082
style: TextStyle(
7183
color: ThemeProvider.theme.textTheme.bodyText1?.color,
@@ -84,6 +96,12 @@ class _FilterByStatusState extends State<FilterByStatus> {
8496
),
8597
),
8698
ListTile(
99+
leading: Icon(
100+
Icons.upload_sharp,
101+
size: 20,
102+
),
103+
minLeadingWidth: 2,
104+
visualDensity: VisualDensity(horizontal: -4, vertical: -2),
87105
title: Text('Seeding',
88106
style: TextStyle(
89107
color: ThemeProvider.theme.textTheme.bodyText1?.color,
@@ -102,6 +120,12 @@ class _FilterByStatusState extends State<FilterByStatus> {
102120
),
103121
),
104122
ListTile(
123+
leading: Icon(
124+
Icons.done,
125+
size: 20,
126+
),
127+
minLeadingWidth: 2,
128+
visualDensity: VisualDensity(horizontal: -4, vertical: -2),
105129
title: Text('Complete',
106130
style: TextStyle(
107131
color: ThemeProvider.theme.textTheme.bodyText1?.color,
@@ -120,6 +144,12 @@ class _FilterByStatusState extends State<FilterByStatus> {
120144
),
121145
),
122146
ListTile(
147+
leading: Icon(
148+
Icons.stop,
149+
size: 20,
150+
),
151+
minLeadingWidth: 2,
152+
visualDensity: VisualDensity(horizontal: -4, vertical: -2),
123153
title: Text('Stopped',
124154
style: TextStyle(
125155
color: ThemeProvider.theme.textTheme.bodyText1?.color,
@@ -138,6 +168,12 @@ class _FilterByStatusState extends State<FilterByStatus> {
138168
),
139169
),
140170
ListTile(
171+
leading: Icon(
172+
Icons.trending_up_outlined,
173+
size: 20,
174+
),
175+
minLeadingWidth: 2,
176+
visualDensity: VisualDensity(horizontal: -4, vertical: -2),
141177
title: Text('Active',
142178
style: TextStyle(
143179
color: ThemeProvider.theme.textTheme.bodyText1?.color,
@@ -156,6 +192,12 @@ class _FilterByStatusState extends State<FilterByStatus> {
156192
),
157193
),
158194
ListTile(
195+
leading: Icon(
196+
Icons.trending_down_outlined,
197+
size: 20,
198+
),
199+
minLeadingWidth: 2,
200+
visualDensity: VisualDensity(horizontal: -4, vertical: -2),
159201
title: Text('Inactive',
160202
style: TextStyle(
161203
color: ThemeProvider.theme.textTheme.bodyText1?.color,
@@ -182,6 +224,8 @@ class _FilterByStatusState extends State<FilterByStatus> {
182224
fontSize: 24,
183225
fontWeight: FontWeight.bold)),
184226
ListTile(
227+
minLeadingWidth: 2,
228+
visualDensity: VisualDensity(horizontal: -4, vertical: -2),
185229
title: Text('All',
186230
style: TextStyle(
187231
color: ThemeProvider.theme.textTheme.bodyText1?.color,
@@ -205,10 +249,12 @@ class _FilterByStatusState extends State<FilterByStatus> {
205249
itemCount: trackerURIsList.length,
206250
itemBuilder: (BuildContext context, int index) {
207251
return ListTile(
252+
minLeadingWidth: 2,
253+
visualDensity: VisualDensity(horizontal: -4, vertical: -2),
208254
title: Text(trackerURIsList[index].toString(),
209255
style: TextStyle(
210256
color:
211-
ThemeProvider.theme.textTheme.bodyText1?.color,
257+
ThemeProvider.theme.textTheme.bodyText1?.color,
212258
fontFamily: 'Montserrat',
213259
fontSize: 16,
214260
fontWeight: FontWeight.normal)),
@@ -230,4 +276,4 @@ class _FilterByStatusState extends State<FilterByStatus> {
230276
),
231277
);
232278
}
233-
}
279+
}

lib/Pages/torrent_screen.dart

Lines changed: 56 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -122,80 +122,6 @@ class _TorrentScreenState extends State<TorrentScreen> {
122122
),
123123
),
124124
),
125-
Padding(
126-
padding: EdgeInsets.only(
127-
right: wp * 0.05,
128-
left: wp * 0.05,
129-
top: 0,
130-
bottom: 0),
131-
child: Row(
132-
mainAxisAlignment: MainAxisAlignment.center,
133-
crossAxisAlignment: CrossAxisAlignment.center,
134-
children: [
135-
Text(
136-
'Filter type:',
137-
textAlign: TextAlign.center,
138-
style: TextStyle(
139-
color: ThemeProvider.theme.accentColor,
140-
fontSize: 18,
141-
fontWeight: FontWeight.bold,
142-
),
143-
),
144-
SizedBox(width: 5),
145-
Text(
146-
trackerURISelected == 'all' ||
147-
trackerURISelected == 'null' ||
148-
trackerURISelected == ''
149-
? 'Filter by status'
150-
: 'Filter by trackers',
151-
textAlign: TextAlign.center,
152-
style: TextStyle(
153-
color: ThemeProvider
154-
.theme.primaryColorDark,
155-
fontSize: 18,
156-
fontWeight: FontWeight.bold,
157-
),
158-
),
159-
],
160-
),
161-
),
162-
Padding(
163-
padding: EdgeInsets.only(
164-
right: wp * 0.05,
165-
left: wp * 0.05,
166-
top: hp * 0.005,
167-
bottom: hp * 0.02),
168-
child: Row(
169-
mainAxisAlignment: MainAxisAlignment.center,
170-
crossAxisAlignment: CrossAxisAlignment.center,
171-
children: [
172-
Text(
173-
'Filter selected:',
174-
textAlign: TextAlign.center,
175-
style: TextStyle(
176-
color: ThemeProvider.theme.accentColor,
177-
fontSize: 18,
178-
fontWeight: FontWeight.bold,
179-
),
180-
),
181-
SizedBox(width: 5),
182-
Text(
183-
trackerURISelected == 'all' ||
184-
trackerURISelected == 'null' ||
185-
trackerURISelected == ''
186-
? '${filterStatus.toString().split(".").last}'
187-
: '$trackerURISelected',
188-
textAlign: TextAlign.center,
189-
style: TextStyle(
190-
color: ThemeProvider
191-
.theme.primaryColorDark,
192-
fontSize: 18,
193-
fontWeight: FontWeight.bold,
194-
),
195-
),
196-
],
197-
),
198-
),
199125
Expanded(
200126
child: Container(
201127
height: 100,
@@ -210,42 +136,66 @@ class _TorrentScreenState extends State<TorrentScreen> {
210136
decoration: InputDecoration(
211137
isDense: true,
212138
contentPadding: EdgeInsets.symmetric(
213-
horizontal: 15, vertical: 15),
139+
horizontal: 20, vertical: 20),
214140
hintText: 'Search Torrent',
215141
suffixIcon: Padding(
216-
padding: const EdgeInsets.all(5.0),
217-
child: Container(
218-
decoration: BoxDecoration(
219-
color: Colors.green,
220-
borderRadius:
221-
BorderRadius.circular(5),
142+
padding: const EdgeInsets.only(right: 5),
143+
child: ActionChip(
144+
padding: EdgeInsets.all(0),
145+
avatar: ClipRRect(
146+
borderRadius: BorderRadius.circular(4),
147+
child: Container(
148+
decoration: BoxDecoration(
149+
borderRadius: BorderRadius.circular(0),
150+
color: Colors.green,
151+
),
152+
height: 50,
153+
width: 50,
154+
child: Icon(
155+
Icons.filter_list_alt,
156+
color: Colors.white,
157+
size: 20,
158+
),
159+
)
222160
),
223-
child: IconButton(
224-
icon: Icon(
225-
Icons.filter_list_alt,
226-
color: Colors.white,
227-
),
228-
onPressed: () {
229-
showModalBottomSheet(
230-
shape: RoundedRectangleBorder(
231-
borderRadius:
232-
BorderRadius.only(
233-
topRight:
234-
Radius.circular(15),
235-
topLeft:
236-
Radius.circular(15),
237-
),
161+
label: Text(trackerURISelected == 'all' ||
162+
trackerURISelected == 'null' ||
163+
trackerURISelected == ''
164+
? '${filterStatus.toString().split(".").last}'
165+
: '$trackerURISelected',
166+
style: TextStyle(
167+
color: ThemeProvider
168+
.theme.primaryColorDark,
169+
fontSize: 15,
170+
fontWeight: FontWeight.normal,
171+
),),
172+
onPressed: () {
173+
showModalBottomSheet(
174+
shape: RoundedRectangleBorder(
175+
borderRadius:
176+
BorderRadius.only(
177+
topRight:
178+
Radius.circular(15),
179+
topLeft:
180+
Radius.circular(15),
238181
),
239-
isScrollControlled: true,
240-
context: context,
241-
backgroundColor: ThemeProvider
242-
.theme.backgroundColor,
243-
builder: (context) {
244-
return FilterByStatus();
245-
},
246-
);
247-
},
248-
),
182+
),
183+
isScrollControlled: true,
184+
context: context,
185+
backgroundColor: ThemeProvider
186+
.theme.backgroundColor,
187+
builder: (context) {
188+
return FilterByStatus();
189+
},
190+
);
191+
},
192+
backgroundColor: Colors.transparent,
193+
shape: RoundedRectangleBorder(
194+
borderRadius: BorderRadius.circular(5),
195+
side: BorderSide(
196+
width: 1,
197+
color: Colors.blueGrey,
198+
)),
249199
),
250200
),
251201
border: OutlineInputBorder(

0 commit comments

Comments
 (0)