diff --git a/wien_talks/wien_talks_flutter/lib/main.dart b/wien_talks/wien_talks_flutter/lib/main.dart index 1f585ca..00d95ca 100644 --- a/wien_talks/wien_talks_flutter/lib/main.dart +++ b/wien_talks/wien_talks_flutter/lib/main.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart'; import 'package:wien_talks_flutter/helper/go_router.dart'; +import 'package:wien_talks_flutter/theme.dart'; Future main() async { await dotenv.load(fileName: '.env'); @@ -14,7 +15,7 @@ class MyApp extends StatelessWidget { Widget build(BuildContext context) { return MaterialApp.router( title: 'Wien Talks', - theme: ThemeData(primarySwatch: Colors.green), + theme: GemeindeBauTheme.light(), routerConfig: router, ); } diff --git a/wien_talks/wien_talks_flutter/lib/theme.dart b/wien_talks/wien_talks_flutter/lib/theme.dart new file mode 100644 index 0000000..80dcb07 --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/theme.dart @@ -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, + ); + } +}