2023-07-03 18:48:27 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/address_theme.dart';
|
2023-07-03 18:36:17 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
|
2023-07-03 12:43:33 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/cake_scrollbar_theme.dart';
|
2023-07-03 18:15:58 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
|
2023-07-03 17:56:29 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
|
2023-07-03 16:29:44 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/keyboard_theme.dart';
|
2023-07-03 18:26:44 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart';
|
2023-07-03 16:38:39 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/pin_code_theme.dart';
|
2023-07-03 16:58:02 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/support_page_theme.dart';
|
2023-07-03 12:48:09 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/sync_indicator_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;
|
2023-07-03 12:37:29 +00:00
|
|
|
Color get dialogBackgroundColor;
|
2023-06-30 16:55:22 +00:00
|
|
|
|
|
|
|
ColorScheme get colorScheme => ColorScheme.fromSeed(
|
|
|
|
brightness: brightness,
|
|
|
|
seedColor: primaryColor,
|
|
|
|
background: backgroundColor);
|
|
|
|
|
2023-07-03 12:43:33 +00:00
|
|
|
ThemeData get generatedThemeData => ThemeData.from(
|
|
|
|
colorScheme: colorScheme,
|
|
|
|
textTheme: TextTheme().apply(fontFamily: 'Lato'));
|
|
|
|
|
2023-07-03 18:15:58 +00:00
|
|
|
DashboardPageTheme get pageGradientTheme => DashboardPageTheme(
|
|
|
|
firstGradientBackgroundColor: backgroundColor,
|
|
|
|
secondGradientBackgroundColor: backgroundColor,
|
|
|
|
thirdGradientBackgroundColor: backgroundColor,
|
|
|
|
textColor: primaryTextColor);
|
2023-07-03 12:26:43 +00:00
|
|
|
|
2023-07-03 12:43:33 +00:00
|
|
|
CakeScrollbarTheme get scrollbarTheme;
|
|
|
|
|
2023-07-03 12:48:09 +00:00
|
|
|
SyncIndicatorTheme get syncIndicatorStyle;
|
|
|
|
|
2023-07-03 16:29:44 +00:00
|
|
|
KeyboardTheme get keyboardTheme;
|
|
|
|
|
2023-07-03 16:38:39 +00:00
|
|
|
PinCodeTheme get pinCodeTheme;
|
|
|
|
|
2023-07-03 16:58:02 +00:00
|
|
|
SupportPageTheme get supportPageTheme;
|
|
|
|
|
2023-07-03 17:56:29 +00:00
|
|
|
ExchangePageTheme get exchangePageTheme;
|
|
|
|
|
2023-07-03 18:26:44 +00:00
|
|
|
NewWalletTheme get newWalletTheme;
|
|
|
|
|
2023-07-03 18:36:17 +00:00
|
|
|
BalancePageTheme get balancePageTheme;
|
|
|
|
|
2023-07-03 18:48:27 +00:00
|
|
|
AddressTheme get addressTheme;
|
|
|
|
|
2023-07-03 12:43:33 +00:00
|
|
|
ThemeData get themeData => generatedThemeData.copyWith(
|
|
|
|
primaryColor: primaryColor,
|
|
|
|
cardColor: containerColor,
|
|
|
|
dialogBackgroundColor: dialogBackgroundColor,
|
2023-07-03 12:48:09 +00:00
|
|
|
extensions: [
|
|
|
|
pageGradientTheme,
|
|
|
|
scrollbarTheme,
|
2023-07-03 16:29:44 +00:00
|
|
|
syncIndicatorStyle,
|
|
|
|
keyboardTheme,
|
2023-07-03 16:38:39 +00:00
|
|
|
pinCodeTheme,
|
2023-07-03 16:58:02 +00:00
|
|
|
supportPageTheme,
|
2023-07-03 17:56:29 +00:00
|
|
|
exchangePageTheme,
|
2023-07-03 18:26:44 +00:00
|
|
|
newWalletTheme,
|
2023-07-03 18:36:17 +00:00
|
|
|
balancePageTheme,
|
2023-07-03 18:48:27 +00:00
|
|
|
addressTheme,
|
2023-07-03 12:48:09 +00:00
|
|
|
],
|
2023-07-03 12:43:33 +00:00
|
|
|
scrollbarTheme: ScrollbarThemeData(
|
|
|
|
thumbColor: MaterialStateProperty.all(scrollbarTheme.thumbColor),
|
|
|
|
trackColor: MaterialStateProperty.all(scrollbarTheme.trackColor),
|
|
|
|
radius: Radius.circular(3),
|
|
|
|
thickness: MaterialStateProperty.all(6),
|
|
|
|
thumbVisibility: MaterialStateProperty.all(true),
|
|
|
|
crossAxisMargin: 6));
|
2023-07-03 16:29:44 +00:00
|
|
|
}
|