2023-07-03 12:26:43 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/dashboard_gradient_theme.dart';
|
2020-12-15 19:30:16 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
2023-06-30 16:55:22 +00:00
|
|
|
enum ThemeType { light, bright, dark }
|
2020-12-15 19:30:16 +00:00
|
|
|
|
|
|
|
abstract class ThemeBase {
|
2022-10-12 17:09:57 +00:00
|
|
|
ThemeBase({required this.raw});
|
2020-12-15 19:30:16 +00:00
|
|
|
|
|
|
|
final int raw;
|
|
|
|
String get title;
|
|
|
|
ThemeType get type;
|
|
|
|
|
|
|
|
@override
|
|
|
|
String toString() {
|
|
|
|
return title;
|
|
|
|
}
|
2023-06-30 16:55:22 +00:00
|
|
|
|
|
|
|
Brightness get brightness;
|
|
|
|
Color get backgroundColor;
|
|
|
|
Color get primaryColor;
|
|
|
|
Color get primaryTextColor;
|
|
|
|
Color get containerColor;
|
|
|
|
|
|
|
|
ColorScheme get colorScheme => ColorScheme.fromSeed(
|
|
|
|
brightness: brightness,
|
|
|
|
seedColor: primaryColor,
|
|
|
|
background: backgroundColor);
|
|
|
|
|
2023-07-03 12:26:43 +00:00
|
|
|
DashboardGradientTheme get pageGradientTheme => DashboardGradientTheme(
|
|
|
|
firstGradientColor: backgroundColor,
|
|
|
|
secondGradientColor: backgroundColor,
|
|
|
|
thirdGradientColor: backgroundColor);
|
|
|
|
|
2023-06-30 16:55:22 +00:00
|
|
|
ThemeData get themeData => ThemeData.from(
|
|
|
|
colorScheme: colorScheme,
|
|
|
|
textTheme: TextTheme().apply(fontFamily: 'Lato'))
|
|
|
|
.copyWith(
|
|
|
|
primaryColor: primaryColor,
|
2023-07-03 12:26:43 +00:00
|
|
|
cardColor: containerColor,
|
|
|
|
extensions: [pageGradientTheme]);
|
2020-12-15 19:30:16 +00:00
|
|
|
}
|