From fd83fef528f479ae6b07a51ce61aeba1ba1d7b9c Mon Sep 17 00:00:00 2001 From: Brandon Presley Date: Thu, 13 Apr 2023 15:09:06 +1200 Subject: [PATCH] Automatically switch theme based on system theme --- lib/main.dart | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 8476d9f..34fbb4a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -25,10 +25,9 @@ class MyApp extends StatelessWidget { return MaterialApp( title: 'Gym App', - theme: ThemeData( - primarySwatch: Colors.blue, - visualDensity: VisualDensity.adaptivePlatformDensity, - ), + themeMode: ThemeMode.system, + darkTheme: ThemeData.dark(), + theme: ThemeData.light(), initialRoute: '/home', routes: routes, navigatorKey: navigatorKey,