Skip to content

Commit e8b433c

Browse files
committed
🐛 fix: theme issue #37
1 parent a9d2759 commit e8b433c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

using_theme/lib/main.dart

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,15 @@ class MyHome extends StatelessWidget {
3939
),
4040
),
4141

42-
floatingActionButton: new Theme(
42+
floatingActionButton: Theme(
4343
// override the accent color of theme for this widget only
44-
data: Theme.of(context).copyWith(accentColor: Colors.pinkAccent),
45-
child: new FloatingActionButton(
44+
data: Theme.of(context).copyWith(
45+
colorScheme:
46+
Theme.of(context).colorScheme.copyWith(secondary: Colors.pinkAccent),
47+
),
48+
child: FloatingActionButton(
4649
onPressed: null,
47-
child: new Icon(Icons.add),
50+
child: Icon(Icons.add),
4851
),
4952
),
5053
);

0 commit comments

Comments
 (0)