Skip to content

Commit 44c79e5

Browse files
committed
feat: UI changes
1 parent 6405eca commit 44c79e5

13 files changed

+103
-77
lines changed

ios/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,4 @@ SPEC CHECKSUMS:
124124

125125
PODFILE CHECKSUM: dbf4946ff5db175341f22037ab5e1978c925cafb
126126

127-
COCOAPODS: 1.10.1
127+
COCOAPODS: 1.10.2

lib/Components/add_torrent_sheet.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class _AddTorrentSheetState extends State<AddTorrentSheet> {
4444
@override
4545
Widget build(BuildContext context) {
4646
return Container(
47-
color: ThemeProvider.theme.primaryColorLight,
47+
color: ThemeProvider.theme.primaryColor,
4848
padding: EdgeInsets.symmetric(vertical: 25, horizontal: 20),
4949
child: Form(
5050
key: _formKey,
@@ -269,6 +269,7 @@ class _AddTorrentSheetState extends State<AddTorrentSheet> {
269269
}
270270
},
271271
style: ElevatedButton.styleFrom(
272+
elevation: 0,
272273
shape: RoundedRectangleBorder(
273274
borderRadius: BorderRadius.circular(14.0),
274275
),
@@ -278,9 +279,9 @@ class _AddTorrentSheetState extends State<AddTorrentSheet> {
278279
child: Text(
279280
"Add Torrent",
280281
style: TextStyle(
281-
color: ThemeProvider.theme.textTheme.bodyText1?.color,
282+
color: Colors.white,
282283
fontSize: 16,
283-
fontWeight: FontWeight.w900),
284+
fontWeight: FontWeight.w600),
284285
),
285286
),
286287
),

lib/Components/change_theme_button_widget.dart

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,25 @@ class ChangeThemeButtonWidget extends StatelessWidget {
77
Widget build(BuildContext context) {
88
final themeProvider = Provider.of<ThemeProvider>(context);
99

10-
return Switch.adaptive(
11-
splashRadius: 2.0,
12-
activeThumbImage: AssetImage(
13-
'assets/images/moon.png',
14-
),
15-
inactiveThumbImage: AssetImage('assets/images/sun.png'),
16-
value: themeProvider.isDarkMode,
17-
onChanged: (value) {
18-
final provider = Provider.of<ThemeProvider>(context, listen: false);
19-
provider.toggleTheme(value);
10+
return IconButton(
11+
onPressed: () {
12+
themeProvider.toggleTheme();
2013
},
14+
icon: Icon(themeProvider.isDarkMode
15+
? Icons.wb_sunny_rounded
16+
: Icons.mode_night_rounded),
2117
);
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+
// );
2230
}
2331
}

lib/Components/logout_alert.dart

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ class LogOutAlert extends StatelessWidget {
1111
Widget build(BuildContext context) {
1212
final hp = MediaQuery.of(context).size.height;
1313
return AlertDialog(
14+
elevation: 0,
1415
backgroundColor: ThemeProvider.theme.primaryColorLight,
1516
shape: RoundedRectangleBorder(
1617
borderRadius: BorderRadius.all(
@@ -29,50 +30,50 @@ class LogOutAlert extends StatelessWidget {
2930
),
3031
actionsPadding: EdgeInsets.all(5),
3132
actions: [
32-
// Yes - TextButton
33+
// No - TextButton
3334
TextButton(
3435
style: ButtonStyle(
36+
minimumSize: MaterialStateProperty.all<Size>(
37+
Size(hp * .160, hp * .059),
38+
),
3539
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
3640
RoundedRectangleBorder(
37-
borderRadius: BorderRadius.circular(12),
41+
borderRadius: BorderRadius.circular(8),
3842
),
3943
),
40-
minimumSize: MaterialStateProperty.all<Size>(
41-
Size(hp * .160, hp * .059),
42-
),
43-
backgroundColor:
44-
MaterialStateProperty.all(ThemeProvider.theme.primaryColorDark),
44+
backgroundColor: MaterialStateProperty.all(
45+
ThemeProvider.theme.dialogBackgroundColor),
4546
),
46-
onPressed: logoutOnClick,
47+
onPressed: () {
48+
Navigator.of(context, rootNavigator: true).pop();
49+
},
4750
child: Text(
48-
'Yes',
51+
'No',
4952
style: TextStyle(
50-
color: ThemeProvider.theme.textTheme.bodyText1?.color),
53+
color: Colors.white,
54+
),
5155
),
5256
),
53-
// Space in between Buttons
54-
SizedBox(width: 5),
55-
// No - TextButton
57+
// Yes - TextButton
5658
TextButton(
5759
style: ButtonStyle(
58-
minimumSize: MaterialStateProperty.all<Size>(
59-
Size(hp * .160, hp * .059),
60-
),
6160
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
6261
RoundedRectangleBorder(
63-
borderRadius: BorderRadius.circular(12),
62+
borderRadius: BorderRadius.circular(8),
6463
),
6564
),
66-
backgroundColor: MaterialStateProperty.all(
67-
ThemeProvider.theme.dialogBackgroundColor),
65+
minimumSize: MaterialStateProperty.all<Size>(
66+
Size(hp * .160, hp * .059),
67+
),
68+
backgroundColor:
69+
MaterialStateProperty.all(ThemeProvider.theme.primaryColorDark),
6870
),
69-
onPressed: () {
70-
Navigator.of(context, rootNavigator: true).pop();
71-
},
71+
onPressed: logoutOnClick,
7272
child: Text(
73-
'No',
73+
'Yes',
7474
style: TextStyle(
75-
color: ThemeProvider.theme.textTheme.bodyText1?.color),
75+
color: Colors.white,
76+
),
7677
),
7778
),
7879
],

lib/Components/notification_popup_dialogue_container.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Widget notificationPopupDialogueContainer({required BuildContext context}) {
1212
.length ==
1313
0)
1414
? Container(
15-
color: ThemeProvider.theme.primaryColorLight,
15+
color: ThemeProvider.theme.primaryColor,
1616
width: 300,
1717
child: Text(
1818
'No notifications to display',
@@ -22,7 +22,7 @@ Widget notificationPopupDialogueContainer({required BuildContext context}) {
2222
),
2323
)
2424
: Container(
25-
color: ThemeProvider.theme.backgroundColor,
25+
color: ThemeProvider.theme.primaryColor,
2626
width: 300.0, // Change as per your requirement
2727
child: ListView.builder(
2828
shrinkWrap: true,

lib/Components/torrent_tile.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ class _TorrentTileState extends State<TorrentTile> {
127127
fontWeight: FontWeight.bold,
128128
),
129129
),
130-
subtitle: Padding(
130+
subtitle: Container(
131131
padding: EdgeInsets.symmetric(vertical: 8.0),
132132
child: Column(
133133
crossAxisAlignment: CrossAxisAlignment.start,

lib/Constants/theme_provider.dart

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,19 @@ class ThemeProvider extends ChangeNotifier {
88
static ThemeData get theme =>
99
themeMode == ThemeMode.dark ? MyThemes.darkTheme : MyThemes.lightTheme;
1010

11-
void toggleTheme(bool isOn) {
12-
themeMode = isOn ? ThemeMode.dark : ThemeMode.light;
11+
void toggleTheme() {
12+
if (themeMode == ThemeMode.dark) {
13+
themeMode = ThemeMode.light;
14+
} else {
15+
themeMode = ThemeMode.dark;
16+
}
1317
notifyListeners();
1418
}
1519
}
1620

1721
class MyThemes {
1822
static final darkTheme = ThemeData(
1923
brightness: Brightness.dark,
20-
shadowColor: Colors.white54,
2124
primaryColor: Color(0xff0E2537),
2225
primaryColorDark: Color(0xff39C481),
2326
primaryColorLight: Color(0xff305067),
@@ -36,14 +39,13 @@ class MyThemes {
3639
),
3740
);
3841
static final lightTheme = ThemeData(
39-
shadowColor: Colors.grey[800],
4042
brightness: Brightness.light,
4143
primaryColor: Colors.white,
4244
primaryColorDark: Color(0xff39C481),
4345
backgroundColor: Color(0xff293341),
4446
accentColor: Color(0xff399CF4),
4547
canvasColor: Colors.transparent,
46-
primaryColorLight: Colors.grey[300],
48+
primaryColorLight: Colors.grey[100],
4749
dialogBackgroundColor: Color(0xff399CF4),
4850
textTheme: TextTheme().apply(
4951
displayColor: Color(0xff293341),

lib/Pages/home_screen.dart

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'package:badges/badges.dart';
12
import 'package:flood_mobile/Api/client_api.dart';
23
import 'package:flood_mobile/Api/notifications_api.dart';
34
import 'package:flood_mobile/Components/logout_alert.dart';
@@ -49,7 +50,7 @@ class _HomeScreenState extends State<HomeScreen> {
4950
return KeyboardDismissOnTap(
5051
child: SimpleHiddenDrawer(
5152
withShadow: true,
52-
slidePercent: wp > 600 ? wp * 0.025 : wp * 0.13,
53+
slidePercent: 80,
5354
contentCornerRadius: 40,
5455
menu: Menu(),
5556
screenSelectedBuilder: (position, controller) {
@@ -92,6 +93,35 @@ class _HomeScreenState extends State<HomeScreen> {
9293
elevation: 0,
9394
actions: [
9495
ChangeThemeButtonWidget(),
96+
Badge(
97+
badgeColor: Theme.of(context).accentColor,
98+
badgeContent: Center(
99+
child: Text(
100+
homeModel.unreadNotifications.toString(),
101+
style: TextStyle(color: Colors.white),
102+
),
103+
),
104+
position: BadgePosition(top: 0, end: 3),
105+
child: IconButton(
106+
icon: Icon(
107+
Icons.notifications,
108+
),
109+
onPressed: () {
110+
showDialog(
111+
context: context,
112+
builder: (BuildContext context) {
113+
return AlertDialog(
114+
elevation: 0,
115+
backgroundColor: Theme.of(context).primaryColor,
116+
content: notificationPopupDialogueContainer(
117+
context: context,
118+
),
119+
);
120+
},
121+
);
122+
},
123+
),
124+
),
95125
],
96126
),
97127
body: screenCurrent,
@@ -212,21 +242,6 @@ class _MenuState extends State<Menu> {
212242
controller.toggle();
213243
},
214244
title: 'About'),
215-
NavDrawerListTile(
216-
icon: Icons.notifications,
217-
onTap: () {
218-
showDialog(
219-
context: context,
220-
builder: (BuildContext context) {
221-
return AlertDialog(
222-
backgroundColor: ThemeProvider.theme.primaryColorLight,
223-
content: notificationPopupDialogueContainer(
224-
context: context),
225-
);
226-
});
227-
},
228-
title: 'Notifications',
229-
),
230245
],
231246
),
232247
),

lib/Pages/login_screen.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,10 +320,9 @@ class _LoginScreenState extends State<LoginScreen> {
320320
child: Text(
321321
"Login",
322322
style: TextStyle(
323-
color: ThemeProvider
324-
.theme.textTheme.bodyText1!.color!,
323+
color: Colors.white,
325324
fontSize: 20,
326-
fontWeight: FontWeight.w900),
325+
fontWeight: FontWeight.w600),
327326
),
328327
),
329328
),

lib/Pages/settings_screen.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
145145
return KeyboardDismissOnTap(
146146
child: Scaffold(
147147
floatingActionButton: FloatingActionButton.extended(
148+
elevation: 0,
148149
backgroundColor: ThemeProvider.theme.primaryColorDark,
149150
onPressed: () {
150151
ClientSettingsModel newClientSettingsModel = new ClientSettingsModel(
@@ -196,12 +197,12 @@ class _SettingsScreenState extends State<SettingsScreen> {
196197
},
197198
icon: Icon(
198199
Icons.save,
199-
color: ThemeProvider.theme.textTheme.bodyText1?.color,
200+
color: Colors.white,
200201
),
201202
label: Text(
202203
"Save",
203204
style: TextStyle(
204-
color: ThemeProvider.theme.textTheme.bodyText1?.color,
205+
color: Colors.white,
205206
fontSize: 16,
206207
fontWeight: FontWeight.w600),
207208
),
@@ -762,8 +763,7 @@ class AuthenticationSection extends StatelessWidget {
762763
child: Text(
763764
"Add",
764765
style: TextStyle(
765-
color: ThemeProvider
766-
.theme.textTheme.bodyText1?.color,
766+
color: Colors.white,
767767
fontSize: 16,
768768
fontWeight: FontWeight.w600),
769769
),

0 commit comments

Comments
 (0)