diff --git a/lib/forez/main_forez_dev.dart b/lib/forez/main_forez_dev.dart index f656711..06abfd4 100644 --- a/lib/forez/main_forez_dev.dart +++ b/lib/forez/main_forez_dev.dart @@ -28,6 +28,8 @@ void main() { apiServerSecure: false, clientName: "ForezFlutter", splashBackgroundColor: Colors.green.shade900, + primaryColor: Colors.green, + primaryColorDark: Colors.green.shade900, appName: "#Forez", appQuickDescription: tr("Events organisation in Forez plain"), toursEntriesBuilder: buildTour, diff --git a/lib/main.dart b/lib/main.dart index 1f325db..d425ac9 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -3,6 +3,7 @@ import 'package:comunic/helpers/database/database_helper.dart'; import 'package:comunic/helpers/preferences_helper.dart'; import 'package:comunic/helpers/serialization/user_list_serialization_helper.dart'; import 'package:comunic/helpers/version_helper.dart'; +import 'package:comunic/models/config.dart'; import 'package:comunic/ui/widgets/init_widget.dart'; import 'package:comunic/utils/flutter_utils.dart'; import 'package:comunic/utils/intl_utils.dart'; @@ -62,7 +63,10 @@ class ComunicApplicationState extends State { return MaterialApp( debugShowCheckedModeBanner: false, home: InitializeWidget(), - theme: prefs.enableDarkMode ? ThemeData.dark() : null, + theme: (prefs.enableDarkMode ? ThemeData.dark() : ThemeData.fallback()) + .copyWith( + primaryColor: config().primaryColor, + primaryColorDark: config().primaryColorDark), showPerformanceOverlay: prefs.showPerformancesOverlay, ); } diff --git a/lib/models/config.dart b/lib/models/config.dart index fc56099..b93e49e 100644 --- a/lib/models/config.dart +++ b/lib/models/config.dart @@ -16,6 +16,8 @@ class Config { final bool apiServerSecure; final String clientName; final Color splashBackgroundColor; + final Color primaryColor; + final Color primaryColorDark; final String appName; final String appQuickDescription; @@ -28,6 +30,8 @@ class Config { @required this.apiServerSecure, @required this.clientName, this.splashBackgroundColor = defaultColor, + this.primaryColor, + this.primaryColorDark, this.appName = "Comunic", this.appQuickDescription, this.toursEntriesBuilder,