Skip to content

Commit 60564a2

Browse files
committed
Dark mode to all navigation pages
1 parent cf672fe commit 60564a2

File tree

4 files changed

+41
-27
lines changed

4 files changed

+41
-27
lines changed

best_flutter_ui_templates/lib/custom_drawer/home_drawer.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ class _HomeDrawerState extends State<HomeDrawer> {
242242
fontWeight: FontWeight.w500,
243243
fontSize: 16,
244244
color: widget.screenIndex == listData.index
245-
? Colors.blue
245+
? Colors.black
246246
: AppTheme.nearlyBlack,
247247
),
248248
textAlign: TextAlign.left,

best_flutter_ui_templates/lib/feedback_screen.dart

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@ class _FeedbackScreenState extends State<FeedbackScreen> {
1414

1515
@override
1616
Widget build(BuildContext context) {
17+
var brightness = MediaQuery.of(context).platformBrightness;
18+
bool isLightMode = brightness == Brightness.light;
1719
return Container(
18-
color: AppTheme.nearlyWhite,
20+
color: isLightMode ? AppTheme.nearlyWhite : AppTheme.nearlyBlack,
1921
child: SafeArea(
2022
top: false,
2123
child: Scaffold(
22-
backgroundColor: AppTheme.nearlyWhite,
24+
backgroundColor:
25+
isLightMode ? AppTheme.nearlyWhite : AppTheme.nearlyBlack,
2326
body: SingleChildScrollView(
2427
child: SizedBox(
2528
height: MediaQuery.of(context).size.height,
@@ -37,19 +40,19 @@ class _FeedbackScreenState extends State<FeedbackScreen> {
3740
child: Text(
3841
'Your FeedBack',
3942
style: TextStyle(
40-
fontSize: 20,
41-
fontWeight: FontWeight.bold,
42-
),
43+
fontSize: 20,
44+
fontWeight: FontWeight.bold,
45+
color: isLightMode ? Colors.black : Colors.white),
4346
),
4447
),
4548
Container(
4649
padding: const EdgeInsets.only(top: 16),
47-
child: const Text(
50+
child: Text(
4851
'Give your best time for this moment.',
4952
textAlign: TextAlign.center,
5053
style: TextStyle(
51-
fontSize: 16,
52-
),
54+
fontSize: 16,
55+
color: isLightMode ? Colors.black : Colors.white),
5356
),
5457
),
5558
_buildComposer(),
@@ -60,7 +63,7 @@ class _FeedbackScreenState extends State<FeedbackScreen> {
6063
width: 120,
6164
height: 40,
6265
decoration: BoxDecoration(
63-
color: Colors.blue,
66+
color: isLightMode ? Colors.blue : Colors.white,
6467
borderRadius:
6568
const BorderRadius.all(Radius.circular(4.0)),
6669
boxShadow: <BoxShadow>[
@@ -83,7 +86,9 @@ class _FeedbackScreenState extends State<FeedbackScreen> {
8386
'Send',
8487
style: TextStyle(
8588
fontWeight: FontWeight.w500,
86-
color: Colors.white,
89+
color: isLightMode
90+
? Colors.white
91+
: Colors.black,
8792
),
8893
),
8994
),

best_flutter_ui_templates/lib/help_screen.dart

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ class _HelpScreenState extends State<HelpScreen> {
1717
var brightness = MediaQuery.of(context).platformBrightness;
1818
bool isLightMode = brightness == Brightness.light;
1919
return Container(
20-
color: AppTheme.nearlyWhite,
20+
color: isLightMode ? AppTheme.nearlyWhite : AppTheme.nearlyBlack,
2121
child: SafeArea(
2222
top: false,
2323
child: Scaffold(
24-
backgroundColor: AppTheme.nearlyWhite,
24+
backgroundColor:
25+
isLightMode ? AppTheme.nearlyWhite : AppTheme.nearlyBlack,
2526
body: Column(
2627
children: <Widget>[
2728
Container(
@@ -36,19 +37,19 @@ class _HelpScreenState extends State<HelpScreen> {
3637
child: Text(
3738
'How can we help you?',
3839
style: TextStyle(
39-
fontSize: 20,
40-
fontWeight: FontWeight.bold,
41-
),
40+
fontSize: 20,
41+
fontWeight: FontWeight.bold,
42+
color: isLightMode ? Colors.black : Colors.white),
4243
),
4344
),
4445
Container(
4546
padding: const EdgeInsets.only(top: 16),
46-
child: const Text(
47+
child: Text(
4748
'It looks like you are experiencing problems\nwith our sign up process. We are here to\nhelp so please get in touch with us',
4849
textAlign: TextAlign.center,
4950
style: TextStyle(
50-
fontSize: 16,
51-
),
51+
fontSize: 16,
52+
color: isLightMode ? Colors.black : Colors.white),
5253
),
5354
),
5455
Expanded(
@@ -59,7 +60,7 @@ class _HelpScreenState extends State<HelpScreen> {
5960
width: 140,
6061
height: 40,
6162
decoration: BoxDecoration(
62-
color: Colors.blue,
63+
color: isLightMode ? Colors.blue : Colors.white,
6364
borderRadius:
6465
const BorderRadius.all(Radius.circular(4.0)),
6566
boxShadow: <BoxShadow>[
@@ -80,7 +81,8 @@ class _HelpScreenState extends State<HelpScreen> {
8081
'Chat with Us',
8182
style: TextStyle(
8283
fontWeight: FontWeight.w500,
83-
color: Colors.white,
84+
color:
85+
isLightMode ? Colors.white : Colors.black,
8486
),
8587
),
8688
),

best_flutter_ui_templates/lib/invite_friend_screen.dart

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ class _InviteFriendState extends State<InviteFriend> {
1414

1515
@override
1616
Widget build(BuildContext context) {
17+
var brightness = MediaQuery.of(context).platformBrightness;
18+
bool isLightMode = brightness == Brightness.light;
1719
return Container(
18-
color: AppTheme.nearlyWhite,
20+
color: isLightMode ? AppTheme.white : AppTheme.nearlyBlack,
1921
child: SafeArea(
2022
top: false,
2123
child: Scaffold(
22-
backgroundColor: AppTheme.nearlyWhite,
24+
backgroundColor: isLightMode ? AppTheme.white : AppTheme.nearlyBlack,
2325
body: Column(
2426
children: <Widget>[
2527
Container(
@@ -36,16 +38,18 @@ class _InviteFriendState extends State<InviteFriend> {
3638
style: TextStyle(
3739
fontSize: 20,
3840
fontWeight: FontWeight.bold,
41+
color: isLightMode ? Colors.black : Colors.white,
3942
),
4043
),
4144
),
4245
Container(
4346
padding: const EdgeInsets.only(top: 16),
44-
child: const Text(
47+
child: Text(
4548
'Are you one of those who makes everything\n at the last moment?',
4649
textAlign: TextAlign.center,
4750
style: TextStyle(
4851
fontSize: 16,
52+
color: isLightMode ? Colors.black : Colors.white,
4953
),
5054
),
5155
),
@@ -57,7 +61,7 @@ class _InviteFriendState extends State<InviteFriend> {
5761
width: 120,
5862
height: 40,
5963
decoration: BoxDecoration(
60-
color: Colors.blue,
64+
color: isLightMode ? Colors.blue : Colors.white,
6165
borderRadius:
6266
const BorderRadius.all(Radius.circular(4.0)),
6367
boxShadow: <BoxShadow>[
@@ -81,7 +85,8 @@ class _InviteFriendState extends State<InviteFriend> {
8185
children: <Widget>[
8286
Icon(
8387
Icons.share,
84-
color: Colors.white,
88+
color:
89+
isLightMode ? Colors.white : Colors.black,
8590
size: 22,
8691
),
8792
Padding(
@@ -90,7 +95,9 @@ class _InviteFriendState extends State<InviteFriend> {
9095
'Share',
9196
style: TextStyle(
9297
fontWeight: FontWeight.w500,
93-
color: Colors.white,
98+
color: isLightMode
99+
? Colors.white
100+
: Colors.black,
94101
),
95102
),
96103
),

0 commit comments

Comments
 (0)