1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-10-22 22:43:22 +00:00

Can specify custom primary color

This commit is contained in:
Pierre HUBERT 2021-04-24 08:57:20 +02:00
parent 18d3ae6955
commit 0edea3edd4
3 changed files with 11 additions and 1 deletions

View File

@ -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,

View File

@ -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<ComunicApplication> {
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,
);
}

View File

@ -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,