Skip to content

Commit a880218

Browse files
authored
Merge branch 'master' into Issue-81
2 parents 2ccfb9f + 5e4f594 commit a880218

File tree

12 files changed

+584
-134
lines changed

12 files changed

+584
-134
lines changed

.github/workflows/dart.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
java-version: '12.x'
1818
- uses: subosito/flutter-action@v1
1919
with:
20-
flutter-version: '2.5.0'
20+
flutter-version: '3.0.0'
2121
- run: flutter pub get
2222
# - run: flutter analyze
2323
- run: flutter format -n --set-exit-if-changed .

android/app/build.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@ apply plugin: 'com.android.application'
2525
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2626

2727
android {
28-
compileSdkVersion 30
28+
compileSdkVersion 31
2929

3030
defaultConfig {
31+
multiDexEnabled true
3132
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
3233
applicationId "com.hustlecreatives.flood_mobile"
33-
minSdkVersion 16
34-
targetSdkVersion 30
34+
minSdkVersion 19
35+
targetSdkVersion 31
3536
versionCode flutterVersionCode.toInteger()
3637
versionName flutterVersionName
3738
}

android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
android:resource="@xml/provider_paths"/>
2828
</provider>
2929
<activity
30+
android:exported="true"
3031
android:name=".MainActivity"
3132
android:launchMode="singleTop"
3233
android:theme="@style/LaunchTheme"

android/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
buildscript {
2+
ext.kotlin_version = '1.6.10'
23
repositories {
34
google()
45
jcenter()
56
}
67

78
dependencies {
8-
classpath 'com.android.tools.build:gradle:4.1.0'
9+
classpath 'com.android.tools.build:gradle:7.1.2'
10+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
911
}
1012
}
1113

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip

lib/Components/add_torrent_sheet.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ class _AddTorrentSheetState extends State<AddTorrentSheet> {
4444
@override
4545
Widget build(BuildContext context) {
4646
return Container(
47-
color: ThemeProvider.theme.primaryColorLight,
47+
decoration: BoxDecoration(
48+
borderRadius: BorderRadius.only(
49+
topRight: Radius.circular(15), topLeft: Radius.circular(15)),
50+
color: ThemeProvider.theme.primaryColorLight,
51+
),
4852
padding: EdgeInsets.symmetric(vertical: 25, horizontal: 20),
4953
child: Form(
5054
key: _formKey,
Lines changed: 280 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,280 @@
1+
import 'package:flood_mobile/Constants/theme_provider.dart';
2+
import 'package:flood_mobile/Pages/torrent_screen.dart';
3+
import 'package:flutter/material.dart';
4+
5+
class FilterByStatus extends StatefulWidget {
6+
@override
7+
_FilterByStatusState createState() => _FilterByStatusState();
8+
}
9+
10+
enum FilterValue {
11+
all,
12+
downloading,
13+
seeding,
14+
complete,
15+
stopped,
16+
active,
17+
inactive
18+
}
19+
20+
FilterValue? filterStatus = FilterValue.all;
21+
String trackerURISelected = '';
22+
23+
class _FilterByStatusState extends State<FilterByStatus> {
24+
@override
25+
void initState() {
26+
// TODO: implement initState
27+
super.initState();
28+
}
29+
30+
@override
31+
Widget build(BuildContext context) {
32+
return Container(
33+
decoration: BoxDecoration(
34+
borderRadius: BorderRadius.only(
35+
topRight: Radius.circular(15), topLeft: Radius.circular(15)),
36+
color: ThemeProvider.theme.primaryColorLight,
37+
),
38+
height: 500,
39+
padding: EdgeInsets.symmetric(vertical: 25, horizontal: 20),
40+
child: SingleChildScrollView(
41+
scrollDirection: Axis.vertical,
42+
child: Column(
43+
crossAxisAlignment: CrossAxisAlignment.start,
44+
mainAxisSize: MainAxisSize.min,
45+
children: <Widget>[
46+
Text("Filter by status",
47+
style: TextStyle(
48+
color: ThemeProvider.theme.textTheme.bodyText1?.color,
49+
fontSize: 24,
50+
fontWeight: FontWeight.bold)),
51+
ListTile(
52+
leading: Icon(
53+
Icons.star_sharp,
54+
size: 20,
55+
),
56+
minLeadingWidth: 2,
57+
visualDensity: VisualDensity(horizontal: -4, vertical: -2),
58+
title: Text('All',
59+
style: TextStyle(
60+
color: ThemeProvider.theme.textTheme.bodyText1?.color,
61+
fontFamily: 'Montserrat',
62+
fontSize: 16,
63+
fontWeight: FontWeight.normal)),
64+
trailing: Radio<FilterValue>(
65+
value: FilterValue.all,
66+
groupValue: filterStatus,
67+
onChanged: (FilterValue? value) {
68+
setState(() {
69+
trackerURISelected = 'null';
70+
filterStatus = value;
71+
});
72+
},
73+
),
74+
),
75+
ListTile(
76+
leading: Icon(
77+
Icons.download,
78+
size: 20,
79+
),
80+
minLeadingWidth: 2,
81+
visualDensity: VisualDensity(horizontal: -4, vertical: -2),
82+
title: Text('Downloading',
83+
style: TextStyle(
84+
color: ThemeProvider.theme.textTheme.bodyText1?.color,
85+
fontFamily: 'Montserrat',
86+
fontSize: 16,
87+
fontWeight: FontWeight.normal)),
88+
trailing: Radio<FilterValue>(
89+
value: FilterValue.downloading,
90+
groupValue: filterStatus,
91+
onChanged: (FilterValue? value) {
92+
setState(() {
93+
trackerURISelected = 'null';
94+
filterStatus = value;
95+
});
96+
},
97+
),
98+
),
99+
ListTile(
100+
leading: Icon(
101+
Icons.upload_sharp,
102+
size: 20,
103+
),
104+
minLeadingWidth: 2,
105+
visualDensity: VisualDensity(horizontal: -4, vertical: -2),
106+
title: Text('Seeding',
107+
style: TextStyle(
108+
color: ThemeProvider.theme.textTheme.bodyText1?.color,
109+
fontFamily: 'Montserrat',
110+
fontSize: 16,
111+
fontWeight: FontWeight.normal)),
112+
trailing: Radio<FilterValue>(
113+
value: FilterValue.seeding,
114+
groupValue: filterStatus,
115+
onChanged: (FilterValue? value) {
116+
setState(() {
117+
trackerURISelected = 'null';
118+
filterStatus = value;
119+
});
120+
},
121+
),
122+
),
123+
ListTile(
124+
leading: Icon(
125+
Icons.done,
126+
size: 20,
127+
),
128+
minLeadingWidth: 2,
129+
visualDensity: VisualDensity(horizontal: -4, vertical: -2),
130+
title: Text('Complete',
131+
style: TextStyle(
132+
color: ThemeProvider.theme.textTheme.bodyText1?.color,
133+
fontFamily: 'Montserrat',
134+
fontSize: 16,
135+
fontWeight: FontWeight.normal)),
136+
trailing: Radio<FilterValue>(
137+
value: FilterValue.complete,
138+
groupValue: filterStatus,
139+
onChanged: (FilterValue? value) {
140+
setState(() {
141+
trackerURISelected = 'null';
142+
filterStatus = value;
143+
});
144+
},
145+
),
146+
),
147+
ListTile(
148+
leading: Icon(
149+
Icons.stop,
150+
size: 20,
151+
),
152+
minLeadingWidth: 2,
153+
visualDensity: VisualDensity(horizontal: -4, vertical: -2),
154+
title: Text('Stopped',
155+
style: TextStyle(
156+
color: ThemeProvider.theme.textTheme.bodyText1?.color,
157+
fontFamily: 'Montserrat',
158+
fontSize: 16,
159+
fontWeight: FontWeight.normal)),
160+
trailing: Radio<FilterValue>(
161+
value: FilterValue.stopped,
162+
groupValue: filterStatus,
163+
onChanged: (FilterValue? value) {
164+
setState(() {
165+
trackerURISelected = 'null';
166+
filterStatus = value;
167+
});
168+
},
169+
),
170+
),
171+
ListTile(
172+
leading: Icon(
173+
Icons.trending_up_outlined,
174+
size: 20,
175+
),
176+
minLeadingWidth: 2,
177+
visualDensity: VisualDensity(horizontal: -4, vertical: -2),
178+
title: Text('Active',
179+
style: TextStyle(
180+
color: ThemeProvider.theme.textTheme.bodyText1?.color,
181+
fontFamily: 'Montserrat',
182+
fontSize: 16,
183+
fontWeight: FontWeight.normal)),
184+
trailing: Radio<FilterValue>(
185+
value: FilterValue.active,
186+
groupValue: filterStatus,
187+
onChanged: (FilterValue? value) {
188+
setState(() {
189+
trackerURISelected = 'null';
190+
filterStatus = value;
191+
});
192+
},
193+
),
194+
),
195+
ListTile(
196+
leading: Icon(
197+
Icons.trending_down_outlined,
198+
size: 20,
199+
),
200+
minLeadingWidth: 2,
201+
visualDensity: VisualDensity(horizontal: -4, vertical: -2),
202+
title: Text('Inactive',
203+
style: TextStyle(
204+
color: ThemeProvider.theme.textTheme.bodyText1?.color,
205+
fontFamily: 'Montserrat',
206+
fontSize: 16,
207+
fontWeight: FontWeight.normal)),
208+
trailing: Radio<FilterValue>(
209+
value: FilterValue.inactive,
210+
groupValue: filterStatus,
211+
onChanged: (FilterValue? value) {
212+
setState(() {
213+
trackerURISelected = 'null';
214+
filterStatus = value;
215+
});
216+
},
217+
),
218+
),
219+
SizedBox(
220+
height: 20,
221+
),
222+
Text("Filter by trackers",
223+
style: TextStyle(
224+
color: ThemeProvider.theme.textTheme.bodyText1?.color,
225+
fontSize: 24,
226+
fontWeight: FontWeight.bold)),
227+
ListTile(
228+
minLeadingWidth: 2,
229+
visualDensity: VisualDensity(horizontal: -4, vertical: -2),
230+
title: Text('All',
231+
style: TextStyle(
232+
color: ThemeProvider.theme.textTheme.bodyText1?.color,
233+
fontFamily: 'Montserrat',
234+
fontSize: 16,
235+
fontWeight: FontWeight.normal)),
236+
trailing: Radio<FilterValue>(
237+
value: FilterValue.all,
238+
groupValue: filterStatus,
239+
onChanged: (FilterValue? value) {
240+
setState(() {
241+
trackerURISelected = 'null';
242+
filterStatus = value;
243+
});
244+
},
245+
),
246+
),
247+
ListView.builder(
248+
shrinkWrap: true,
249+
physics: NeverScrollableScrollPhysics(),
250+
itemCount: trackerURIsList.length,
251+
itemBuilder: (BuildContext context, int index) {
252+
return ListTile(
253+
minLeadingWidth: 2,
254+
visualDensity: VisualDensity(horizontal: -4, vertical: -2),
255+
title: Text(trackerURIsList[index].toString(),
256+
style: TextStyle(
257+
color:
258+
ThemeProvider.theme.textTheme.bodyText1?.color,
259+
fontFamily: 'Montserrat',
260+
fontSize: 16,
261+
fontWeight: FontWeight.normal)),
262+
trailing: Radio<String>(
263+
value: trackerURIsList[index].toString(),
264+
groupValue: trackerURISelected,
265+
onChanged: (value) {
266+
print(value);
267+
setState(() {
268+
filterStatus = null;
269+
trackerURISelected = value.toString();
270+
});
271+
},
272+
),
273+
);
274+
}),
275+
],
276+
),
277+
),
278+
);
279+
}
280+
}

lib/Components/settings_text_field.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class _SettingsTextFieldState extends State<SettingsTextField> {
2929
Text(
3030
widget.labelText,
3131
style: TextStyle(
32-
color: ThemeProvider.theme.shadowColor,
32+
color: ThemeProvider.theme.unselectedWidgetColor,
3333
),
3434
),
3535
SizedBox(height: 5),
@@ -39,7 +39,7 @@ class _SettingsTextFieldState extends State<SettingsTextField> {
3939
color: ThemeProvider.theme.textTheme.bodyText1?.color,
4040
),
4141
keyboardType:
42-
(!widget.isText) ? TextInputType.text : TextInputType.number,
42+
(widget.isText) ? TextInputType.text : TextInputType.number,
4343
decoration: InputDecoration(
4444
floatingLabelBehavior: FloatingLabelBehavior.always,
4545
filled: true,

lib/Pages/settings_screen.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
151151
ClientSettingsModel newClientSettingsModel = new ClientSettingsModel(
152152
dht: clientSettingsModel.clientSettings.dht,
153153
dhtPort: clientSettingsModel.clientSettings.dhtPort,
154-
directoryDefault:
155-
clientSettingsModel.clientSettings.directoryDefault,
154+
directoryDefault: defaultDownloadDirectoryController.text,
156155
networkHttpMaxOpen:
157156
clientSettingsModel.clientSettings.networkHttpMaxOpen,
158157
networkLocalAddress:

0 commit comments

Comments
 (0)