From 459ba5ec2d0c34b734bb913ebda090e9b488ab10 Mon Sep 17 00:00:00 2001 From: Andrea Bizzotto Date: Sat, 13 Jan 2024 15:36:07 +0000 Subject: [PATCH] Update primary theme color for AppBar, FloatingActionButton --- lib/src/app.dart | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/src/app.dart b/lib/src/app.dart index e0afd420..a595f399 100644 --- a/lib/src/app.dart +++ b/lib/src/app.dart @@ -5,15 +5,19 @@ import 'package:starter_architecture_flutter_firebase/src/routing/app_router.dar class MyApp extends ConsumerWidget { const MyApp({super.key}); + static const primaryColor = Colors.indigo; + @override Widget build(BuildContext context, WidgetRef ref) { final goRouter = ref.watch(goRouterProvider); return MaterialApp.router( routerConfig: goRouter, theme: ThemeData( - primarySwatch: Colors.indigo, + colorSchemeSeed: primaryColor, unselectedWidgetColor: Colors.grey, appBarTheme: const AppBarTheme( + backgroundColor: primaryColor, + foregroundColor: Colors.white, elevation: 2.0, centerTitle: true, ), @@ -22,10 +26,13 @@ class MyApp extends ConsumerWidget { // https://github.com/firebase/flutterfire/blob/master/packages/firebase_ui_auth/doc/theming.md outlinedButtonTheme: OutlinedButtonThemeData( style: ButtonStyle( - backgroundColor: MaterialStateProperty.all(Colors.indigo), + backgroundColor: MaterialStateProperty.all(primaryColor), foregroundColor: MaterialStateProperty.all(Colors.white), ), ), + floatingActionButtonTheme: const FloatingActionButtonThemeData( + backgroundColor: primaryColor, + ), ), debugShowCheckedModeBanner: false, );