From a88ccf31b59541faea8c38c638737c1359cfff47 Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Sat, 27 May 2023 13:14:45 -0600 Subject: Se implementan colores dinámicos (Android 13) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/settings/themes.dart | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'lib/settings/themes.dart') diff --git a/lib/settings/themes.dart b/lib/settings/themes.dart index cc506a9..b9a09d7 100644 --- a/lib/settings/themes.dart +++ b/lib/settings/themes.dart @@ -1,18 +1,20 @@ import 'package:flutter/material.dart'; +enum ThemeEnum { light, dark, auto } + class ThemeSettings { - static ThemeData lightTheme = ThemeData( - useMaterial3: true, - primaryColor: Colors.purple, - fontFamily: 'Manrope', - ); + static ThemeData lightTheme(ColorScheme? lightDynamic) => ThemeData( + useMaterial3: true, + primaryColor: Colors.purple, + fontFamily: 'Manrope', + colorScheme: lightDynamic, + ); - static ThemeData darkTheme = ThemeData( - useMaterial3: true, - brightness: Brightness.dark, - fontFamily: 'Manrope', - colorScheme: const ColorScheme.dark().copyWith( - primary: Colors.purple, - ), - ); + static ThemeData darkTheme(ColorScheme? darkDynamic) => ThemeData( + useMaterial3: true, + brightness: Brightness.dark, + fontFamily: 'Manrope', + primaryColor: Colors.purple, + colorScheme: (darkDynamic ?? const ColorScheme.dark()), + ); } -- cgit v1.2.3