42 lines
1.2 KiB
Dart
42 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
enum AppThemeMode { light, dark, system }
|
|
|
|
class AppTheme {
|
|
static const _primaryColor = Color(0xFF4CAF50);
|
|
|
|
static ThemeData get lightTheme => ThemeData(
|
|
useMaterial3: true,
|
|
brightness: Brightness.light,
|
|
colorSchemeSeed: _primaryColor,
|
|
appBarTheme: const AppBarTheme(centerTitle: true),
|
|
inputDecorationTheme: InputDecorationTheme(
|
|
border: OutlineInputBorder(borderRadius: BorderRadius.circular(8)),
|
|
filled: true,
|
|
),
|
|
);
|
|
|
|
static ThemeData get darkTheme => ThemeData(
|
|
useMaterial3: true,
|
|
brightness: Brightness.dark,
|
|
colorSchemeSeed: _primaryColor,
|
|
appBarTheme: const AppBarTheme(centerTitle: true),
|
|
scaffoldBackgroundColor: const Color(0xFF121212),
|
|
inputDecorationTheme: InputDecorationTheme(
|
|
border: OutlineInputBorder(borderRadius: BorderRadius.circular(8)),
|
|
filled: true,
|
|
),
|
|
);
|
|
|
|
static ThemeMode toFlutterThemeMode(AppThemeMode mode) {
|
|
switch (mode) {
|
|
case AppThemeMode.light:
|
|
return ThemeMode.light;
|
|
case AppThemeMode.dark:
|
|
return ThemeMode.dark;
|
|
case AppThemeMode.system:
|
|
return ThemeMode.system;
|
|
}
|
|
}
|
|
}
|