Files
notas/lib/theme/app_theme.dart
T

26 lines
816 B
Dart

import 'package:flutter/material.dart';
import 'package:notas/theme/app_colors.dart';
class AppTheme {
static ThemeData theme({Color seedColor = AppColors.defaultThemeSeedColor}) {
final Brightness foregroundBrightness =
ThemeData.estimateBrightnessForColor(seedColor);
final Color foregroundColor = foregroundBrightness == Brightness.dark
? AppColors.textPrimary
: AppColors.textOnAccent;
return ThemeData(
useMaterial3: true,
scaffoldBackgroundColor: AppColors.scaffoldBackground,
colorScheme: ColorScheme.fromSeed(
seedColor: seedColor,
brightness: Brightness.dark,
),
floatingActionButtonTheme: FloatingActionButtonThemeData(
backgroundColor: seedColor,
foregroundColor: foregroundColor,
),
);
}
}