| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- import 'package:flutter/material.dart';
- class AppTheme {
- static ThemeData get light {
- final colorScheme = ColorScheme.fromSeed(
- seedColor: const Color(0xFF1A6B4C),
- brightness: Brightness.light,
- );
- return _buildTheme(colorScheme);
- }
- static ThemeData get dark {
- final colorScheme = ColorScheme.fromSeed(
- seedColor: const Color(0xFF1A6B4C),
- brightness: Brightness.dark,
- );
- return _buildTheme(colorScheme);
- }
- static ThemeData _buildTheme(ColorScheme colorScheme) {
- return ThemeData(
- useMaterial3: true,
- colorScheme: colorScheme,
- appBarTheme: AppBarTheme(
- centerTitle: false,
- elevation: 0,
- scrolledUnderElevation: 1,
- backgroundColor: colorScheme.surface,
- foregroundColor: colorScheme.onSurface,
- ),
- cardTheme: CardThemeData(
- elevation: 0,
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(12),
- side: BorderSide(color: colorScheme.outlineVariant, width: 0.5),
- ),
- ),
- inputDecorationTheme: InputDecorationTheme(
- filled: true,
- border: OutlineInputBorder(
- borderRadius: BorderRadius.circular(12),
- ),
- contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
- ),
- floatingActionButtonTheme: FloatingActionButtonThemeData(
- elevation: 2,
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(16),
- ),
- ),
- navigationBarTheme: NavigationBarThemeData(
- elevation: 1,
- indicatorShape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(12),
- ),
- ),
- navigationRailTheme: NavigationRailThemeData(
- elevation: 1,
- indicatorShape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(12),
- ),
- ),
- );
- }
- }
|