mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-18 05:51:34 +02:00
The big one. Touches 760+ files. Locks in the user's decision to break import-line compatibility with upstream cake-tech/cake_wallet in exchange for a binary named hash_wallet on every platform. Changes: - pubspec_description.yaml: project name cake_wallet -> hash_wallet - 762 Dart files: every 'package:cake_wallet/...' import rewritten to 'package:hash_wallet/...' (lib/, cw_*/lib/, tool/, test/, integration_test/) - linux/CMakeLists.txt: BINARY_NAME cake_wallet -> hash_wallet - windows/CMakeLists.txt: project + BINARY_NAME (CakeWallet -> HashWallet) - windows/runner/Runner.rc: company / file / product strings to Hash Wallet + Such Software LLC copyright - macos/Runner.xcodeproj/project_base.pbxproj: cake_wallet_new.app refs -> hash_wallet.app (macOS output bundle name) - com.suchsoftware.HashWallet.yml (Flatpak): all binary path refs cake_wallet -> hash_wallet (e.g. /app/hash_wallet/hash_wallet) - linux/com.suchsoftware.HashWallet.desktop: Exec=hash_wallet - scripts/android/copy_monero_deps.sh: CW_DIR target path - configure_hash_wallet.sh: error message typo (old filename) INTENTIONALLY UNCHANGED: - cw_* subpackage names (cw_core, cw_bitcoin, cw_wownero, etc.) — they remain as the historical 'cake wallet' naming; renaming them would cascade through every sub-package's internal structure - Method channel name 'com.cake_wallet/native_utils' in iOS/macOS/Android AppDelegates and MainActivity — it's a string identifier that has to match the Dart side exactly. Renaming requires both-sides change; it's internal-only and not user-visible. - ghcr.io/cake-tech/cake_wallet:debian13-... docker image references in build scripts — that's Cake Labs' published image we use as the build environment, not ours. User data directory now follows the new binary name: ~/.local/share/hash_wallet/ (was ~/.local/share/cake_wallet/) ~/.config/hash_wallet/ (was ~/.config/cake_wallet/) Existing users on the old name will need migration if any exist.
301 lines
9.3 KiB
Dart
301 lines
9.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:hash_wallet/themes/core/material_base_theme.dart';
|
|
import 'package:hash_wallet/themes/core/custom_theme_colors.dart';
|
|
import 'package:hash_wallet/themes/custom_theme_colors/black_theme_custom_colors.dart';
|
|
|
|
enum BlackThemeAccentColor implements ThemeAccentColor {
|
|
hashGreen(Color(0xFF7FCAA0), 'Hash Green'),
|
|
suchPink(Color(0xFFE16FA6), 'Such Pink'),
|
|
suchBlue(Color(0xFF6AB7E6), 'Such Blue'),
|
|
bchGreen(Color(0xFF44BA52), 'BCH Green'),
|
|
bitcoinYellow(Color(0xFFFFC107), 'Bitcoin Yellow'),
|
|
moneroOrange(Color(0xFFFF6600), 'Monero Orange');
|
|
|
|
const BlackThemeAccentColor(this.color, this.name);
|
|
|
|
@override
|
|
final Color color;
|
|
|
|
@override
|
|
final String name;
|
|
}
|
|
|
|
class BlackTheme extends MaterialThemeBase {
|
|
BlackTheme(this.accentColor, {this.isOled = false});
|
|
|
|
final BlackThemeAccentColor accentColor;
|
|
final bool isOled;
|
|
|
|
@override
|
|
Brightness get brightness => Brightness.dark;
|
|
|
|
@override
|
|
ThemeMode get themeMode => ThemeMode.dark;
|
|
|
|
@override
|
|
Color get primaryColor => accentColor.color;
|
|
|
|
@override
|
|
Color get secondaryColor => const Color(0xFFCCC4CD);
|
|
|
|
@override
|
|
Color get errorColor => const Color(0xFFFFB4AB);
|
|
|
|
@override
|
|
Color get surfaceColor => isOled ? const Color(0xFF000000) : const Color(0xFF131314);
|
|
|
|
@override
|
|
Color get tertiaryColor => const Color(0xFFDEBFC5);
|
|
|
|
@override
|
|
ColorScheme get colorScheme => ColorScheme.dark(
|
|
primary: primaryColor,
|
|
onPrimary: const Color(0xFF352D3C),
|
|
primaryContainer: const Color(0xFF28212F),
|
|
onPrimaryContainer: const Color(0xFFB7ABBE),
|
|
secondary: secondaryColor,
|
|
onSecondary: const Color(0xFF332F36),
|
|
secondaryContainer: const Color(0xFF454148),
|
|
onSecondaryContainer: const Color(0xFFDFD6DF),
|
|
tertiary: tertiaryColor,
|
|
onTertiary: const Color(0xFF3F2B30),
|
|
tertiaryContainer: const Color(0xFF321F24),
|
|
onTertiaryContainer: const Color(0xFFC6A8AE),
|
|
error: errorColor,
|
|
onError: const Color(0xFFB71919),
|
|
errorContainer: const Color(0xFFC53636),
|
|
onErrorContainer: const Color(0xFFFFDAD6),
|
|
surface: surfaceColor,
|
|
surfaceDim: const Color(0xFF000000),
|
|
background: surfaceColor,
|
|
onSurface: const Color(0xFFE6E1E3),
|
|
onSurfaceVariant: const Color(0xFFB4B4B4),
|
|
surfaceContainerLowest: isOled ? const Color(0xFF000000) : const Color(0xFF0F0E0F),
|
|
surfaceContainerLow: Color(0xFF1C1B1C),
|
|
surfaceContainer: Color(0xFF211F20),
|
|
surfaceContainerHigh: Color(0xFF2B292B),
|
|
surfaceContainerHighest: Color(0xFF363435),
|
|
outline: const Color(0xFF958F95),
|
|
outlineVariant: const Color(0xFF2F2D2F),
|
|
);
|
|
|
|
static const String fontFamily = 'Wix Madefor Text';
|
|
|
|
@override
|
|
TextTheme get textTheme => TextTheme(
|
|
displayLarge: TextStyle(
|
|
fontSize: 57,
|
|
fontWeight: FontWeight.w400,
|
|
letterSpacing: -0.25,
|
|
color: colorScheme.onSurface,
|
|
),
|
|
displayMedium: TextStyle(
|
|
fontSize: 45,
|
|
fontWeight: FontWeight.w400,
|
|
letterSpacing: 0,
|
|
color: colorScheme.onSurface,
|
|
),
|
|
displaySmall: TextStyle(
|
|
fontSize: 36,
|
|
fontWeight: FontWeight.w400,
|
|
letterSpacing: 0,
|
|
color: colorScheme.onSurface,
|
|
),
|
|
headlineLarge: TextStyle(
|
|
fontSize: 22,
|
|
fontWeight: FontWeight.w600,
|
|
letterSpacing: 0,
|
|
color: colorScheme.onSurface,
|
|
),
|
|
headlineMedium: TextStyle(
|
|
fontSize: 18,
|
|
fontWeight: FontWeight.w600,
|
|
letterSpacing: 0,
|
|
color: colorScheme.onSurface,
|
|
),
|
|
headlineSmall: TextStyle(
|
|
fontSize: 14,
|
|
fontWeight: FontWeight.w600,
|
|
letterSpacing: 0,
|
|
color: colorScheme.onSurface,
|
|
),
|
|
titleLarge: TextStyle(
|
|
fontSize: 22,
|
|
fontWeight: FontWeight.w500,
|
|
letterSpacing: 0,
|
|
color: colorScheme.onSurface,
|
|
),
|
|
titleMedium: TextStyle(
|
|
fontSize: 16,
|
|
fontWeight: FontWeight.w500,
|
|
letterSpacing: 0.15,
|
|
color: colorScheme.onSurface,
|
|
),
|
|
titleSmall: TextStyle(
|
|
fontSize: 14,
|
|
fontWeight: FontWeight.w500,
|
|
letterSpacing: 0.1,
|
|
color: colorScheme.onSurface,
|
|
),
|
|
bodyLarge: TextStyle(
|
|
fontSize: 16,
|
|
fontWeight: FontWeight.w400,
|
|
letterSpacing: 0.5,
|
|
color: colorScheme.onSurface,
|
|
),
|
|
bodyMedium: TextStyle(
|
|
fontSize: 14,
|
|
fontWeight: FontWeight.w400,
|
|
letterSpacing: 0.25,
|
|
color: colorScheme.onSurface,
|
|
),
|
|
bodySmall: TextStyle(
|
|
fontSize: 12,
|
|
fontWeight: FontWeight.w400,
|
|
letterSpacing: 0.4,
|
|
color: colorScheme.onSurface,
|
|
),
|
|
labelLarge: TextStyle(
|
|
fontSize: 14,
|
|
fontWeight: FontWeight.w500,
|
|
letterSpacing: 0.1,
|
|
color: colorScheme.onSurface,
|
|
),
|
|
labelMedium: TextStyle(
|
|
fontSize: 12,
|
|
fontWeight: FontWeight.w500,
|
|
letterSpacing: 0.5,
|
|
color: colorScheme.onSurface,
|
|
),
|
|
labelSmall: TextStyle(
|
|
fontSize: 10,
|
|
fontWeight: FontWeight.w500,
|
|
letterSpacing: 0.5,
|
|
color: colorScheme.onSurface,
|
|
),
|
|
);
|
|
|
|
@override
|
|
ThemeData get themeData => ThemeData(
|
|
useMaterial3: true,
|
|
fontFamily: fontFamily,
|
|
brightness: brightness,
|
|
colorScheme: colorScheme,
|
|
scaffoldBackgroundColor: surfaceColor,
|
|
canvasColor: surfaceColor,
|
|
cardColor: colorScheme.surface,
|
|
textTheme: textTheme,
|
|
appBarTheme: AppBarTheme(
|
|
backgroundColor: surfaceColor,
|
|
foregroundColor: colorScheme.onSurface,
|
|
elevation: 0,
|
|
),
|
|
cardTheme: CardThemeData(
|
|
color: colorScheme.surface,
|
|
elevation: 1,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(12),
|
|
),
|
|
),
|
|
elevatedButtonTheme: ElevatedButtonThemeData(
|
|
style: ElevatedButton.styleFrom(
|
|
backgroundColor: colorScheme.primary,
|
|
foregroundColor: colorScheme.onPrimary,
|
|
elevation: 0,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(18),
|
|
),
|
|
),
|
|
),
|
|
outlinedButtonTheme: OutlinedButtonThemeData(
|
|
style: OutlinedButton.styleFrom(
|
|
foregroundColor: colorScheme.primary,
|
|
side: BorderSide(color: colorScheme.outline),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(18),
|
|
),
|
|
),
|
|
),
|
|
textButtonTheme: TextButtonThemeData(
|
|
style: TextButton.styleFrom(
|
|
foregroundColor: colorScheme.primary,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(18),
|
|
),
|
|
),
|
|
),
|
|
inputDecorationTheme: InputDecorationTheme(
|
|
filled: true,
|
|
fillColor: colorScheme.surfaceContainer,
|
|
border: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(18),
|
|
borderSide: BorderSide.none,
|
|
),
|
|
enabledBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(18),
|
|
borderSide: BorderSide.none,
|
|
),
|
|
focusedBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(18),
|
|
borderSide: BorderSide(color: colorScheme.primary),
|
|
),
|
|
errorBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(18),
|
|
borderSide: BorderSide(color: colorScheme.error),
|
|
),
|
|
focusedErrorBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(18),
|
|
borderSide: BorderSide(color: colorScheme.error),
|
|
),
|
|
disabledBorder: OutlineInputBorder(
|
|
borderRadius: BorderRadius.circular(18),
|
|
borderSide: BorderSide.none,
|
|
),
|
|
),
|
|
);
|
|
|
|
@override
|
|
String get title => 'Black Theme (${accentColor.name})';
|
|
|
|
@override
|
|
ThemeType get type => ThemeType.dark;
|
|
|
|
@override
|
|
int get raw {
|
|
final baseValue = switch (accentColor) {
|
|
BlackThemeAccentColor.hashGreen => 12,
|
|
BlackThemeAccentColor.bchGreen => 13,
|
|
BlackThemeAccentColor.bitcoinYellow => 14,
|
|
BlackThemeAccentColor.moneroOrange => 15,
|
|
BlackThemeAccentColor.suchPink => 16,
|
|
BlackThemeAccentColor.suchBlue => 17,
|
|
};
|
|
if (!isOled) return baseValue;
|
|
// OLED encodes as 100 + base to avoid collisions
|
|
return 100 + baseValue;
|
|
}
|
|
|
|
@override
|
|
CustomThemeColors get customColors => BlackThemeCustomColors();
|
|
|
|
@override
|
|
String? get themeFamily => 'BlackTheme';
|
|
|
|
@override
|
|
String? get accentColorId => accentColor.name.toLowerCase();
|
|
|
|
@override
|
|
String? get accentColorName => accentColor.name;
|
|
|
|
@override
|
|
bool operator ==(Object other) =>
|
|
identical(this, other) ||
|
|
other is BlackTheme &&
|
|
runtimeType == other.runtimeType &&
|
|
accentColor == other.accentColor &&
|
|
isOled == other.isOled;
|
|
|
|
@override
|
|
int get hashCode => Object.hash(accentColor, isOled);
|
|
}
|