add vienna social housing theme (brown)

This commit is contained in:
tk 2025-08-17 05:10:12 +02:00
parent fd77a38f97
commit 8bde15320b
2 changed files with 81 additions and 1 deletions

View file

@ -1,6 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:wien_talks_flutter/helper/go_router.dart'; import 'package:wien_talks_flutter/helper/go_router.dart';
import 'package:wien_talks_flutter/theme.dart';
Future<void> main() async { Future<void> main() async {
await dotenv.load(fileName: '.env'); await dotenv.load(fileName: '.env');
@ -14,7 +15,7 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp.router( return MaterialApp.router(
title: 'Wien Talks', title: 'Wien Talks',
theme: ThemeData(primarySwatch: Colors.green), theme: GemeindeBauTheme.light(),
routerConfig: router, routerConfig: router,
); );
} }

View file

@ -0,0 +1,79 @@
import 'package:flutter/material.dart';
class GemeindeBauTheme {
static const _brand = Color(0xFFE20613);
static const _accent = Color(0xFF009640);
static const _radius = 14.0;
static ThemeData light() => _base(
ColorScheme.fromSeed(
seedColor: _brand,
brightness: Brightness.light,
).copyWith(
secondary: _accent,
),
);
static ThemeData _base(
ColorScheme scheme,
) {
return ThemeData(
useMaterial3: true,
colorScheme: scheme,
scaffoldBackgroundColor: scheme.surface,
appBarTheme: AppBarTheme(
backgroundColor: scheme.surface,
foregroundColor: scheme.onSurface,
elevation: 0.5,
// surfaceTintColor: Colors.transparent,
centerTitle: false,
),
bottomSheetTheme: BottomSheetThemeData(
backgroundColor: scheme.surface,
shape: RoundedRectangleBorder(
borderRadius:
const BorderRadius.vertical(top: Radius.circular(_radius)),
),
),
floatingActionButtonTheme: FloatingActionButtonThemeData(
backgroundColor: scheme.primary,
foregroundColor: scheme.onPrimary,
elevation: 3,
shape: const StadiumBorder(),
),
inputDecorationTheme: InputDecorationTheme(
filled: true,
fillColor: scheme.surfaceContainerHighest,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide(color: scheme.outlineVariant),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide(color: scheme.outlineVariant),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide(color: scheme.primary, width: 2),
),
contentPadding:
const EdgeInsets.symmetric(horizontal: 12, vertical: 10),
),
listTileTheme: ListTileThemeData(
iconColor: scheme.onSurfaceVariant,
textColor: scheme.onSurface,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
),
snackBarTheme: SnackBarThemeData(
backgroundColor: scheme.inverseSurface,
contentTextStyle: TextStyle(color: scheme.onInverseSurface),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
),
dividerColor: scheme.outlineVariant,
);
}
}