File tree Expand file tree Collapse file tree 6 files changed +14
-12
lines changed Expand file tree Collapse file tree 6 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -60,13 +60,15 @@ class MyApp extends StatelessWidget {
6060 },
6161 };
6262
63+ final themeData = ThemeData (brightness: Brightness .dark);
6364 return Provider <Map <String , WidgetBuilder >>.value (
6465 routes,
6566 child: MaterialApp (
6667 title: 'Flutter Demo' ,
67- theme: ThemeData (
68- brightness: Brightness .dark,
69- accentColor: const Color (0xFF00e676 ),
68+ theme: themeData.copyWith (
69+ colorScheme: themeData.colorScheme.copyWith (
70+ secondary: const Color (0xFF00e676 ),
71+ ),
7072 ),
7173 routes: routes,
7274 debugShowCheckedModeBanner: false ,
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ class HomeUserProfile extends StatelessWidget {
6767 children: < Widget > [
6868 Icon (
6969 Icons .error,
70- color: themeData.accentColor ,
70+ color: themeData.colorScheme.secondary ,
7171 ),
7272 SizedBox (height: 4 ),
7373 Text (
Original file line number Diff line number Diff line change @@ -221,7 +221,7 @@ class _MyLoginPageState extends State<LoginPage>
221221 child: Material (
222222 elevation: 5.0 ,
223223 clipBehavior: Clip .antiAlias,
224- shadowColor: Theme .of (context).accentColor ,
224+ shadowColor: Theme .of (context).colorScheme.secondary ,
225225 borderRadius: BorderRadius .circular (24.0 ),
226226 child: value > 75.0
227227 ? child
@@ -240,7 +240,7 @@ class _MyLoginPageState extends State<LoginPage>
240240 loginBloc.submitLogin ();
241241 },
242242 color: Theme .of (context).backgroundColor,
243- splashColor: Theme .of (context).accentColor ,
243+ splashColor: Theme .of (context).colorScheme.secondary ,
244244 child: Text (
245245 'LOGIN' ,
246246 style: TextStyle (
Original file line number Diff line number Diff line change @@ -215,7 +215,7 @@ class _RegisterPageState extends State<RegisterPage>
215215 child: Material (
216216 elevation: 5.0 ,
217217 clipBehavior: Clip .antiAlias,
218- shadowColor: Theme .of (context).accentColor ,
218+ shadowColor: Theme .of (context).colorScheme.secondary ,
219219 borderRadius: BorderRadius .circular (24.0 ),
220220 child: value > 75.0
221221 ? child
@@ -234,7 +234,7 @@ class _RegisterPageState extends State<RegisterPage>
234234 registerBloc.submitRegister ();
235235 },
236236 color: Theme .of (context).backgroundColor,
237- splashColor: Theme .of (context).accentColor ,
237+ splashColor: Theme .of (context).colorScheme.secondary ,
238238 child: Text (
239239 'REGISTER' ,
240240 style: TextStyle (
Original file line number Diff line number Diff line change @@ -160,11 +160,11 @@ class _InputTokenAndResetPasswordPageState
160160
161161 final overlayColor = MaterialStateProperty .resolveWith ((states) {
162162 if (states.contains (MaterialState .hovered)) {
163- return Theme .of (context).accentColor .withOpacity (0.5 );
163+ return Theme .of (context).colorScheme.secondary .withOpacity (0.5 );
164164 }
165165 if (states.contains (MaterialState .focused) ||
166166 states.contains (MaterialState .pressed)) {
167- return Theme .of (context).accentColor .withOpacity (0.8 );
167+ return Theme .of (context).colorScheme.secondary .withOpacity (0.8 );
168168 }
169169 return null ;
170170 });
Original file line number Diff line number Diff line change @@ -94,11 +94,11 @@ class _SendEmailPageState extends State<SendEmailPage>
9494
9595 final overlayColor = MaterialStateProperty .resolveWith ((states) {
9696 if (states.contains (MaterialState .hovered)) {
97- return Theme .of (context).accentColor .withOpacity (0.5 );
97+ return Theme .of (context).colorScheme.secondary .withOpacity (0.5 );
9898 }
9999 if (states.contains (MaterialState .focused) ||
100100 states.contains (MaterialState .pressed)) {
101- return Theme .of (context).accentColor .withOpacity (0.8 );
101+ return Theme .of (context).colorScheme.secondary .withOpacity (0.8 );
102102 }
103103 return null ;
104104 });
You can’t perform that action at this time.
0 commit comments