Skip to content

Commit 61f7d74

Browse files
authored
Merge pull request #223 from amitamrutiya2210/issue-55-remove-accentColor
Resolve Warnings and Improve Code Quality in Flood_Mobile Project
2 parents 1592497 + ddcaab9 commit 61f7d74

40 files changed

+380
-387
lines changed

lib/Api/auth_api.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ class AuthApi {
3838
if (response.statusCode == 200) {
3939
//Successfully Logged in
4040
print(response.data);
41-
// TODO(owner): check logic
4241
String? token =
4342
response.headers['Set-Cookie']?[0].toString().split(';')[0];
4443
print('Token $token');

lib/Components/RSSFeedHomePage.dart

Lines changed: 127 additions & 122 deletions
Large diffs are not rendered by default.

lib/Components/add_automatic_torrent.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import 'package:provider/provider.dart';
77
import '../Provider/api_provider.dart';
88
import '../Provider/user_detail_provider.dart';
99

10+
// ignore: must_be_immutable
1011
class AddAutoTorrent extends StatefulWidget {
1112
String base64;
1213
List<int> imageBytes;
@@ -33,7 +34,6 @@ class _AddAutoTorrentState extends State<AddAutoTorrent> {
3334

3435
@override
3536
void initState() {
36-
// TODO: implement initState
3737
super.initState();
3838
_getDefaultDirectory();
3939
_addAndGetTorrent();
@@ -55,7 +55,7 @@ class _AddAutoTorrentState extends State<AddAutoTorrent> {
5555
fontSize: 15,
5656
fontWeight: FontWeight.bold,
5757
fontFamily: 'Montserrat',
58-
color: ThemeProvider.theme.textTheme.bodyText1?.color),
58+
color: ThemeProvider.theme.textTheme.bodyLarge?.color),
5959
),
6060
),
6161
Padding(
@@ -90,7 +90,7 @@ class _AddAutoTorrentState extends State<AddAutoTorrent> {
9090
fontSize: 16,
9191
fontFamily: 'Montserrat',
9292
color: ThemeProvider
93-
.theme.textTheme.bodyText1?.color),
93+
.theme.textTheme.bodyLarge?.color),
9494
),
9595
),
9696
],
@@ -112,19 +112,19 @@ class _AddAutoTorrentState extends State<AddAutoTorrent> {
112112
TextField(
113113
controller: directoryController,
114114
style: TextStyle(
115-
color: ThemeProvider.theme.textTheme.bodyText1?.color,
115+
color: ThemeProvider.theme.textTheme.bodyLarge?.color,
116116
),
117117
decoration: InputDecoration(
118118
prefixIcon: Icon(
119119
Icons.folder,
120-
color: ThemeProvider.theme.textTheme.bodyText1?.color,
120+
color: ThemeProvider.theme.textTheme.bodyLarge?.color,
121121
),
122122
labelText: 'Destination',
123123
hintText: 'Destination',
124124
labelStyle: TextStyle(
125125
fontFamily: 'Montserrat',
126126
color:
127-
ThemeProvider.theme.textTheme.bodyText1?.color),
127+
ThemeProvider.theme.textTheme.bodyLarge?.color),
128128
border: OutlineInputBorder(
129129
borderRadius: BorderRadius.circular(8),
130130
),
@@ -206,10 +206,10 @@ class _AddAutoTorrentState extends State<AddAutoTorrent> {
206206
},
207207
style: ElevatedButton.styleFrom(
208208
elevation: 0,
209+
backgroundColor: ThemeProvider.theme.primaryColorDark,
209210
shape: RoundedRectangleBorder(
210211
borderRadius: BorderRadius.circular(14.0),
211212
),
212-
primary: ThemeProvider.theme.primaryColorDark,
213213
),
214214
child: Center(
215215
child: Text(

lib/Components/add_torrent_sheet.dart

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ class _AddTorrentSheetState extends State<AddTorrentSheet> {
3636

3737
@override
3838
void initState() {
39-
// TODO: implement initState
4039
directoryController =
4140
new TextEditingController(text: widget.clientSettings.directoryDefault);
4241
super.initState();
@@ -61,18 +60,18 @@ class _AddTorrentSheetState extends State<AddTorrentSheet> {
6160
key: Key('Destination TextField'),
6261
controller: directoryController,
6362
style: TextStyle(
64-
color: ThemeProvider.theme.textTheme.bodyText1?.color,
63+
color: ThemeProvider.theme.textTheme.bodyLarge?.color,
6564
),
6665
decoration: InputDecoration(
6766
prefixIcon: Icon(
6867
Icons.folder,
69-
color: ThemeProvider.theme.textTheme.bodyText1?.color,
68+
color: ThemeProvider.theme.textTheme.bodyLarge?.color,
7069
),
7170
labelText: 'Destination',
7271
hintText: 'Destination',
7372
labelStyle: TextStyle(
7473
fontFamily: 'Montserrat',
75-
color: ThemeProvider.theme.textTheme.bodyText1?.color),
74+
color: ThemeProvider.theme.textTheme.bodyLarge?.color),
7675
border: OutlineInputBorder(
7776
borderRadius: BorderRadius.circular(8),
7877
),
@@ -86,12 +85,12 @@ class _AddTorrentSheetState extends State<AddTorrentSheet> {
8685
key: Key('Torrent magnet link textfield'),
8786
controller: magnetUrlController,
8887
style: TextStyle(
89-
color: ThemeProvider.theme.textTheme.bodyText1?.color,
88+
color: ThemeProvider.theme.textTheme.bodyLarge?.color,
9089
),
9190
decoration: InputDecoration(
9291
prefixIcon: Icon(
9392
Icons.link,
94-
color: ThemeProvider.theme.textTheme.bodyText1?.color,
93+
color: ThemeProvider.theme.textTheme.bodyLarge?.color,
9594
),
9695
suffix: GestureDetector(
9796
child: Icon(Icons.paste),
@@ -108,7 +107,7 @@ class _AddTorrentSheetState extends State<AddTorrentSheet> {
108107
hintText: 'Torrent URL or Magnet Link',
109108
labelStyle: TextStyle(
110109
fontFamily: 'Montserrat',
111-
color: ThemeProvider.theme.textTheme.bodyText1?.color,
110+
color: ThemeProvider.theme.textTheme.bodyLarge?.color,
112111
),
113112
border: OutlineInputBorder(
114113
borderRadius: BorderRadius.circular(8),
@@ -202,7 +201,7 @@ class _AddTorrentSheetState extends State<AddTorrentSheet> {
202201
Text(
203202
'or',
204203
style: TextStyle(
205-
color: ThemeProvider.theme.textTheme.bodyText1?.color,
204+
color: ThemeProvider.theme.textTheme.bodyLarge?.color,
206205
fontSize: 12,
207206
fontWeight: FontWeight.w900),
208207
),
@@ -288,7 +287,7 @@ class _AddTorrentSheetState extends State<AddTorrentSheet> {
288287
shape: RoundedRectangleBorder(
289288
borderRadius: BorderRadius.circular(14.0),
290289
),
291-
primary: ThemeProvider.theme.primaryColorDark,
290+
backgroundColor: ThemeProvider.theme.primaryColorDark,
292291
),
293292
child: Center(
294293
child: Text(

lib/Components/base_app_bar.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import 'package:flood_mobile/Components/RSSFeedButtonWidget.dart';
21
import 'package:flood_mobile/Constants/theme_provider.dart';
32
import 'package:flood_mobile/Provider/home_provider.dart';
43
import 'package:flutter/material.dart';

lib/Components/bottom_floating_menu_button.dart

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class _BottomFloatingMenuButtonState extends State<BottomFloatingMenuButton>
4444
return SpeedDial(
4545
buttonSize: Size(60, 60),
4646
backgroundColor: ThemeProvider.theme.primaryColorDark,
47+
foregroundColor: Colors.white,
4748
icon: Icons.add,
4849
activeIcon: Icons.close,
4950
spacing: 3,
@@ -56,7 +57,7 @@ class _BottomFloatingMenuButtonState extends State<BottomFloatingMenuButton>
5657
children: [
5758
SpeedDialChild(
5859
child: Icon(FontAwesomeIcons.solidFile),
59-
backgroundColor: ThemeProvider.theme.textTheme.bodyText1?.color,
60+
backgroundColor: ThemeProvider.theme.textTheme.bodyLarge?.color,
6061
foregroundColor: ThemeProvider.theme.primaryColorDark,
6162
label: 'Torrent File',
6263
labelBackgroundColor: Colors.transparent,
@@ -66,7 +67,7 @@ class _BottomFloatingMenuButtonState extends State<BottomFloatingMenuButton>
6667
)
6768
],
6869
labelStyle: TextStyle(
69-
color: ThemeProvider.theme.textTheme.bodyText1?.color,
70+
color: ThemeProvider.theme.textTheme.bodyLarge?.color,
7071
fontSize: 14,
7172
fontWeight: FontWeight.w800),
7273
onTap: () async {
@@ -118,7 +119,7 @@ class _BottomFloatingMenuButtonState extends State<BottomFloatingMenuButton>
118119
fontWeight: FontWeight.bold,
119120
fontFamily: 'Montserrat',
120121
color: ThemeProvider
121-
.theme.textTheme.bodyText1?.color),
122+
.theme.textTheme.bodyLarge?.color),
122123
),
123124
),
124125
Padding(
@@ -170,7 +171,7 @@ class _BottomFloatingMenuButtonState extends State<BottomFloatingMenuButton>
170171
color: ThemeProvider
171172
.theme
172173
.textTheme
173-
.bodyText1
174+
.bodyLarge
174175
?.color),
175176
),
176177
),
@@ -196,20 +197,20 @@ class _BottomFloatingMenuButtonState extends State<BottomFloatingMenuButton>
196197
controller: directoryController,
197198
style: TextStyle(
198199
color: ThemeProvider
199-
.theme.textTheme.bodyText1?.color,
200+
.theme.textTheme.bodyLarge?.color,
200201
),
201202
decoration: InputDecoration(
202203
prefixIcon: Icon(
203204
Icons.folder,
204205
color: ThemeProvider.theme.textTheme
205-
.bodyText1?.color,
206+
.bodyLarge?.color,
206207
),
207208
labelText: 'Destination',
208209
hintText: 'Destination',
209210
labelStyle: TextStyle(
210211
fontFamily: 'Montserrat',
211212
color: ThemeProvider.theme
212-
.textTheme.bodyText1?.color),
213+
.textTheme.bodyLarge?.color),
213214
border: OutlineInputBorder(
214215
borderRadius:
215216
BorderRadius.circular(8),
@@ -329,12 +330,12 @@ class _BottomFloatingMenuButtonState extends State<BottomFloatingMenuButton>
329330
},
330331
style: ElevatedButton.styleFrom(
331332
elevation: 0,
333+
backgroundColor: ThemeProvider
334+
.theme.primaryColorDark,
332335
shape: RoundedRectangleBorder(
333336
borderRadius:
334337
BorderRadius.circular(14.0),
335338
),
336-
primary: ThemeProvider
337-
.theme.primaryColorDark,
338339
),
339340
child: Center(
340341
child: Text(
@@ -365,7 +366,7 @@ class _BottomFloatingMenuButtonState extends State<BottomFloatingMenuButton>
365366
),
366367
SpeedDialChild(
367368
child: const Icon(FontAwesomeIcons.magnet),
368-
backgroundColor: ThemeProvider.theme.textTheme.bodyText1?.color,
369+
backgroundColor: ThemeProvider.theme.textTheme.bodyLarge?.color,
369370
foregroundColor: ThemeProvider.theme.primaryColorDark,
370371
label: 'Magnet Link',
371372
labelBackgroundColor: Colors.transparent,
@@ -375,7 +376,7 @@ class _BottomFloatingMenuButtonState extends State<BottomFloatingMenuButton>
375376
)
376377
],
377378
labelStyle: TextStyle(
378-
color: ThemeProvider.theme.textTheme.bodyText1?.color,
379+
color: ThemeProvider.theme.textTheme.bodyLarge?.color,
379380
fontSize: 14,
380381
fontWeight: FontWeight.w800),
381382
onTap: () {
@@ -413,7 +414,7 @@ class _BottomFloatingMenuButtonState extends State<BottomFloatingMenuButton>
413414
fontWeight: FontWeight.bold,
414415
fontFamily: 'Montserrat',
415416
color: ThemeProvider
416-
.theme.textTheme.bodyText1?.color),
417+
.theme.textTheme.bodyLarge?.color),
417418
),
418419
),
419420
Padding(
@@ -427,13 +428,13 @@ class _BottomFloatingMenuButtonState extends State<BottomFloatingMenuButton>
427428
controller: magnetUrlController,
428429
style: TextStyle(
429430
color: ThemeProvider
430-
.theme.textTheme.bodyText1?.color,
431+
.theme.textTheme.bodyLarge?.color,
431432
),
432433
decoration: InputDecoration(
433434
prefixIcon: Icon(
434435
Icons.link,
435436
color: ThemeProvider
436-
.theme.textTheme.bodyText1?.color,
437+
.theme.textTheme.bodyLarge?.color,
437438
),
438439
suffix: GestureDetector(
439440
child: Icon(Icons.paste),
@@ -453,7 +454,7 @@ class _BottomFloatingMenuButtonState extends State<BottomFloatingMenuButton>
453454
labelStyle: TextStyle(
454455
fontFamily: 'Montserrat',
455456
color: ThemeProvider
456-
.theme.textTheme.bodyText1?.color,
457+
.theme.textTheme.bodyLarge?.color,
457458
),
458459
border: OutlineInputBorder(
459460
borderRadius:
@@ -487,20 +488,20 @@ class _BottomFloatingMenuButtonState extends State<BottomFloatingMenuButton>
487488
controller: directoryController,
488489
style: TextStyle(
489490
color: ThemeProvider
490-
.theme.textTheme.bodyText1?.color,
491+
.theme.textTheme.bodyLarge?.color,
491492
),
492493
decoration: InputDecoration(
493494
prefixIcon: Icon(
494495
Icons.folder,
495496
color: ThemeProvider
496-
.theme.textTheme.bodyText1?.color,
497+
.theme.textTheme.bodyLarge?.color,
497498
),
498499
labelText: 'Destination',
499500
hintText: 'Destination',
500501
labelStyle: TextStyle(
501502
fontFamily: 'Montserrat',
502503
color: ThemeProvider.theme.textTheme
503-
.bodyText1?.color),
504+
.bodyLarge?.color),
504505
border: OutlineInputBorder(
505506
borderRadius:
506507
BorderRadius.circular(8),
@@ -618,12 +619,12 @@ class _BottomFloatingMenuButtonState extends State<BottomFloatingMenuButton>
618619
},
619620
style: ElevatedButton.styleFrom(
620621
elevation: 0,
622+
backgroundColor: ThemeProvider
623+
.theme.primaryColorDark,
621624
shape: RoundedRectangleBorder(
622625
borderRadius:
623626
BorderRadius.circular(14.0),
624627
),
625-
primary: ThemeProvider
626-
.theme.primaryColorDark,
627628
),
628629
child: Center(
629630
child: Text(

lib/Components/change_theme_button_widget.dart

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,5 @@ class ChangeThemeButtonWidget extends StatelessWidget {
1515
? Icons.wb_sunny_rounded
1616
: Icons.mode_night_rounded),
1717
);
18-
// Switch.adaptive(
19-
// splashRadius: 2.0,
20-
// activeThumbImage: AssetImage(
21-
// 'assets/images/moon.png',
22-
// ),
23-
// inactiveThumbImage: AssetImage('assets/images/sun.png'),
24-
// value: themeProvider.isDarkMode,
25-
// onChanged: (value) {
26-
// final provider = Provider.of<ThemeProvider>(context, listen: false);
27-
// provider.toggleTheme(value);
28-
// },
29-
// );
3018
}
3119
}

0 commit comments

Comments
 (0)