23 lines
730 B
Dart
23 lines
730 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class AppTheme {
|
|
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: seedColor,
|
|
brightness: Brightness.dark,
|
|
),
|
|
floatingActionButtonTheme: FloatingActionButtonThemeData(
|
|
backgroundColor: seedColor,
|
|
foregroundColor: foregroundColor,
|
|
),
|
|
);
|
|
}
|
|
} |