Skip to content

Commit 3fdea20

Browse files
committed
implement bloc throughout the app and change theme to themeIndex
1 parent 3c4385f commit 3fdea20

File tree

58 files changed

+11287
-17
lines changed

Some content is hidden

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

58 files changed

+11287
-17
lines changed

lib/Model/client_settings_model.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'package:json_annotation/json_annotation.dart';
2-
32
part 'client_settings_model.g.dart';
43

54
@JsonSerializable()

lib/Model/download_rate_model.dart

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ class RateModel {
33
int downTotal;
44
int upRate;
55
int upTotal;
6-
RateModel(
7-
{required this.downRate,
8-
required this.downTotal,
9-
required this.upRate,
10-
required this.upTotal});
6+
7+
RateModel({
8+
required this.downRate,
9+
required this.downTotal,
10+
required this.upRate,
11+
required this.upTotal,
12+
});
13+
1114
factory RateModel.fromJson(Map<String, dynamic> json) {
1215
return RateModel(
1316
downTotal: json['downTotal'],

lib/Model/graph_model.dart

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
class GraphModel {
2-
double speed = 0.00;
3-
int second = 0;
4-
GraphModel(this.speed, this.second);
1+
import 'package:equatable/equatable.dart';
2+
3+
class GraphModel extends Equatable {
4+
final double speed;
5+
final int second;
6+
GraphModel({required this.speed, required this.second});
7+
8+
@override
9+
List<Object> get props => [speed, second];
510
}

lib/Model/notification_model.dart

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
class NotificationModel {
2-
List<NotificationContentModel> notifications = [];
3-
int read;
4-
int total;
5-
int unread;
1+
import 'package:equatable/equatable.dart';
2+
3+
class NotificationModel extends Equatable {
4+
final List<NotificationContentModel> notifications;
5+
final int read;
6+
final int total;
7+
final int unread;
68

79
NotificationModel({
810
required this.read,
@@ -25,6 +27,8 @@ class NotificationModel {
2527
unread: json['count']['unread'],
2628
);
2729
}
30+
@override
31+
List<Object?> get props => [read, unread, notifications, total];
2832
}
2933

3034
class NotificationContentModel {

lib/Model/rss_feeds_model.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import 'package:flood_mobile/Model/single_feed_and_response_model.dart';
22
import 'package:flood_mobile/Model/single_rule_model.dart';
33
import 'package:json_annotation/json_annotation.dart';
4-
54
part 'rss_feeds_model.g.dart';
65

76
@JsonSerializable()

lib/Model/torrent_model.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'package:json_annotation/json_annotation.dart';
2-
32
part 'torrent_model.g.dart';
43

54
@JsonSerializable()
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:flood_mobile/Blocs/theme_bloc/theme_bloc.dart';
3+
import 'package:flutter_svg/flutter_svg.dart';
4+
5+
class AboutScreen extends StatefulWidget {
6+
final int themeIndex;
7+
8+
const AboutScreen({Key? key, required this.themeIndex}) : super(key: key);
9+
@override
10+
_AboutScreenState createState() => _AboutScreenState();
11+
}
12+
13+
class _AboutScreenState extends State<AboutScreen> {
14+
@override
15+
Widget build(BuildContext context) {
16+
return Scaffold(
17+
backgroundColor: ThemeBloc.theme(widget.themeIndex).primaryColor,
18+
body: SingleChildScrollView(
19+
child: Padding(
20+
padding: EdgeInsets.all(22.0),
21+
child: Column(
22+
crossAxisAlignment: CrossAxisAlignment.center,
23+
children: [
24+
Container(
25+
width: double.infinity,
26+
),
27+
Image(
28+
key: Key('App icon asset image'),
29+
image: AssetImage(
30+
'assets/images/icon.png',
31+
),
32+
width: 150,
33+
height: 150,
34+
),
35+
Wrap(
36+
spacing: 10,
37+
runSpacing: 10,
38+
children: [
39+
SvgPicture.network(
40+
'https://img.shields.io/github/v/release/CCExtractor/Flood_Mobile?include_prereleases',
41+
key: Key('release badge key'),
42+
),
43+
SvgPicture.network(
44+
'https://img.shields.io/github/last-commit/CCExtractor/Flood_Mobile?label=commit',
45+
key: Key('commit badge key'),
46+
),
47+
SvgPicture.network(
48+
'https://img.shields.io/github/workflow/status/CCExtractor/Flood_Mobile/Flutter%20CI',
49+
key: Key('build badge key'),
50+
),
51+
SvgPicture.network(
52+
'https://img.shields.io/github/issues/CCExtractor/Flood_Mobile',
53+
key: Key('issues badge key'),
54+
),
55+
SvgPicture.network(
56+
'https://img.shields.io/github/issues-pr/CCExtractor/Flood_Mobile?label=PR',
57+
key: Key('PR badge key'),
58+
)
59+
],
60+
),
61+
SizedBox(
62+
height: 20,
63+
),
64+
Column(
65+
crossAxisAlignment: CrossAxisAlignment.start,
66+
children: [
67+
Text(
68+
'Flood is a monitoring service for various torrent clients. It\'s a Node.js service that communicates with your favorite torrent client and serves a decent mobile UI for administration. This project is based on the original Flood project.',
69+
key: Key('App info text key'),
70+
style: TextStyle(
71+
color: ThemeBloc.theme(widget.themeIndex)
72+
.textTheme
73+
.bodyLarge
74+
?.color,
75+
fontSize: 15),
76+
),
77+
SizedBox(
78+
height: 20,
79+
),
80+
Text(
81+
'Feedback',
82+
style: TextStyle(
83+
color: ThemeBloc.theme(widget.themeIndex)
84+
.textTheme
85+
.bodyLarge
86+
?.color,
87+
fontSize: 20,
88+
fontWeight: FontWeight.bold),
89+
),
90+
SizedBox(
91+
height: 10,
92+
),
93+
Text(
94+
'If you have a specific issue or bug, please file a GitHub issue. Please join the Flood Discord server to discuss feature requests and implementation details.',
95+
key: Key('Feedback text key'),
96+
style: TextStyle(
97+
color: ThemeBloc.theme(widget.themeIndex)
98+
.textTheme
99+
.bodyLarge
100+
?.color,
101+
fontSize: 15),
102+
),
103+
SizedBox(
104+
height: 20,
105+
),
106+
Text(
107+
'More Information',
108+
style: TextStyle(
109+
color: ThemeBloc.theme(widget.themeIndex)
110+
.textTheme
111+
.bodyLarge
112+
?.color,
113+
fontSize: 20,
114+
fontWeight: FontWeight.bold),
115+
),
116+
SizedBox(
117+
height: 10,
118+
),
119+
Text(
120+
'Check out the Wiki for more information.',
121+
key: Key('More info text key'),
122+
style: TextStyle(
123+
color: ThemeBloc.theme(widget.themeIndex)
124+
.textTheme
125+
.bodyLarge
126+
?.color,
127+
fontSize: 15),
128+
),
129+
SizedBox(
130+
height: 20,
131+
),
132+
],
133+
)
134+
],
135+
),
136+
),
137+
),
138+
);
139+
}
140+
}

0 commit comments

Comments
 (0)