From ce5dd1aa2b4e08a38858c3a1e2d865c19d5d900e Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 11 Jan 2023 20:20:40 +0100 Subject: [PATCH] 523: use colors for theme from buildConfig --- frontend/build-configs/bayern/index.ts | 4 ++-- frontend/build-configs/nuernberg/index.ts | 6 +++--- frontend/build-configs/types.ts | 8 ++++---- frontend/lib/themes.dart | 14 ++++++++------ 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/frontend/build-configs/bayern/index.ts b/frontend/build-configs/bayern/index.ts index a87a9b153..0292b7028 100644 --- a/frontend/build-configs/bayern/index.ts +++ b/frontend/build-configs/bayern/index.ts @@ -10,8 +10,8 @@ export const bayernCommon: CommonBuildConfigType = { }, categories: [1, 2, 3], theme: { - primaryColor: "#123456", - secondaryColor: "#123456" + primaryLight: "#5f5384", + primaryDark: "#8377A9" }, mapStyleUrl: { production: "https://api.entitlementcard.app/project/bayern.ehrenamtskarte.app/map", diff --git a/frontend/build-configs/nuernberg/index.ts b/frontend/build-configs/nuernberg/index.ts index 45deecef7..4e6d5eea3 100644 --- a/frontend/build-configs/nuernberg/index.ts +++ b/frontend/build-configs/nuernberg/index.ts @@ -10,8 +10,8 @@ export const nuernbergCommon: CommonBuildConfigType = { }, categories: [], theme: { - primaryColor: "#123456", - secondaryColor: "#123456" + primaryLight: "#D88C51", + primaryDark: "#F9B787" }, mapStyleUrl: { production: "https://api.entitlementcard.app/project/nuernberg.sozialpass.app/map", @@ -38,7 +38,7 @@ export const nuernbergCommon: CommonBuildConfigType = { bodyLabel: "Nürnberg-Pass", bodyTextColor: "#000000", bodyBackgroundImage: true, - bodyBackgroundImageUrl:"assets/nuernberg/background.png", + bodyBackgroundImageUrl: "assets/nuernberg/background.png", colorStandard: "#F9B787", colorPremium: "#F9B787", boxDecorationRadius: 0, diff --git a/frontend/build-configs/types.ts b/frontend/build-configs/types.ts index 883cf69a1..ad840f681 100644 --- a/frontend/build-configs/types.ts +++ b/frontend/build-configs/types.ts @@ -7,8 +7,8 @@ type BuildConfigType = { export type FeatureFlagsType = {} export type ThemeType = { - primaryColor: string, - secondaryColor: string + primaryLight: string, + primaryDark: string } export type CommonBuildConfigType = { @@ -36,12 +36,12 @@ export type CommonBuildConfigType = { headerTitleRight: string, headerLogo: string, headerLogoPadding: number, - headerContainerPadding: {top:number, left: number; bottom: number, right: number} + headerContainerPadding: { top: number, left: number; bottom: number, right: number } headerTextFontSize: number, bodyTextColor: string, colorPremium: string, colorStandard: string, - bodyContainerPadding: {top:number, left: number; bottom: number, right: number} + bodyContainerPadding: { top: number, left: number; bottom: number, right: number } bodyLogo: string, bodyLogoPosition: string, bodyLabel: string, diff --git a/frontend/lib/themes.dart b/frontend/lib/themes.dart index 27638aa55..2f650f593 100644 --- a/frontend/lib/themes.dart +++ b/frontend/lib/themes.dart @@ -1,12 +1,14 @@ +import 'package:ehrenamtskarte/build_config/build_config.dart'; +import 'package:ehrenamtskarte/util/color_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; ThemeData get lightTheme { const defaultTypography = Typography.blackMountainView; final lightTheme = ThemeData.from( - colorScheme: const ColorScheme.light( - primary: Color(0xff5f5384), - secondary: Color(0xff5f5384), + colorScheme: ColorScheme.light( + primary: getColorFromHex(buildConfig.theme.primaryLight), + secondary: getColorFromHex(buildConfig.theme.primaryLight), ), textTheme: defaultTypography.copyWith( headline4: defaultTypography.headline4?.apply(color: Colors.black87), @@ -31,9 +33,9 @@ ThemeData get lightTheme { ThemeData get darkTheme { const defaultTypography = Typography.whiteMountainView; final theme = ThemeData.from( - colorScheme: const ColorScheme.dark( - primary: Color(0xff8377A9), - secondary: Color(0xff8377A9), + colorScheme: ColorScheme.dark( + primary: getColorFromHex(buildConfig.theme.primaryDark), + secondary: getColorFromHex(buildConfig.theme.primaryDark), ), textTheme: defaultTypography.copyWith( headline4: defaultTypography.headline4?.apply(color: Colors.white),