Skip to content
This repository has been archived by the owner on Jan 17, 2024. It is now read-only.

Commit

Permalink
feat: adjust app color scheme and text theme
Browse files Browse the repository at this point in the history
  • Loading branch information
IsAvaible committed Nov 21, 2023
1 parent bb7e094 commit 3d6e967
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ android {
applicationId "com.example.biersommelier"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion flutter.minSdkVersion
minSdkVersion 20
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
33 changes: 31 additions & 2 deletions lib/router/PageRouter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,44 @@ import 'package:biersommelier/pages/Other.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';

// As Flutter does not expose these color types, we have to extend them ourselves
extension AppColorScheme on ColorScheme {
Color get success => const Color(0xFFB4CF67);
Color get lightSecondary => const Color(0xFF946C00);
Color get hint => const Color(0xFF2187FF);
Color get white => const Color(0xFFFFFFFF);
Color get black => const Color(0xFF000000);
}

class PageRouter {
/// Diese Methode ersetzt router durch die benötigten
/// Eigenschaften der App (Hintergrundfarbe uä)
static MaterialApp app() {
return MaterialApp.router(
title: 'Biersommelier',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.transparent),
useMaterial3: true,
colorScheme: const ColorScheme(
primary: Color(0xFFFFB800),
secondary: Color(0xFF453200),
surface: Color(0xFFFFFFFF),
background: Color(0xFFFFFFFF),
error: Color(0xFFC00000),
onPrimary: Color(0xFFFFFFFF),
onSecondary: Color(0xFFFFFFFF),
onSurface: Color(0xFF171000),
onBackground: Color(0xFF171000),
onError: Color(0xFFFFFFFF),
brightness: Brightness.light,
),
textTheme: const TextTheme(
displayLarge: TextStyle(fontFamily: 'Inter', fontSize: 24, fontWeight: FontWeight.bold),
displayMedium: TextStyle(fontFamily: 'Inter', fontSize: 16, fontWeight: FontWeight.bold),
displaySmall: TextStyle(fontFamily: 'Inter', fontSize: 16, fontWeight: FontWeight.w600),
headlineMedium: TextStyle(fontFamily: 'Inter', fontSize: 8, fontWeight: FontWeight.bold),
bodyLarge: TextStyle(fontFamily: 'Inter', fontSize: 16, fontWeight: FontWeight.normal),
bodySmall: TextStyle(fontFamily: 'Inter', fontSize: 14, fontWeight: FontWeight.normal),
),
useMaterial3: false,
),
routerConfig: PageRouter.router(),
);
Expand Down

0 comments on commit 3d6e967

Please sign in to comment.