Skip to content

Commit

Permalink
Update primary theme color for AppBar, FloatingActionButton
Browse files Browse the repository at this point in the history
  • Loading branch information
bizz84 committed Jan 13, 2024
1 parent ae1bf63 commit 459ba5e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/src/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
Expand All @@ -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<Color>(Colors.indigo),
backgroundColor: MaterialStateProperty.all<Color>(primaryColor),
foregroundColor: MaterialStateProperty.all<Color>(Colors.white),
),
),
floatingActionButtonTheme: const FloatingActionButtonThemeData(
backgroundColor: primaryColor,
),
),
debugShowCheckedModeBanner: false,
);
Expand Down

0 comments on commit 459ba5e

Please sign in to comment.