Skip to content

Commit b8ae485

Browse files
authored
Merge branch 'master' into issue-157-keybord-hide
2 parents 427aa78 + a2535b9 commit b8ae485

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1835
-1029
lines changed

lib/Components/RSSFeedButtonWidget.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import 'package:bottom_sheet/bottom_sheet.dart';
44
import '../Constants/theme_provider.dart';
55

66
class RSSFeedButtonWidget extends StatefulWidget {
7+
final int index;
8+
9+
const RSSFeedButtonWidget({Key? key, required this.index}) : super(key: key);
710
@override
811
State<RSSFeedButtonWidget> createState() => _RSSFeedButtonWidgetState();
912
}
@@ -39,12 +42,12 @@ class _RSSFeedButtonWidgetState extends State<RSSFeedButtonWidget> {
3942
topRight: Radius.circular(15),
4043
topLeft: Radius.circular(15),
4144
),
42-
color: ThemeProvider.theme.primaryColorLight,
45+
color: ThemeProvider.theme(widget.index).primaryColorLight,
4346
),
4447
child: ListView(
4548
scrollDirection: Axis.vertical,
4649
controller: scrollController,
47-
children: [RSSFeedHomePage()],
50+
children: [RSSFeedHomePage(index: widget.index)],
4851
),
4952
);
5053
}

lib/Components/RSSFeedHomePage.dart

Lines changed: 275 additions & 161 deletions
Large diffs are not rendered by default.

lib/Components/add_automatic_torrent.dart

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ class AddAutoTorrent extends StatefulWidget {
1212
String base64;
1313
List<int> imageBytes;
1414
String? uriString;
15-
15+
final int index;
1616
AddAutoTorrent({
1717
required this.base64,
1818
required this.imageBytes,
1919
required this.uriString,
20+
required this.index,
2021
});
2122

2223
@override
@@ -55,7 +56,10 @@ class _AddAutoTorrentState extends State<AddAutoTorrent> {
5556
fontSize: 15,
5657
fontWeight: FontWeight.bold,
5758
fontFamily: 'Montserrat',
58-
color: ThemeProvider.theme.textTheme.bodyLarge?.color),
59+
color: ThemeProvider.theme(widget.index)
60+
.textTheme
61+
.bodyLarge
62+
?.color),
5963
),
6064
),
6165
Padding(
@@ -69,7 +73,7 @@ class _AddAutoTorrentState extends State<AddAutoTorrent> {
6973
? Colors.black38
7074
: Colors.white38),
7175
borderRadius: BorderRadius.circular(8),
72-
color: ThemeProvider.theme.primaryColorLight,
76+
color: ThemeProvider.theme(widget.index).primaryColorLight,
7377
),
7478
child: Row(
7579
mainAxisAlignment: MainAxisAlignment.start,
@@ -89,8 +93,10 @@ class _AddAutoTorrentState extends State<AddAutoTorrent> {
8993
style: TextStyle(
9094
fontSize: 16,
9195
fontFamily: 'Montserrat',
92-
color: ThemeProvider
93-
.theme.textTheme.bodyLarge?.color),
96+
color: ThemeProvider.theme(widget.index)
97+
.textTheme
98+
.bodyLarge
99+
?.color),
94100
),
95101
),
96102
],
@@ -101,7 +107,7 @@ class _AddAutoTorrentState extends State<AddAutoTorrent> {
101107
),
102108
),
103109
Container(
104-
color: ThemeProvider.theme.primaryColorLight,
110+
color: ThemeProvider.theme(widget.index).primaryColorLight,
105111
padding: EdgeInsets.symmetric(vertical: 25, horizontal: 20),
106112
child: Form(
107113
key: _formKey,
@@ -112,19 +118,27 @@ class _AddAutoTorrentState extends State<AddAutoTorrent> {
112118
TextField(
113119
controller: directoryController,
114120
style: TextStyle(
115-
color: ThemeProvider.theme.textTheme.bodyLarge?.color,
121+
color: ThemeProvider.theme(widget.index)
122+
.textTheme
123+
.bodyLarge
124+
?.color,
116125
),
117126
decoration: InputDecoration(
118127
prefixIcon: Icon(
119128
Icons.folder,
120-
color: ThemeProvider.theme.textTheme.bodyLarge?.color,
129+
color: ThemeProvider.theme(widget.index)
130+
.textTheme
131+
.bodyLarge
132+
?.color,
121133
),
122134
labelText: 'Destination',
123135
hintText: 'Destination',
124136
labelStyle: TextStyle(
125137
fontFamily: 'Montserrat',
126-
color:
127-
ThemeProvider.theme.textTheme.bodyLarge?.color),
138+
color: ThemeProvider.theme(widget.index)
139+
.textTheme
140+
.bodyLarge
141+
?.color),
128142
border: OutlineInputBorder(
129143
borderRadius: BorderRadius.circular(8),
130144
),
@@ -134,8 +148,10 @@ class _AddAutoTorrentState extends State<AddAutoTorrent> {
134148
height: 20,
135149
),
136150
CheckboxListTile(
137-
activeColor: ThemeProvider.theme.primaryColorDark,
138-
tileColor: ThemeProvider.theme.primaryColorLight,
151+
activeColor:
152+
ThemeProvider.theme(widget.index).primaryColorDark,
153+
tileColor:
154+
ThemeProvider.theme(widget.index).primaryColorLight,
139155
shape: RoundedRectangleBorder(
140156
borderRadius: BorderRadius.circular(8),
141157
),
@@ -151,8 +167,10 @@ class _AddAutoTorrentState extends State<AddAutoTorrent> {
151167
},
152168
),
153169
CheckboxListTile(
154-
activeColor: ThemeProvider.theme.primaryColorDark,
155-
tileColor: ThemeProvider.theme.primaryColorLight,
170+
activeColor:
171+
ThemeProvider.theme(widget.index).primaryColorDark,
172+
tileColor:
173+
ThemeProvider.theme(widget.index).primaryColorLight,
156174
shape: RoundedRectangleBorder(
157175
borderRadius: BorderRadius.circular(8),
158176
),
@@ -168,8 +186,10 @@ class _AddAutoTorrentState extends State<AddAutoTorrent> {
168186
},
169187
),
170188
CheckboxListTile(
171-
activeColor: ThemeProvider.theme.primaryColorDark,
172-
tileColor: ThemeProvider.theme.primaryColorLight,
189+
activeColor:
190+
ThemeProvider.theme(widget.index).primaryColorDark,
191+
tileColor:
192+
ThemeProvider.theme(widget.index).primaryColorLight,
173193
shape: RoundedRectangleBorder(
174194
borderRadius: BorderRadius.circular(8),
175195
),
@@ -206,7 +226,8 @@ class _AddAutoTorrentState extends State<AddAutoTorrent> {
206226
},
207227
style: ElevatedButton.styleFrom(
208228
elevation: 0,
209-
backgroundColor: ThemeProvider.theme.primaryColorDark,
229+
backgroundColor: ThemeProvider.theme(widget.index)
230+
.primaryColorDark,
210231
shape: RoundedRectangleBorder(
211232
borderRadius: BorderRadius.circular(14.0),
212233
),

lib/Components/add_tag_dialogue.dart

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ import 'package:provider/provider.dart';
1111

1212
class AddTagDialogue extends StatefulWidget {
1313
final List<TorrentModel> torrents;
14-
15-
const AddTagDialogue({Key? key, required this.torrents}) : super(key: key);
14+
final int index;
15+
const AddTagDialogue({Key? key, required this.torrents, required this.index})
16+
: super(key: key);
1617
@override
1718
State<AddTagDialogue> createState() => _AddTagDialogueState();
1819
}
@@ -85,7 +86,7 @@ class _AddTagDialogueState extends State<AddTagDialogue>
8586
key: Key('Add Tag AlertDialog'),
8687
elevation: 0,
8788
backgroundColor: themeProvider.isDarkMode
88-
? ThemeProvider.theme.primaryColorLight
89+
? ThemeProvider.theme(widget.index).primaryColorLight
8990
: Colors.white,
9091
shape: RoundedRectangleBorder(
9192
borderRadius: BorderRadius.all(
@@ -106,7 +107,10 @@ class _AddTagDialogueState extends State<AddTagDialogue>
106107
'Set Tags',
107108
textAlign: TextAlign.center,
108109
style: TextStyle(
109-
color: ThemeProvider.theme.textTheme.bodyLarge?.color,
110+
color: ThemeProvider.theme(widget.index)
111+
.textTheme
112+
.bodyLarge
113+
?.color,
110114
fontWeight: FontWeight.bold,
111115
fontSize: 20,
112116
),
@@ -127,7 +131,8 @@ class _AddTagDialogueState extends State<AddTagDialogue>
127131
controller: _textController,
128132
decoration: InputDecoration(
129133
fillColor: themeProvider.isDarkMode
130-
? ThemeProvider.theme.primaryColor
134+
? ThemeProvider.theme(widget.index)
135+
.primaryColor
131136
: Colors.black45,
132137
border: OutlineInputBorder(
133138
borderRadius: BorderRadius.circular(10.0),
@@ -163,8 +168,10 @@ class _AddTagDialogueState extends State<AddTagDialogue>
163168
hintText: "Enter Tags",
164169
),
165170
style: TextStyle(
166-
color: ThemeProvider
167-
.theme.textTheme.bodyLarge?.color,
171+
color: ThemeProvider.theme(widget.index)
172+
.textTheme
173+
.bodyLarge
174+
?.color,
168175
fontSize: 18,
169176
fontWeight: FontWeight.w400),
170177
autocorrect: false,
@@ -248,7 +255,7 @@ class _AddTagDialogueState extends State<AddTagDialogue>
248255
),
249256
),
250257
backgroundColor: MaterialStateProperty.all(
251-
ThemeProvider.theme.dialogBackgroundColor),
258+
ThemeProvider.theme(widget.index).dialogBackgroundColor),
252259
),
253260
onPressed: () {
254261
reset();
@@ -272,8 +279,8 @@ class _AddTagDialogueState extends State<AddTagDialogue>
272279
minimumSize: MaterialStateProperty.all<Size>(
273280
Size(hp * .160, hp * .059),
274281
),
275-
backgroundColor:
276-
MaterialStateProperty.all(ThemeProvider.theme.primaryColorDark),
282+
backgroundColor: MaterialStateProperty.all(
283+
ThemeProvider.theme(widget.index).primaryColorDark),
277284
),
278285
onPressed: (() {
279286
setState(() {

lib/Components/add_torrent_sheet.dart

Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
1212

1313
class AddTorrentSheet extends StatefulWidget {
1414
final ClientSettingsModel clientSettings;
15-
15+
final int index;
1616
AddTorrentSheet({
1717
required this.clientSettings,
18+
required this.index,
1819
});
1920

2021
@override
@@ -47,7 +48,7 @@ class _AddTorrentSheetState extends State<AddTorrentSheet> {
4748
decoration: BoxDecoration(
4849
borderRadius: BorderRadius.only(
4950
topRight: Radius.circular(15), topLeft: Radius.circular(15)),
50-
color: ThemeProvider.theme.primaryColorLight,
51+
color: ThemeProvider.theme(widget.index).primaryColorLight,
5152
),
5253
padding: EdgeInsets.symmetric(vertical: 25, horizontal: 20),
5354
child: Form(
@@ -60,18 +61,27 @@ class _AddTorrentSheetState extends State<AddTorrentSheet> {
6061
key: Key('Destination TextField'),
6162
controller: directoryController,
6263
style: TextStyle(
63-
color: ThemeProvider.theme.textTheme.bodyLarge?.color,
64+
color: ThemeProvider.theme(widget.index)
65+
.textTheme
66+
.bodyLarge
67+
?.color,
6468
),
6569
decoration: InputDecoration(
6670
prefixIcon: Icon(
6771
Icons.folder,
68-
color: ThemeProvider.theme.textTheme.bodyLarge?.color,
72+
color: ThemeProvider.theme(widget.index)
73+
.textTheme
74+
.bodyLarge
75+
?.color,
6976
),
7077
labelText: 'Destination',
7178
hintText: 'Destination',
7279
labelStyle: TextStyle(
7380
fontFamily: 'Montserrat',
74-
color: ThemeProvider.theme.textTheme.bodyLarge?.color),
81+
color: ThemeProvider.theme(widget.index)
82+
.textTheme
83+
.bodyLarge
84+
?.color),
7585
border: OutlineInputBorder(
7686
borderRadius: BorderRadius.circular(8),
7787
),
@@ -85,12 +95,18 @@ class _AddTorrentSheetState extends State<AddTorrentSheet> {
8595
key: Key('Torrent magnet link textfield'),
8696
controller: magnetUrlController,
8797
style: TextStyle(
88-
color: ThemeProvider.theme.textTheme.bodyLarge?.color,
98+
color: ThemeProvider.theme(widget.index)
99+
.textTheme
100+
.bodyLarge
101+
?.color,
89102
),
90103
decoration: InputDecoration(
91104
prefixIcon: Icon(
92105
Icons.link,
93-
color: ThemeProvider.theme.textTheme.bodyLarge?.color,
106+
color: ThemeProvider.theme(widget.index)
107+
.textTheme
108+
.bodyLarge
109+
?.color,
94110
),
95111
suffix: GestureDetector(
96112
child: Icon(Icons.paste),
@@ -107,7 +123,10 @@ class _AddTorrentSheetState extends State<AddTorrentSheet> {
107123
hintText: 'Torrent URL or Magnet Link',
108124
labelStyle: TextStyle(
109125
fontFamily: 'Montserrat',
110-
color: ThemeProvider.theme.textTheme.bodyLarge?.color,
126+
color: ThemeProvider.theme(widget.index)
127+
.textTheme
128+
.bodyLarge
129+
?.color,
111130
),
112131
border: OutlineInputBorder(
113132
borderRadius: BorderRadius.circular(8),
@@ -128,8 +147,8 @@ class _AddTorrentSheetState extends State<AddTorrentSheet> {
128147
)
129148
: Container(),
130149
CheckboxListTile(
131-
activeColor: ThemeProvider.theme.primaryColorDark,
132-
tileColor: ThemeProvider.theme.primaryColorLight,
150+
activeColor: ThemeProvider.theme(widget.index).primaryColorDark,
151+
tileColor: ThemeProvider.theme(widget.index).primaryColorLight,
133152
shape: RoundedRectangleBorder(
134153
borderRadius: BorderRadius.circular(8),
135154
),
@@ -145,8 +164,8 @@ class _AddTorrentSheetState extends State<AddTorrentSheet> {
145164
},
146165
),
147166
CheckboxListTile(
148-
activeColor: ThemeProvider.theme.primaryColorDark,
149-
tileColor: ThemeProvider.theme.primaryColorLight,
167+
activeColor: ThemeProvider.theme(widget.index).primaryColorDark,
168+
tileColor: ThemeProvider.theme(widget.index).primaryColorLight,
150169
shape: RoundedRectangleBorder(
151170
borderRadius: BorderRadius.circular(8),
152171
),
@@ -162,8 +181,8 @@ class _AddTorrentSheetState extends State<AddTorrentSheet> {
162181
},
163182
),
164183
CheckboxListTile(
165-
activeColor: ThemeProvider.theme.primaryColorDark,
166-
tileColor: ThemeProvider.theme.primaryColorLight,
184+
activeColor: ThemeProvider.theme(widget.index).primaryColorDark,
185+
tileColor: ThemeProvider.theme(widget.index).primaryColorLight,
167186
shape: RoundedRectangleBorder(
168187
borderRadius: BorderRadius.circular(8),
169188
),
@@ -201,7 +220,10 @@ class _AddTorrentSheetState extends State<AddTorrentSheet> {
201220
Text(
202221
'or',
203222
style: TextStyle(
204-
color: ThemeProvider.theme.textTheme.bodyLarge?.color,
223+
color: ThemeProvider.theme(widget.index)
224+
.textTheme
225+
.bodyLarge
226+
?.color,
205227
fontSize: 12,
206228
fontWeight: FontWeight.w900),
207229
),
@@ -287,7 +309,8 @@ class _AddTorrentSheetState extends State<AddTorrentSheet> {
287309
shape: RoundedRectangleBorder(
288310
borderRadius: BorderRadius.circular(14.0),
289311
),
290-
backgroundColor: ThemeProvider.theme.primaryColorDark,
312+
backgroundColor:
313+
ThemeProvider.theme(widget.index).primaryColorDark,
291314
),
292315
child: Center(
293316
child: Text(

0 commit comments

Comments
 (0)