feat: Add theme customization options in settings screen and update app theme logic
This commit is contained in:
@@ -1,17 +1,22 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AppTheme {
|
||||
static ThemeData get theme {
|
||||
static ThemeData theme({Color seedColor = Colors.amber}) {
|
||||
final Brightness foregroundBrightness =
|
||||
ThemeData.estimateBrightnessForColor(seedColor);
|
||||
final Color foregroundColor =
|
||||
foregroundBrightness == Brightness.dark ? Colors.white : Colors.black;
|
||||
|
||||
return ThemeData(
|
||||
useMaterial3: true,
|
||||
scaffoldBackgroundColor: const Color.fromRGBO(31, 32, 33, 1),
|
||||
colorScheme: ColorScheme.fromSeed(
|
||||
seedColor: Colors.amber,
|
||||
seedColor: seedColor,
|
||||
brightness: Brightness.dark,
|
||||
),
|
||||
floatingActionButtonTheme: const FloatingActionButtonThemeData(
|
||||
backgroundColor: Colors.amber,
|
||||
foregroundColor: Colors.black,
|
||||
floatingActionButtonTheme: FloatingActionButtonThemeData(
|
||||
backgroundColor: seedColor,
|
||||
foregroundColor: foregroundColor,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user