Skip to content

Commit 4b5fa93

Browse files
committed
Update the search torrent text field.
1 parent e0a458c commit 4b5fa93

File tree

1 file changed

+31
-4
lines changed

1 file changed

+31
-4
lines changed

lib/Pages/torrent_screen/widgets/search_torrent_textfield_widget.dart

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import 'package:flutter/material.dart';
22
import 'package:flutter_bloc/flutter_bloc.dart';
33
import 'package:flood_mobile/Blocs/filter_torrent_bloc/filter_torrent_bloc.dart';
44
import 'package:flood_mobile/Blocs/theme_bloc/theme_bloc.dart';
5-
import 'package:flood_mobile/Pages/torrent_screen/widgets/filter_by_bottom_sheet.dart';
6-
import 'package:flood_mobile/l10n/l10n.dart';
5+
import 'package:flood_mobile/Pages/torrent_screen/widgets/sort_by_bottom_sheet.dart';
76

87
class SearchTorrentTextField extends StatefulWidget {
98
final int themeIndex;
@@ -38,6 +37,33 @@ class _SearchTorrentTextFieldState extends State<SearchTorrentTextField> {
3837
isDense: true,
3938
contentPadding: EdgeInsets.symmetric(horizontal: 20, vertical: 20),
4039
hintText: context.l10n.search_torrent_text,
40+
prefixIcon: IconButton(
41+
icon: Icon(
42+
FontAwesomeIcons.sortAlphaUp,
43+
color: ThemeBloc.theme(widget.themeIndex).primaryColorDark,
44+
size: 22,
45+
),
46+
onPressed: () {
47+
showModalBottomSheet(
48+
shape: RoundedRectangleBorder(
49+
borderRadius: BorderRadius.only(
50+
topRight: Radius.circular(15),
51+
topLeft: Radius.circular(15),
52+
),
53+
),
54+
isScrollControlled: true,
55+
context: context,
56+
backgroundColor:
57+
ThemeBloc.theme(widget.themeIndex).colorScheme.background,
58+
builder: (context) {
59+
return SortByBottomSheet(
60+
key: Key("Sort By Status Bottom Sheet"),
61+
themeIndex: widget.themeIndex,
62+
);
63+
},
64+
);
65+
},
66+
),
4167
suffixIcon: Padding(
4268
key: Key("Filter Torrent ActionChip"),
4369
padding: const EdgeInsets.only(right: 5),
@@ -81,8 +107,9 @@ class _SearchTorrentTextFieldState extends State<SearchTorrentTextField> {
81107
.background,
82108
builder: (context) {
83109
return FilterByStatus(
84-
key: Key("Filter By Status Bottom Sheet"),
85-
themeIndex: widget.themeIndex);
110+
key: Key("Filter By Status Bottom Sheet"),
111+
themeIndex: widget.themeIndex,
112+
);
86113
},
87114
);
88115
},

0 commit comments

Comments
 (0)