From e8b433c00ddf7e02826363fdb1fee9a5d76ce4ae Mon Sep 17 00:00:00 2001 From: Nishant Srivastava Date: Tue, 23 Jul 2019 03:25:56 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20theme=20issue=20#37?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- using_theme/lib/main.dart | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/using_theme/lib/main.dart b/using_theme/lib/main.dart index 5cc161b..c1b8cd6 100644 --- a/using_theme/lib/main.dart +++ b/using_theme/lib/main.dart @@ -39,12 +39,15 @@ class MyHome extends StatelessWidget { ), ), - floatingActionButton: new Theme( + floatingActionButton: Theme( // override the accent color of theme for this widget only - data: Theme.of(context).copyWith(accentColor: Colors.pinkAccent), - child: new FloatingActionButton( + data: Theme.of(context).copyWith( + colorScheme: + Theme.of(context).colorScheme.copyWith(secondary: Colors.pinkAccent), + ), + child: FloatingActionButton( onPressed: null, - child: new Icon(Icons.add), + child: Icon(Icons.add), ), ), );