diff --git a/assets/svg/oled-black-theme.svg b/assets/svg/oled-black-theme.svg new file mode 100644 index 000000000..27cd50638 --- /dev/null +++ b/assets/svg/oled-black-theme.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/svg/oled-black.svg b/assets/svg/oled-black.svg new file mode 100644 index 000000000..98b67ae6c --- /dev/null +++ b/assets/svg/oled-black.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/assets/svg/oledBlack/bell-new.svg b/assets/svg/oledBlack/bell-new.svg new file mode 100644 index 000000000..f976e0986 --- /dev/null +++ b/assets/svg/oledBlack/bell-new.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/svg/oledBlack/buy-coins-icon.svg b/assets/svg/oledBlack/buy-coins-icon.svg new file mode 100644 index 000000000..9170c4190 --- /dev/null +++ b/assets/svg/oledBlack/buy-coins-icon.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/assets/svg/oledBlack/exchange-2.svg b/assets/svg/oledBlack/exchange-2.svg new file mode 100644 index 000000000..ee04dcebe --- /dev/null +++ b/assets/svg/oledBlack/exchange-2.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/assets/svg/oledBlack/stack-icon1.svg b/assets/svg/oledBlack/stack-icon1.svg new file mode 100644 index 000000000..4fb16176a --- /dev/null +++ b/assets/svg/oledBlack/stack-icon1.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/svg/oledBlack/tx-exchange-icon-failed.svg b/assets/svg/oledBlack/tx-exchange-icon-failed.svg new file mode 100644 index 000000000..64acda4e9 --- /dev/null +++ b/assets/svg/oledBlack/tx-exchange-icon-failed.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/assets/svg/oledBlack/tx-exchange-icon-pending.svg b/assets/svg/oledBlack/tx-exchange-icon-pending.svg new file mode 100644 index 000000000..f9cdeb7c2 --- /dev/null +++ b/assets/svg/oledBlack/tx-exchange-icon-pending.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/assets/svg/oledBlack/tx-exchange-icon.svg b/assets/svg/oledBlack/tx-exchange-icon.svg new file mode 100644 index 000000000..36b2cf7cc --- /dev/null +++ b/assets/svg/oledBlack/tx-exchange-icon.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/assets/svg/oledBlack/tx-icon-receive-failed.svg b/assets/svg/oledBlack/tx-icon-receive-failed.svg new file mode 100644 index 000000000..cb1d500b1 --- /dev/null +++ b/assets/svg/oledBlack/tx-icon-receive-failed.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/assets/svg/oledBlack/tx-icon-receive-pending.svg b/assets/svg/oledBlack/tx-icon-receive-pending.svg new file mode 100644 index 000000000..efb8350b3 --- /dev/null +++ b/assets/svg/oledBlack/tx-icon-receive-pending.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/assets/svg/oledBlack/tx-icon-receive.svg b/assets/svg/oledBlack/tx-icon-receive.svg new file mode 100644 index 000000000..15be19d52 --- /dev/null +++ b/assets/svg/oledBlack/tx-icon-receive.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/assets/svg/oledBlack/tx-icon-send-failed.svg b/assets/svg/oledBlack/tx-icon-send-failed.svg new file mode 100644 index 000000000..2be637ef3 --- /dev/null +++ b/assets/svg/oledBlack/tx-icon-send-failed.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/assets/svg/oledBlack/tx-icon-send-pending.svg b/assets/svg/oledBlack/tx-icon-send-pending.svg new file mode 100644 index 000000000..50cca5a9e --- /dev/null +++ b/assets/svg/oledBlack/tx-icon-send-pending.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/assets/svg/oledBlack/tx-icon-send.svg b/assets/svg/oledBlack/tx-icon-send.svg new file mode 100644 index 000000000..0e64ee37e --- /dev/null +++ b/assets/svg/oledBlack/tx-icon-send.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 2e5d4bac0..c935c514e 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -456,7 +456,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 83; + CURRENT_PROJECT_VERSION = 102; DEVELOPMENT_TEAM = 4DQKUWSG6C; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -510,7 +510,7 @@ "$(PROJECT_DIR)/../crypto_plugins/flutter_libmonero/cw_shared_external/ios/External/ios/**", "$(PROJECT_DIR)/../crypto_plugins/flutter_libepiccash/ios/libs", ); - MARKETING_VERSION = 1.5.11; + MARKETING_VERSION = 1.5.28; ONLY_ACTIVE_ARCH = NO; PRODUCT_BUNDLE_IDENTIFIER = com.cypherstack.stackwallet; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -643,7 +643,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 83; + CURRENT_PROJECT_VERSION = 102; DEVELOPMENT_TEAM = 4DQKUWSG6C; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -697,7 +697,7 @@ "$(PROJECT_DIR)/../crypto_plugins/flutter_libmonero/cw_shared_external/ios/External/ios/**", "$(PROJECT_DIR)/../crypto_plugins/flutter_libepiccash/ios/libs", ); - MARKETING_VERSION = 1.5.11; + MARKETING_VERSION = 1.5.28; ONLY_ACTIVE_ARCH = NO; PRODUCT_BUNDLE_IDENTIFIER = com.cypherstack.stackwallet; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -722,7 +722,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 83; + CURRENT_PROJECT_VERSION = 102; DEVELOPMENT_TEAM = 4DQKUWSG6C; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -776,7 +776,7 @@ "$(PROJECT_DIR)/../crypto_plugins/flutter_libmonero/cw_shared_external/ios/External/ios/**", "$(PROJECT_DIR)/../crypto_plugins/flutter_libepiccash/ios/libs", ); - MARKETING_VERSION = 1.5.11; + MARKETING_VERSION = 1.5.28; ONLY_ACTIVE_ARCH = NO; PRODUCT_BUNDLE_IDENTIFIER = com.cypherstack.stackwallet; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/lib/db/main_db.dart b/lib/db/main_db.dart index be937b411..413951e37 100644 --- a/lib/db/main_db.dart +++ b/lib/db/main_db.dart @@ -12,7 +12,7 @@ class MainDB { Isar get isar => _isar!; - Future isarInit({Isar? mock}) async { + Future initMainDB({Isar? mock}) async { if (mock != null) { _isar = mock; return true; @@ -28,7 +28,7 @@ class MainDB { AddressSchema, ], directory: (await StackFileSystem.applicationIsarDirectory()).path, - inspector: true, + inspector: false, name: "wallet_data", ); return true; diff --git a/lib/main.dart b/lib/main.dart index 6292c39ef..ba6757259 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -59,6 +59,7 @@ import 'package:stackwallet/utilities/theme/color_theme.dart'; import 'package:stackwallet/utilities/theme/dark_colors.dart'; import 'package:stackwallet/utilities/theme/light_colors.dart'; import 'package:stackwallet/utilities/theme/ocean_breeze_colors.dart'; +import 'package:stackwallet/utilities/theme/oled_black_colors.dart'; import 'package:stackwallet/utilities/theme/stack_colors.dart'; import 'package:stackwallet/utilities/util.dart'; import 'package:window_size/window_size.dart'; @@ -77,7 +78,6 @@ void main() async { if (Platform.isIOS) { Util.libraryPath = await getLibraryDirectory(); } - Screen? screen; if (Platform.isLinux || (Util.isDesktop && !Platform.isIOS)) { screen = await getCurrentScreen(); @@ -265,7 +265,7 @@ class _MaterialAppWithThemeState extends ConsumerState await loadShared(); } - await MainDB.instance.isarInit(); + await MainDB.instance.initMainDB(); _notificationsService = ref.read(notificationsProvider); _nodeService = ref.read(nodeServiceChangeNotifierProvider); @@ -327,6 +327,9 @@ class _MaterialAppWithThemeState extends ConsumerState case "dark": colorTheme = DarkColors(); break; + case "oledBlack": + colorTheme = OledBlackColors(); + break; case "oceanBreeze": colorTheme = OceanBreezeColors(); break; diff --git a/lib/models/paymint/transactions_model.dart b/lib/models/paymint/transactions_model.dart index 6eba877c4..1d40ac01c 100644 --- a/lib/models/paymint/transactions_model.dart +++ b/lib/models/paymint/transactions_model.dart @@ -362,12 +362,16 @@ class Input { class Output { // @HiveField(0) final String? scriptpubkey; + // @HiveField(1) final String? scriptpubkeyAsm; + // @HiveField(2) final String? scriptpubkeyType; + // @HiveField(3) final String scriptpubkeyAddress; + // @HiveField(4) final int value; @@ -381,9 +385,6 @@ class Output { factory Output.fromJson(Map json) { // TODO determine if any of this code is needed. try { - // Particl has different tx types that need to be detected and handled here - // if (json.containsKey('scriptPubKey') as bool) { - // output is transparent final address = json["scriptPubKey"]["addresses"] == null ? json['scriptPubKey']['type'] as String : json["scriptPubKey"]["addresses"][0] as String; @@ -392,35 +393,13 @@ class Output { scriptpubkeyAsm: json['scriptPubKey']['asm'] as String?, scriptpubkeyType: json['scriptPubKey']['type'] as String?, scriptpubkeyAddress: address, - value: (Decimal.parse(json["value"].toString()) * + value: (Decimal.parse( + (json["value"] ?? 0).toString()) * Decimal.fromInt(Constants.satsPerCoin(Coin .firo))) // dirty hack but we need 8 decimal places here to keep consistent data structure .toBigInt() .toInt(), ); - // } /* else if (json.containsKey('ct_fee') as bool) { - // // or type: data - // // output is blinded (CT) - // } else if (json.containsKey('rangeproof') as bool) { - // // or valueCommitment or type: anon - // // output is private (RingCT) - // } */ - // else { - // // TODO detect staking - // // TODO handle CT, RingCT, and staking accordingly - // // print("transaction not supported: ${json}"); - // return Output( - // // Return output object with null values; allows wallet history to be built - // scriptpubkey: "", - // scriptpubkeyAsm: "", - // scriptpubkeyType: "", - // scriptpubkeyAddress: "", - // value: (Decimal.parse(0.toString()) * - // Decimal.fromInt(Constants.satsPerCoin(Coin - // .firo))) // dirty hack but we need 8 decimal places here to keep consistent data structure - // .toBigInt() - // .toInt()); - // } } catch (s, e) { return Output( // Return output object with null values; allows wallet history to be built diff --git a/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart b/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart index bb2628192..44a00083f 100644 --- a/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart +++ b/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart @@ -373,17 +373,22 @@ class _RestoreWalletViewState extends ConsumerState { FormInputStatus status, String prefix) { Color color; Color prefixColor; + Color borderColor; Widget? suffixIcon; switch (status) { case FormInputStatus.empty: color = Theme.of(context).extension()!.textFieldDefaultBG; prefixColor = Theme.of(context).extension()!.textSubtitle2; + borderColor = + Theme.of(context).extension()!.textFieldDefaultBG; break; case FormInputStatus.invalid: color = Theme.of(context).extension()!.textFieldErrorBG; prefixColor = Theme.of(context) .extension()! .textFieldErrorSearchIconLeft; + borderColor = + Theme.of(context).extension()!.textFieldErrorBorder; suffixIcon = SvgPicture.asset( Assets.svg.alertCircle, width: 16, @@ -398,6 +403,8 @@ class _RestoreWalletViewState extends ConsumerState { prefixColor = Theme.of(context) .extension()! .textFieldSuccessSearchIconLeft; + borderColor = + Theme.of(context).extension()!.textFieldSuccessBorder; suffixIcon = SvgPicture.asset( Assets.svg.checkCircle, width: 16, @@ -449,11 +456,11 @@ class _RestoreWalletViewState extends ConsumerState { child: suffixIcon, ), ), - enabledBorder: _buildOutlineInputBorder(color), - focusedBorder: _buildOutlineInputBorder(color), - errorBorder: _buildOutlineInputBorder(color), - disabledBorder: _buildOutlineInputBorder(color), - focusedErrorBorder: _buildOutlineInputBorder(color), + enabledBorder: _buildOutlineInputBorder(borderColor), + focusedBorder: _buildOutlineInputBorder(borderColor), + errorBorder: _buildOutlineInputBorder(borderColor), + disabledBorder: _buildOutlineInputBorder(borderColor), + focusedErrorBorder: _buildOutlineInputBorder(borderColor), ); } @@ -786,7 +793,7 @@ class _RestoreWalletViewState extends ConsumerState { .copyWith( color: Theme.of(context) .extension()! - .overlay, + .textRestore, fontSize: isDesktop ? 16 : 14, ), ), @@ -993,7 +1000,7 @@ class _RestoreWalletViewState extends ConsumerState { STextStyles.field(context).copyWith( color: Theme.of(context) .extension()! - .overlay, + .textRestore, fontSize: isDesktop ? 16 : 14, ), ), diff --git a/lib/pages/exchange_view/exchange_form.dart b/lib/pages/exchange_view/exchange_form.dart index 032afacdb..0366b8da3 100644 --- a/lib/pages/exchange_view/exchange_form.dart +++ b/lib/pages/exchange_view/exchange_form.dart @@ -248,6 +248,29 @@ class _ExchangeFormState extends ConsumerState { fromTicker: ref.read(exchangeFormStateProvider).fromTicker ?? "", onSelected: (to) => ref.read(exchangeFormStateProvider).updateTo(to, true)); + + unawaited( + showDialog( + context: context, + barrierDismissible: false, + builder: (_) => WillPopScope( + onWillPop: () async => false, + child: Container( + color: Theme.of(context) + .extension()! + .overlay + .withOpacity(0.6), + child: const CustomLoadingOverlay( + message: "Updating exchange rate", + eventBus: null, + ), + ), + ), + ), + ); + + await Future.delayed(const Duration(milliseconds: 300)); + Navigator.of(context).pop(); } else { final fromTicker = ref.read(exchangeFormStateProvider).fromTicker ?? ""; final toTicker = ref.read(exchangeFormStateProvider).toTicker ?? ""; diff --git a/lib/pages/settings_views/global_settings_view/appearance_settings_view.dart b/lib/pages/settings_views/global_settings_view/appearance_settings_view.dart index 693f39f02..73da50719 100644 --- a/lib/pages/settings_views/global_settings_view/appearance_settings_view.dart +++ b/lib/pages/settings_views/global_settings_view/appearance_settings_view.dart @@ -9,6 +9,7 @@ import 'package:stackwallet/utilities/theme/color_theme.dart'; import 'package:stackwallet/utilities/theme/dark_colors.dart'; import 'package:stackwallet/utilities/theme/light_colors.dart'; import 'package:stackwallet/utilities/theme/ocean_breeze_colors.dart'; +import 'package:stackwallet/utilities/theme/oled_black_colors.dart'; import 'package:stackwallet/utilities/theme/stack_colors.dart'; import 'package:stackwallet/widgets/background.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; @@ -28,6 +29,8 @@ class AppearanceSettingsView extends ConsumerWidget { return "Ocean theme"; case ThemeType.dark: return "Dark theme"; + case ThemeType.oledBlack: + return "Oled Black theme"; } } @@ -430,6 +433,87 @@ class _ThemeOptionsView extends ConsumerState { ), ), ), + const SizedBox( + height: 10, + ), + MaterialButton( + splashColor: Colors.transparent, + hoverColor: Colors.transparent, + padding: const EdgeInsets.all(0), + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular( + Constants.size.circularBorderRadius, + ), + ), + onPressed: () { + DB.instance.put( + boxName: DB.boxNameTheme, + key: "colorScheme", + value: ThemeType.oledBlack.name, + ); + ref.read(colorThemeProvider.state).state = + StackColors.fromStackColorTheme( + OledBlackColors(), + ); + + setState(() { + _selectedTheme = "oledBlack"; + }); + }, + child: SizedBox( + width: 200, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Row( + children: [ + SizedBox( + width: 10, + height: 10, + child: Radio( + activeColor: Theme.of(context) + .extension()! + .radioButtonIconEnabled, + value: "oledBlack", + groupValue: _selectedTheme, + onChanged: (newValue) { + if (newValue is String && newValue == "oledBlack") { + DB.instance.put( + boxName: DB.boxNameTheme, + key: "colorScheme", + value: ThemeType.oledBlack.name, + ); + ref.read(colorThemeProvider.state).state = + StackColors.fromStackColorTheme( + OledBlackColors(), + ); + + setState(() { + _selectedTheme = "oledBlack"; + }); + } + }, + ), + ), + const SizedBox( + width: 14, + ), + Text( + "OLED Black", + style: + STextStyles.desktopTextExtraSmall(context).copyWith( + color: Theme.of(context) + .extension()! + .textDark2, + ), + ), + ], + ), + ], + ), + ), + ), ], ); } diff --git a/lib/pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart b/lib/pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart index e29b0888f..70e208ed5 100644 --- a/lib/pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart +++ b/lib/pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart @@ -328,6 +328,7 @@ class _AddEditNodeViewState extends ConsumerState { enabled: true, coinName: coin.name, isFailover: formData.isFailover!, + trusted: formData.trusted!, isDown: false, ); @@ -352,6 +353,7 @@ class _AddEditNodeViewState extends ConsumerState { enabled: true, coinName: coin.name, isFailover: formData.isFailover!, + trusted: formData.trusted!, isDown: false, ); @@ -621,11 +623,11 @@ class _AddEditNodeViewState extends ConsumerState { class NodeFormData { String? name, host, login, password; int? port; - bool? useSSL, isFailover; + bool? useSSL, isFailover, trusted; @override String toString() { - return "{ name: $name, host: $host, port: $port, useSSL: $useSSL }"; + return "{ name: $name, host: $host, port: $port, useSSL: $useSSL, trusted: $trusted }"; } } @@ -666,6 +668,7 @@ class _NodeFormState extends ConsumerState { bool _useSSL = false; bool _isFailover = false; + bool _trusted = false; int? port; late bool enableSSLCheckbox; @@ -718,6 +721,9 @@ class _NodeFormState extends ConsumerState { return enable; } + bool get shouldBeReadOnly => + widget.readOnly || widget.node?.isDefault == true; + void _updateState() { port = int.tryParse(_portController.text); onChanged?.call(canSave, canTestConnection); @@ -733,6 +739,7 @@ class _NodeFormState extends ConsumerState { ref.read(nodeFormDataProvider).port = port; ref.read(nodeFormDataProvider).useSSL = _useSSL; ref.read(nodeFormDataProvider).isFailover = _isFailover; + ref.read(nodeFormDataProvider).trusted = _trusted; } @override @@ -764,12 +771,12 @@ class _NodeFormState extends ConsumerState { _usernameController.text = node.loginName ?? ""; _useSSL = node.useSSL; _isFailover = node.isFailover; + _trusted = node.trusted ?? false; if (widget.coin == Coin.epicCash) { enableSSLCheckbox = !node.host.startsWith("http"); } else { enableSSLCheckbox = true; } - print("enableSSLCheckbox: $enableSSLCheckbox"); WidgetsBinding.instance.addPostFrameCallback((_) { // update provider state object so test connection works without having to modify a field in the ui first @@ -812,7 +819,7 @@ class _NodeFormState extends ConsumerState { autocorrect: Util.isDesktop ? false : true, enableSuggestions: Util.isDesktop ? false : true, key: const Key("addCustomNodeNodeNameFieldKey"), - readOnly: widget.readOnly, + readOnly: shouldBeReadOnly, enabled: enableField(_nameController), controller: _nameController, focusNode: _nameFocusNode, @@ -822,7 +829,7 @@ class _NodeFormState extends ConsumerState { _nameFocusNode, context, ).copyWith( - suffixIcon: !widget.readOnly && _nameController.text.isNotEmpty + suffixIcon: !shouldBeReadOnly && _nameController.text.isNotEmpty ? Padding( padding: const EdgeInsets.only(right: 0), child: UnconstrainedBox( @@ -858,7 +865,7 @@ class _NodeFormState extends ConsumerState { autocorrect: Util.isDesktop ? false : true, enableSuggestions: Util.isDesktop ? false : true, key: const Key("addCustomNodeNodeAddressFieldKey"), - readOnly: widget.readOnly, + readOnly: shouldBeReadOnly, enabled: enableField(_hostController), controller: _hostController, focusNode: _hostFocusNode, @@ -870,7 +877,7 @@ class _NodeFormState extends ConsumerState { _hostFocusNode, context, ).copyWith( - suffixIcon: !widget.readOnly && _hostController.text.isNotEmpty + suffixIcon: !shouldBeReadOnly && _hostController.text.isNotEmpty ? Padding( padding: const EdgeInsets.only(right: 0), child: UnconstrainedBox( @@ -917,7 +924,7 @@ class _NodeFormState extends ConsumerState { autocorrect: Util.isDesktop ? false : true, enableSuggestions: Util.isDesktop ? false : true, key: const Key("addCustomNodeNodePortFieldKey"), - readOnly: widget.readOnly, + readOnly: shouldBeReadOnly, enabled: enableField(_portController), controller: _portController, focusNode: _portFocusNode, @@ -929,7 +936,7 @@ class _NodeFormState extends ConsumerState { _portFocusNode, context, ).copyWith( - suffixIcon: !widget.readOnly && _portController.text.isNotEmpty + suffixIcon: !shouldBeReadOnly && _portController.text.isNotEmpty ? Padding( padding: const EdgeInsets.only(right: 0), child: UnconstrainedBox( @@ -966,7 +973,7 @@ class _NodeFormState extends ConsumerState { autocorrect: Util.isDesktop ? false : true, enableSuggestions: Util.isDesktop ? false : true, controller: _usernameController, - readOnly: widget.readOnly, + readOnly: shouldBeReadOnly, enabled: enableField(_usernameController), keyboardType: TextInputType.number, focusNode: _usernameFocusNode, @@ -977,7 +984,7 @@ class _NodeFormState extends ConsumerState { context, ).copyWith( suffixIcon: - !widget.readOnly && _usernameController.text.isNotEmpty + !shouldBeReadOnly && _usernameController.text.isNotEmpty ? Padding( padding: const EdgeInsets.only(right: 0), child: UnconstrainedBox( @@ -1015,7 +1022,7 @@ class _NodeFormState extends ConsumerState { autocorrect: Util.isDesktop ? false : true, enableSuggestions: Util.isDesktop ? false : true, controller: _passwordController, - readOnly: widget.readOnly, + readOnly: shouldBeReadOnly, enabled: enableField(_passwordController), keyboardType: TextInputType.number, focusNode: _passwordFocusNode, @@ -1026,7 +1033,7 @@ class _NodeFormState extends ConsumerState { context, ).copyWith( suffixIcon: - !widget.readOnly && _passwordController.text.isNotEmpty + !shouldBeReadOnly && _passwordController.text.isNotEmpty ? Padding( padding: const EdgeInsets.only(right: 0), child: UnconstrainedBox( @@ -1059,7 +1066,7 @@ class _NodeFormState extends ConsumerState { Row( children: [ GestureDetector( - onTap: !widget.readOnly && enableSSLCheckbox + onTap: !shouldBeReadOnly && enableSSLCheckbox ? () { setState(() { _useSSL = !_useSSL; @@ -1075,7 +1082,7 @@ class _NodeFormState extends ConsumerState { width: 20, height: 20, child: Checkbox( - fillColor: !widget.readOnly && enableSSLCheckbox + fillColor: !shouldBeReadOnly && enableSSLCheckbox ? null : MaterialStateProperty.all(Theme.of(context) .extension()! @@ -1083,7 +1090,7 @@ class _NodeFormState extends ConsumerState { materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, value: _useSSL, - onChanged: !widget.readOnly && enableSSLCheckbox + onChanged: !shouldBeReadOnly && enableSSLCheckbox ? (newValue) { setState(() { _useSSL = newValue!; @@ -1106,6 +1113,57 @@ class _NodeFormState extends ConsumerState { ), ], ), + if (widget.coin == Coin.monero || widget.coin == Coin.wownero) + Row( + children: [ + GestureDetector( + onTap: !widget.readOnly /*&& trustedCheckbox*/ + ? () { + setState(() { + _trusted = !_trusted; + }); + _updateState(); + } + : null, + child: Container( + color: Colors.transparent, + child: Row( + children: [ + SizedBox( + width: 20, + height: 20, + child: Checkbox( + fillColor: !widget.readOnly + ? null + : MaterialStateProperty.all(Theme.of(context) + .extension()! + .checkboxBGDisabled), + materialTapTargetSize: + MaterialTapTargetSize.shrinkWrap, + value: _trusted, + onChanged: !widget.readOnly + ? (newValue) { + setState(() { + _trusted = newValue!; + }); + _updateState(); + } + : null, + ), + ), + const SizedBox( + width: 12, + ), + Text( + "Trusted", + style: STextStyles.itemSubtitle12(context), + ) + ], + ), + ), + ), + ], + ), if (widget.coin != Coin.monero && widget.coin != Coin.wownero && widget.coin != Coin.epicCash) diff --git a/lib/pages/settings_views/global_settings_view/manage_nodes_views/node_details_view.dart b/lib/pages/settings_views/global_settings_view/manage_nodes_views/node_details_view.dart index ad8ad7301..1816e9886 100644 --- a/lib/pages/settings_views/global_settings_view/manage_nodes_views/node_details_view.dart +++ b/lib/pages/settings_views/global_settings_view/manage_nodes_views/node_details_view.dart @@ -70,15 +70,13 @@ class _NodeDetailsViewState extends ConsumerState { switch (coin) { case Coin.epicCash: try { - - testPassed = await testEpicNodeConnection( - NodeFormData() - ..host = node!.host - ..useSSL = node.useSSL - ..port = node.port, - ) != - null; - + testPassed = await testEpicNodeConnection( + NodeFormData() + ..host = node!.host + ..useSSL = node.useSSL + ..port = node.port, + ) != + null; } catch (e, s) { Logging.instance.log("$e\n$s", level: LogLevel.Warning); testPassed = false; @@ -388,6 +386,7 @@ class _NodeDetailsViewState extends ConsumerState { port: ref.read(nodeFormDataProvider).port, name: ref.read(nodeFormDataProvider).name, useSSL: ref.read(nodeFormDataProvider).useSSL, + trusted: ref.read(nodeFormDataProvider).trusted, loginName: ref.read(nodeFormDataProvider).login, isFailover: ref.read(nodeFormDataProvider).isFailover, diff --git a/lib/pages_desktop_specific/settings/settings_menu/appearance_settings.dart b/lib/pages_desktop_specific/settings/settings_menu/appearance_settings.dart index 8486e64f6..f1bb52244 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/appearance_settings.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/appearance_settings.dart @@ -35,106 +35,110 @@ class _AppearanceOptionSettings ), child: RoundedWhiteContainer( radiusMultiplier: 2, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + child: Wrap( children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: SvgPicture.asset( - Assets.svg.circleSun, - width: 48, - height: 48, - ), - ), Column( - crossAxisAlignment: CrossAxisAlignment.stretch, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( - padding: const EdgeInsets.all(10), - child: RichText( - textAlign: TextAlign.left, - text: TextSpan( - children: [ - TextSpan( - text: "Appearances", - style: STextStyles.desktopTextSmall(context), - ), - TextSpan( - text: - "\n\nCustomize how your Stack Wallet looks according to your preferences.", - style: STextStyles.desktopTextExtraExtraSmall( - context), - ), - ], - ), + padding: const EdgeInsets.all(8.0), + child: SvgPicture.asset( + Assets.svg.circleSun, + width: 48, + height: 48, ), ), - ], - ), - const Padding( - padding: EdgeInsets.all(10.0), - child: Divider( - thickness: 0.5, - ), - ), - Padding( - padding: const EdgeInsets.all(10.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - "Display favorite wallets", - style: STextStyles.desktopTextExtraSmall(context) - .copyWith( - color: Theme.of(context) - .extension()! - .textDark), - textAlign: TextAlign.left, - ), - SizedBox( - height: 20, - width: 40, - child: DraggableSwitchButton( - isOn: ref.watch( - prefsChangeNotifierProvider - .select((value) => value.showFavoriteWallets), + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Padding( + padding: const EdgeInsets.all(10), + child: RichText( + textAlign: TextAlign.left, + text: TextSpan( + children: [ + TextSpan( + text: "Appearances", + style: STextStyles.desktopTextSmall(context), + ), + TextSpan( + text: + "\n\nCustomize how your Stack Wallet looks according to your preferences.", + style: STextStyles.desktopTextExtraExtraSmall( + context), + ), + ], + ), ), - onValueChanged: (newValue) { - ref - .read(prefsChangeNotifierProvider) - .showFavoriteWallets = newValue; - }, ), - ) - ], - ), - ), - const Padding( - padding: EdgeInsets.all(10.0), - child: Divider( - thickness: 0.5, - ), - ), - Padding( - padding: const EdgeInsets.all(10.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - "Choose theme", - style: STextStyles.desktopTextExtraSmall(context) - .copyWith( - color: Theme.of(context) - .extension()! - .textDark), - textAlign: TextAlign.left, + ], + ), + const Padding( + padding: EdgeInsets.all(10.0), + child: Divider( + thickness: 0.5, ), - ], - ), - ), - const Padding( - padding: EdgeInsets.all(10), - child: ThemeToggle(), + ), + Padding( + padding: const EdgeInsets.all(10.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Display favorite wallets", + style: STextStyles.desktopTextExtraSmall(context) + .copyWith( + color: Theme.of(context) + .extension()! + .textDark), + textAlign: TextAlign.left, + ), + SizedBox( + height: 20, + width: 40, + child: DraggableSwitchButton( + isOn: ref.watch( + prefsChangeNotifierProvider.select( + (value) => value.showFavoriteWallets), + ), + onValueChanged: (newValue) { + ref + .read(prefsChangeNotifierProvider) + .showFavoriteWallets = newValue; + }, + ), + ) + ], + ), + ), + const Padding( + padding: EdgeInsets.all(10.0), + child: Divider( + thickness: 0.5, + ), + ), + Padding( + padding: const EdgeInsets.all(10.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + "Choose theme", + style: STextStyles.desktopTextExtraSmall(context) + .copyWith( + color: Theme.of(context) + .extension()! + .textDark), + textAlign: TextAlign.left, + ), + ], + ), + ), + Padding( + padding: EdgeInsets.all(10), + child: ThemeToggle(), + ), + ], ), ], ), @@ -163,12 +167,16 @@ class _ThemeToggle extends ConsumerState { return Assets.svg.themeDark; case ThemeType.oceanBreeze: return Assets.svg.themeOcean; + case ThemeType.oledBlack: + return Assets.svg.themeOledBlack; } } @override Widget build(BuildContext context) { - return Row( + return Wrap( + spacing: 16, + runSpacing: 16, children: [ for (int i = 0; i < ThemeType.values.length; i++) Row( diff --git a/lib/services/coins/bitcoin/bitcoin_wallet.dart b/lib/services/coins/bitcoin/bitcoin_wallet.dart index 4afec573b..9e8702ea3 100644 --- a/lib/services/coins/bitcoin/bitcoin_wallet.dart +++ b/lib/services/coins/bitcoin/bitcoin_wallet.dart @@ -1258,7 +1258,7 @@ class BitcoinWallet extends CoinServiceAPI _cachedElectrumXClient = cachedClient; _secureStore = secureStore; initCache(walletId, coin); - isarInit(mockableOverride: mockableOverride); + initWalletDB(mockableOverride: mockableOverride); } @override diff --git a/lib/services/coins/bitcoincash/bitcoincash_wallet.dart b/lib/services/coins/bitcoincash/bitcoincash_wallet.dart index b5338c443..1a6587e6b 100644 --- a/lib/services/coins/bitcoincash/bitcoincash_wallet.dart +++ b/lib/services/coins/bitcoincash/bitcoincash_wallet.dart @@ -1214,7 +1214,7 @@ class BitcoinCashWallet extends CoinServiceAPI with WalletCache, WalletDB { _cachedElectrumXClient = cachedClient; _secureStore = secureStore; initCache(walletId, coin); - isarInit(mockableOverride: mockableOverride); + initWalletDB(mockableOverride: mockableOverride); } @override diff --git a/lib/services/coins/coin_service.dart b/lib/services/coins/coin_service.dart index fb433466c..87169609e 100644 --- a/lib/services/coins/coin_service.dart +++ b/lib/services/coins/coin_service.dart @@ -294,4 +294,46 @@ abstract class CoinServiceAPI { Future updateSentCachedTxData(Map txData); int get storedChainHeight; + + // Certain outputs return address as an array/list of strings like List ["addresses"][0], some return it as a string like String ["address"] + String? getAddress(dynamic output) { + // Julian's code from https://github.com/cypherstack/stack_wallet/blob/35a8172d35f1b5cdbd22f0d56c4db02f795fd032/lib/services/coins/coin_paynym_extension.dart#L170 wins codegolf for this, I'd love to commit it now but need to retest this section ... should make unit tests for this case + // final String? address = output["scriptPubKey"]?["addresses"]?[0] as String? ?? output["scriptPubKey"]?["address"] as String?; + String? address; + if (output.containsKey('scriptPubKey') as bool) { + // Make sure the key exists before using it + if (output["scriptPubKey"].containsKey('address') as bool) { + address = output["scriptPubKey"]["address"] as String?; + } else if (output["scriptPubKey"].containsKey('addresses') as bool) { + address = output["scriptPubKey"]["addresses"][0] as String?; + // TODO determine cases in which there are multiple addresses in the array + } + } /*else { + // TODO detect cases in which no scriptPubKey exists + Logging.instance.log("output type not detected; output: ${output}", + level: LogLevel.Info); + }*/ + + return address; + } + + // Firo wants an array/list of address strings like List + List? getAddresses(dynamic output) { + // Inspired by Julian's code as referenced above, need to test before committing + // final List? addresses = output["scriptPubKey"]?["addresses"] as List? ?? [output["scriptPubKey"]?["address"]] as List?; + List? addresses; + if (output.containsKey('scriptPubKey') as bool) { + if (output["scriptPubKey"].containsKey('addresses') as bool) { + addresses = output["scriptPubKey"]["addresses"] as List?; + } else if (output["scriptPubKey"].containsKey('address') as bool) { + addresses = [output["scriptPubKey"]["address"]]; + } + } /*else { + // TODO detect cases in which no scriptPubKey exists + Logging.instance.log("output type not detected; output: ${output}", + level: LogLevel.Info); + }*/ + + return addresses; + } } diff --git a/lib/services/coins/dogecoin/dogecoin_wallet.dart b/lib/services/coins/dogecoin/dogecoin_wallet.dart index c878101b6..63568cc59 100644 --- a/lib/services/coins/dogecoin/dogecoin_wallet.dart +++ b/lib/services/coins/dogecoin/dogecoin_wallet.dart @@ -1093,7 +1093,7 @@ class DogecoinWallet extends CoinServiceAPI _cachedElectrumXClient = cachedClient; _secureStore = secureStore; initCache(walletId, coin); - isarInit(mockableOverride: mockableOverride); + initWalletDB(mockableOverride: mockableOverride); } @override diff --git a/lib/services/coins/epiccash/epiccash_wallet.dart b/lib/services/coins/epiccash/epiccash_wallet.dart index 3e569d0ea..86ed2979b 100644 --- a/lib/services/coins/epiccash/epiccash_wallet.dart +++ b/lib/services/coins/epiccash/epiccash_wallet.dart @@ -542,7 +542,7 @@ class EpicCashWallet extends CoinServiceAPI _secureStore = secureStore; initCache(walletId, coin); initEpicCashHive(walletId); - isarInit(mockableOverride: mockableOverride); + initWalletDB(mockableOverride: mockableOverride); Logging.instance.log("$walletName isolate length: ${isolates.length}", level: LogLevel.Info); diff --git a/lib/services/coins/firo/firo_wallet.dart b/lib/services/coins/firo/firo_wallet.dart index dcb4153a7..0962e6fdc 100644 --- a/lib/services/coins/firo/firo_wallet.dart +++ b/lib/services/coins/firo/firo_wallet.dart @@ -1225,7 +1225,7 @@ class FiroWallet extends CoinServiceAPI with WalletCache, WalletDB, FiroHive { _secureStore = secureStore; initCache(walletId, coin); initFiroHive(walletId); - isarInit(mockableOverride: mockableOverride); + initWalletDB(mockableOverride: mockableOverride); Logging.instance.log("$walletName isolates length: ${isolates.length}", level: LogLevel.Info); diff --git a/lib/services/coins/litecoin/litecoin_wallet.dart b/lib/services/coins/litecoin/litecoin_wallet.dart index 44383443f..d0c922afa 100644 --- a/lib/services/coins/litecoin/litecoin_wallet.dart +++ b/lib/services/coins/litecoin/litecoin_wallet.dart @@ -1276,7 +1276,7 @@ class LitecoinWallet extends CoinServiceAPI _cachedElectrumXClient = cachedClient; _secureStore = secureStore; initCache(walletId, coin); - isarInit(mockableOverride: mockableOverride); + initWalletDB(mockableOverride: mockableOverride); } @override diff --git a/lib/services/coins/monero/monero_wallet.dart b/lib/services/coins/monero/monero_wallet.dart index 48bcfc2ed..ee3807163 100644 --- a/lib/services/coins/monero/monero_wallet.dart +++ b/lib/services/coins/monero/monero_wallet.dart @@ -92,7 +92,7 @@ class MoneroWallet extends CoinServiceAPI with WalletCache, WalletDB { _secureStorage = secureStorage; _prefs = prefs ?? Prefs.instance; initCache(walletId, coin); - isarInit(mockableOverride: mockableOverride); + initWalletDB(mockableOverride: mockableOverride); } @override @@ -381,7 +381,12 @@ class MoneroWallet extends CoinServiceAPI with WalletCache, WalletDB { final node = await _getCurrentNode(); final host = Uri.parse(node.host).host; await walletBase!.connectToNode( - node: Node(uri: "$host:${node.port}", type: WalletType.monero)); + node: Node( + uri: "$host:${node.port}", + type: WalletType.monero, + trusted: node.trusted ?? false, + ), + ); await walletBase!.startSync(); await Future.wait([ @@ -603,7 +608,12 @@ class MoneroWallet extends CoinServiceAPI with WalletCache, WalletDB { final node = await _getCurrentNode(); final host = Uri.parse(node.host).host; await walletBase!.connectToNode( - node: Node(uri: "$host:${node.port}", type: WalletType.monero)); + node: Node( + uri: "$host:${node.port}", + type: WalletType.monero, + trusted: node.trusted ?? false, + ), + ); await walletBase!.rescan(height: credentials.height); walletBase!.close(); } catch (e, s) { @@ -690,7 +700,12 @@ class MoneroWallet extends CoinServiceAPI with WalletCache, WalletDB { final node = await _getCurrentNode(); final host = Uri.parse(node.host).host; await walletBase?.connectToNode( - node: Node(uri: "$host:${node.port}", type: WalletType.monero)); + node: Node( + uri: "$host:${node.port}", + type: WalletType.monero, + trusted: node.trusted ?? false, + ), + ); } await walletBase?.startSync(); await refresh(); @@ -782,7 +797,12 @@ class MoneroWallet extends CoinServiceAPI with WalletCache, WalletDB { final host = Uri.parse(node.host).host; await walletBase?.connectToNode( - node: Node(uri: "$host:${node.port}", type: WalletType.monero)); + node: Node( + uri: "$host:${node.port}", + type: WalletType.monero, + trusted: node.trusted ?? false, + ), + ); // TODO: is this sync call needed? Do we need to notify ui here? await walletBase?.startSync(); diff --git a/lib/services/coins/namecoin/namecoin_wallet.dart b/lib/services/coins/namecoin/namecoin_wallet.dart index 8af9d8a59..e9ef15b90 100644 --- a/lib/services/coins/namecoin/namecoin_wallet.dart +++ b/lib/services/coins/namecoin/namecoin_wallet.dart @@ -1265,7 +1265,7 @@ class NamecoinWallet extends CoinServiceAPI _cachedElectrumXClient = cachedClient; _secureStore = secureStore; initCache(walletId, coin); - isarInit(mockableOverride: mockableOverride); + initWalletDB(mockableOverride: mockableOverride); } @override diff --git a/lib/services/coins/particl/particl_wallet.dart b/lib/services/coins/particl/particl_wallet.dart index c4afcd1ed..e705a6178 100644 --- a/lib/services/coins/particl/particl_wallet.dart +++ b/lib/services/coins/particl/particl_wallet.dart @@ -1195,7 +1195,7 @@ class ParticlWallet extends CoinServiceAPI with WalletCache, WalletDB { _cachedElectrumXClient = cachedClient; _secureStore = secureStore; initCache(walletId, coin); - isarInit(mockableOverride: mockableOverride); + initWalletDB(mockableOverride: mockableOverride); } @override diff --git a/lib/services/coins/wownero/wownero_wallet.dart b/lib/services/coins/wownero/wownero_wallet.dart index 8cf873b3b..d471208cd 100644 --- a/lib/services/coins/wownero/wownero_wallet.dart +++ b/lib/services/coins/wownero/wownero_wallet.dart @@ -94,7 +94,7 @@ class WowneroWallet extends CoinServiceAPI with WalletCache, WalletDB { _secureStorage = secureStorage; _prefs = prefs ?? Prefs.instance; initCache(walletId, coin); - isarInit(mockableOverride: mockableOverride); + initWalletDB(mockableOverride: mockableOverride); } @override @@ -389,7 +389,12 @@ class WowneroWallet extends CoinServiceAPI with WalletCache, WalletDB { final node = await _getCurrentNode(); final host = Uri.parse(node.host).host; await walletBase?.connectToNode( - node: Node(uri: "$host:${node.port}", type: WalletType.wownero)); + node: Node( + uri: "$host:${node.port}", + type: WalletType.wownero, + trusted: node.trusted ?? false, + ), + ); await walletBase?.startSync(); await Future.wait([ updateCachedId(walletId), @@ -614,7 +619,12 @@ class WowneroWallet extends CoinServiceAPI with WalletCache, WalletDB { final node = await _getCurrentNode(); final host = Uri.parse(node.host).host; await walletBase?.connectToNode( - node: Node(uri: "$host:${node.port}", type: WalletType.wownero)); + node: Node( + uri: "$host:${node.port}", + type: WalletType.wownero, + trusted: node.trusted ?? false, + ), + ); await walletBase?.rescan(height: credentials.height); walletBase?.close(); } catch (e, s) { @@ -701,7 +711,12 @@ class WowneroWallet extends CoinServiceAPI with WalletCache, WalletDB { final node = await _getCurrentNode(); final host = Uri.parse(node.host).host; await walletBase?.connectToNode( - node: Node(uri: "$host:${node.port}", type: WalletType.monero)); + node: Node( + uri: "$host:${node.port}", + type: WalletType.wownero, + trusted: node.trusted ?? false, + ), + ); } await walletBase?.startSync(); await refresh(); @@ -790,7 +805,12 @@ class WowneroWallet extends CoinServiceAPI with WalletCache, WalletDB { final host = Uri.parse(node.host).host; await walletBase?.connectToNode( - node: Node(uri: "$host:${node.port}", type: WalletType.monero)); + node: Node( + uri: "$host:${node.port}", + type: WalletType.wownero, + trusted: node.trusted ?? false, + ), + ); // TODO: is this sync call needed? Do we need to notify ui here? await walletBase?.startSync(); diff --git a/lib/services/mixins/wallet_db.dart b/lib/services/mixins/wallet_db.dart index c1e02c9a2..cf62cf6da 100644 --- a/lib/services/mixins/wallet_db.dart +++ b/lib/services/mixins/wallet_db.dart @@ -4,7 +4,7 @@ mixin WalletDB { MainDB? _db; MainDB get db => _db!; - void isarInit({MainDB? mockableOverride}) async { + void initWalletDB({MainDB? mockableOverride}) async { _db = mockableOverride ?? MainDB.instance; } } diff --git a/lib/services/node_service.dart b/lib/services/node_service.dart index ca1aae082..8a0e17ad7 100644 --- a/lib/services/node_service.dart +++ b/lib/services/node_service.dart @@ -33,11 +33,15 @@ class NodeService extends ChangeNotifier { ); } } else { - // update all fields but copy over previously set enabled state + // update all fields but copy over previously set enabled and trusted states await DB.instance.put( boxName: DB.boxNameNodeModels, key: savedNode.id, - value: defaultNode.copyWith(enabled: savedNode.enabled)); + value: defaultNode.copyWith( + enabled: savedNode.enabled, + isFailover: savedNode.isFailover, + trusted: savedNode.trusted, + )); } // check if a default node is the primary node for the crypto currency @@ -49,6 +53,8 @@ class NodeService extends ChangeNotifier { coin: coin, node: defaultNode.copyWith( enabled: primaryNode.enabled, + isFailover: primaryNode.isFailover, + trusted: primaryNode.trusted, ), ); } @@ -161,6 +167,17 @@ class NodeService extends ChangeNotifier { String? password, bool shouldNotifyListeners, ) async { + // check if the node being edited is the primary one; if it is, setPrimaryNodeFor coin + final coin = coinFromPrettyName(editedNode.coinName); + var primaryNode = getPrimaryNodeFor(coin: coin); + if (primaryNode?.id == editedNode.id) { + await setPrimaryNodeFor( + coin: coin, + node: editedNode, + shouldNotifyListeners: true, + ); + } + return add(editedNode, password, shouldNotifyListeners); } diff --git a/lib/utilities/assets.dart b/lib/utilities/assets.dart index b1f5dd243..0b7508d04 100644 --- a/lib/utilities/assets.dart +++ b/lib/utilities/assets.dart @@ -33,6 +33,7 @@ class _SVG { switch (Theme.of(context).extension()!.themeType) { case ThemeType.light: case ThemeType.dark: + case ThemeType.oledBlack: return null; case ThemeType.oceanBreeze: @@ -70,6 +71,7 @@ class _SVG { String txExchangeFailed(BuildContext context) => "assets/svg/${Theme.of(context).extension()!.themeType.name}/tx-exchange-icon-failed.svg"; + String get themeOledBlack => "assets/svg/oled-black-theme.svg"; String get themeOcean => "assets/svg/ocean-breeze-theme.svg"; String get themeLight => "assets/svg/light-mode.svg"; String get themeDark => "assets/svg/dark-theme.svg"; diff --git a/lib/utilities/db_version_migration.dart b/lib/utilities/db_version_migration.dart index 9562f168c..eab9a8966 100644 --- a/lib/utilities/db_version_migration.dart +++ b/lib/utilities/db_version_migration.dart @@ -1,6 +1,7 @@ import 'dart:convert'; import 'package:hive/hive.dart'; +import 'package:stackwallet/db/main_db.dart'; import 'package:stackwallet/electrumx_rpc/electrumx.dart'; import 'package:stackwallet/hive/db.dart'; import 'package:stackwallet/models/exchange/change_now/exchange_transaction.dart'; @@ -403,7 +404,8 @@ class DbVersionMigrator with WalletDB { _parseTransactions(txnsLelantus, walletId, true, newAddresses)); // store newly parsed data in isar - isarInit(); + await MainDB.instance.initMainDB(); + initWalletDB(); await db.isar.writeTxn(() async { await db.isar.addresses.putAll(newAddresses); }); diff --git a/lib/utilities/default_nodes.dart b/lib/utilities/default_nodes.dart index b04bdcb7f..d3e0f7abe 100644 --- a/lib/utilities/default_nodes.dart +++ b/lib/utilities/default_nodes.dart @@ -108,6 +108,7 @@ abstract class DefaultNodes { coinName: Coin.monero.name, isFailover: true, isDown: false, + trusted: true, ); static NodeModel get wownero => NodeModel( @@ -120,6 +121,7 @@ abstract class DefaultNodes { coinName: Coin.wownero.name, isFailover: true, isDown: false, + trusted: true, ); static NodeModel get epicCash => NodeModel( diff --git a/lib/utilities/text_styles.dart b/lib/utilities/text_styles.dart index be176e37d..66decfc50 100644 --- a/lib/utilities/text_styles.dart +++ b/lib/utilities/text_styles.dart @@ -27,6 +27,12 @@ class STextStyles { fontWeight: FontWeight.w500, fontSize: 12, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark3, + fontWeight: FontWeight.w500, + fontSize: 12, + ); } } @@ -50,6 +56,12 @@ class STextStyles { fontWeight: FontWeight.w600, fontSize: 20, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark, + fontWeight: FontWeight.w600, + fontSize: 20, + ); } } @@ -73,6 +85,12 @@ class STextStyles { fontWeight: FontWeight.w600, fontSize: 18, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark, + fontWeight: FontWeight.w600, + fontSize: 18, + ); } } @@ -96,6 +114,12 @@ class STextStyles { fontWeight: FontWeight.w600, fontSize: 16, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark, + fontWeight: FontWeight.w600, + fontSize: 16, + ); } } @@ -119,6 +143,12 @@ class STextStyles { fontWeight: FontWeight.w600, fontSize: 16, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark, + fontWeight: FontWeight.w600, + fontSize: 16, + ); } } @@ -142,6 +172,12 @@ class STextStyles { fontWeight: FontWeight.w400, fontSize: 16, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark, + fontWeight: FontWeight.w400, + fontSize: 16, + ); } } @@ -165,6 +201,12 @@ class STextStyles { fontWeight: FontWeight.w400, fontSize: 16, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark, + fontWeight: FontWeight.w400, + fontSize: 16, + ); } } @@ -188,6 +230,12 @@ class STextStyles { fontWeight: FontWeight.w500, fontSize: 16, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark, + fontWeight: FontWeight.w500, + fontSize: 16, + ); } } @@ -211,6 +259,12 @@ class STextStyles { fontWeight: FontWeight.w600, fontSize: 16, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark, + fontWeight: FontWeight.w600, + fontSize: 16, + ); } } @@ -234,6 +288,12 @@ class STextStyles { fontWeight: FontWeight.w500, fontSize: 16, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).buttonTextPrimary, + fontWeight: FontWeight.w500, + fontSize: 16, + ); } } @@ -257,6 +317,12 @@ class STextStyles { fontWeight: FontWeight.w500, fontSize: 16, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark, + fontWeight: FontWeight.w500, + fontSize: 16, + ); } } @@ -280,6 +346,12 @@ class STextStyles { fontWeight: FontWeight.w500, fontSize: 16, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark3, + fontWeight: FontWeight.w500, + fontSize: 16, + ); } } @@ -303,6 +375,12 @@ class STextStyles { fontWeight: FontWeight.w500, fontSize: 14, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark3, + fontWeight: FontWeight.w500, + fontSize: 14, + ); } } @@ -326,6 +404,12 @@ class STextStyles { fontWeight: FontWeight.w500, fontSize: 12, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textSubtitle1, + fontWeight: FontWeight.w500, + fontSize: 12, + ); } } @@ -352,6 +436,13 @@ class STextStyles { fontSize: 14, height: 14 / 14, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textFieldActiveSearchIconRight, + fontWeight: FontWeight.w500, + fontSize: 14, + height: 14 / 14, + ); } } @@ -375,6 +466,12 @@ class STextStyles { fontWeight: FontWeight.w700, fontSize: 12, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textSubtitle1, + fontWeight: FontWeight.w700, + fontSize: 12, + ); } } @@ -398,6 +495,12 @@ class STextStyles { fontWeight: FontWeight.w500, fontSize: 14, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).infoItemLabel, + fontWeight: FontWeight.w500, + fontSize: 14, + ); } } @@ -421,6 +524,12 @@ class STextStyles { fontWeight: FontWeight.w500, fontSize: 14, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark, + fontWeight: FontWeight.w500, + fontSize: 14, + ); } } @@ -444,6 +553,12 @@ class STextStyles { fontWeight: FontWeight.w500, fontSize: 14, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark, + fontWeight: FontWeight.w500, + fontSize: 14, + ); } } @@ -470,6 +585,13 @@ class STextStyles { fontSize: 14, height: 1.5, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textSubtitle2, + fontWeight: FontWeight.w500, + fontSize: 14, + height: 1.5, + ); } } @@ -496,6 +618,13 @@ class STextStyles { fontSize: 14, height: 1.5, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark, + fontWeight: FontWeight.w500, + fontSize: 14, + height: 1.5, + ); } } @@ -519,6 +648,12 @@ class STextStyles { fontWeight: FontWeight.w400, fontSize: 14, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark, + fontWeight: FontWeight.w400, + fontSize: 14, + ); } } @@ -542,6 +677,12 @@ class STextStyles { fontWeight: FontWeight.w500, fontSize: 14, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).accentColorRed, + fontWeight: FontWeight.w500, + fontSize: 14, + ); } } @@ -565,6 +706,12 @@ class STextStyles { fontWeight: FontWeight.w500, fontSize: 14, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).infoItemIcons, + fontWeight: FontWeight.w500, + fontSize: 14, + ); } } @@ -588,6 +735,12 @@ class STextStyles { fontWeight: FontWeight.w500, fontSize: 12, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).accentColorBlue, + fontWeight: FontWeight.w500, + fontSize: 12, + ); } } @@ -611,6 +764,12 @@ class STextStyles { fontWeight: FontWeight.w600, fontSize: 12, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark, + fontWeight: FontWeight.w600, + fontSize: 12, + ); } } @@ -634,6 +793,12 @@ class STextStyles { fontWeight: FontWeight.w500, fontSize: 12, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark, + fontWeight: FontWeight.w500, + fontSize: 12, + ); } } @@ -657,6 +822,12 @@ class STextStyles { fontWeight: FontWeight.w500, fontSize: 12, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark, + fontWeight: FontWeight.w500, + fontSize: 12, + ); } } @@ -680,6 +851,12 @@ class STextStyles { fontWeight: FontWeight.w500, fontSize: 12, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark, + fontWeight: FontWeight.w500, + fontSize: 12, + ); } } @@ -703,6 +880,12 @@ class STextStyles { fontWeight: FontWeight.w500, fontSize: 10, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textError, + fontWeight: FontWeight.w500, + fontSize: 10, + ); } } @@ -726,6 +909,12 @@ class STextStyles { fontWeight: FontWeight.w500, fontSize: 10, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textSubtitle1, + fontWeight: FontWeight.w500, + fontSize: 10, + ); } } @@ -754,6 +943,13 @@ class STextStyles { fontSize: 40, height: 40 / 40, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark, + fontWeight: FontWeight.w600, + fontSize: 40, + height: 40 / 40, + ); } } @@ -780,6 +976,13 @@ class STextStyles { fontSize: 32, height: 32 / 32, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark, + fontWeight: FontWeight.w600, + fontSize: 32, + height: 32 / 32, + ); } } @@ -806,6 +1009,13 @@ class STextStyles { fontSize: 24, height: 24 / 24, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark, + fontWeight: FontWeight.w600, + fontSize: 24, + height: 24 / 24, + ); } } @@ -832,6 +1042,13 @@ class STextStyles { fontSize: 24, height: 24 / 24, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark, + fontWeight: FontWeight.w500, + fontSize: 24, + height: 24 / 24, + ); } } @@ -858,6 +1075,13 @@ class STextStyles { fontSize: 20, height: 30 / 20, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark, + fontWeight: FontWeight.w500, + fontSize: 20, + height: 30 / 20, + ); } } @@ -884,6 +1108,13 @@ class STextStyles { fontSize: 20, height: 30 / 20, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark, + fontWeight: FontWeight.w400, + fontSize: 20, + height: 30 / 20, + ); } } @@ -910,6 +1141,13 @@ class STextStyles { fontSize: 20, height: 28 / 20, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark, + fontWeight: FontWeight.w400, + fontSize: 20, + height: 28 / 20, + ); } } @@ -936,6 +1174,13 @@ class STextStyles { fontSize: 24, height: 33 / 24, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark, + fontWeight: FontWeight.w400, + fontSize: 24, + height: 33 / 24, + ); } } @@ -962,6 +1207,13 @@ class STextStyles { fontSize: 20, height: 26 / 20, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).buttonTextPrimary, + fontWeight: FontWeight.w500, + fontSize: 20, + height: 26 / 20, + ); } } @@ -988,6 +1240,13 @@ class STextStyles { fontSize: 20, height: 26 / 20, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).buttonTextPrimaryDisabled, + fontWeight: FontWeight.w500, + fontSize: 20, + height: 26 / 20, + ); } } @@ -1014,6 +1273,13 @@ class STextStyles { fontSize: 20, height: 26 / 20, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).buttonTextSecondary, + fontWeight: FontWeight.w500, + fontSize: 20, + height: 26 / 20, + ); } } @@ -1040,6 +1306,13 @@ class STextStyles { fontSize: 20, height: 26 / 20, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).buttonTextSecondaryDisabled, + fontWeight: FontWeight.w500, + fontSize: 20, + height: 26 / 20, + ); } } @@ -1066,6 +1339,13 @@ class STextStyles { fontSize: 18, height: 27 / 18, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark, + fontWeight: FontWeight.w500, + fontSize: 18, + height: 27 / 18, + ); } } @@ -1092,6 +1372,13 @@ class STextStyles { fontSize: 18, height: 27 / 18, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).buttonTextPrimaryDisabled, + fontWeight: FontWeight.w700, + fontSize: 18, + height: 27 / 18, + ); } } @@ -1118,6 +1405,13 @@ class STextStyles { fontSize: 16, height: 24 / 16, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).buttonTextPrimaryDisabled, + fontWeight: FontWeight.w500, + fontSize: 16, + height: 24 / 16, + ); } } @@ -1144,6 +1438,13 @@ class STextStyles { fontSize: 14, height: 21 / 14, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textSubtitle1, + fontWeight: FontWeight.w500, + fontSize: 14, + height: 21 / 14, + ); } } @@ -1170,6 +1471,13 @@ class STextStyles { fontSize: 14, height: 21 / 14, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark, + fontWeight: FontWeight.w600, + fontSize: 14, + height: 21 / 14, + ); } } @@ -1196,6 +1504,13 @@ class STextStyles { fontSize: 16, height: 24 / 16, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).buttonTextSecondary, + fontWeight: FontWeight.w500, + fontSize: 16, + height: 24 / 16, + ); } } @@ -1222,6 +1537,13 @@ class STextStyles { fontSize: 20, height: 30 / 20, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textSubtitle2, + fontWeight: FontWeight.w500, + fontSize: 20, + height: 30 / 20, + ); } } @@ -1248,6 +1570,13 @@ class STextStyles { fontSize: 16, height: 20.8 / 16, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark.withOpacity(0.8), + fontWeight: FontWeight.w500, + fontSize: 16, + height: 20.8 / 16, + ); } } @@ -1274,6 +1603,13 @@ class STextStyles { fontSize: 16, height: 20.8 / 16, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark, + fontWeight: FontWeight.w500, + fontSize: 16, + height: 20.8 / 16, + ); } } @@ -1300,6 +1636,13 @@ class STextStyles { fontSize: 16, height: 20.8 / 16, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark.withOpacity(0.5), + fontWeight: FontWeight.w500, + fontSize: 16, + height: 20.8 / 16, + ); } } @@ -1326,6 +1669,13 @@ class STextStyles { fontSize: 16, height: 20.8 / 16, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + color: _theme(context).textDark, + fontWeight: FontWeight.w500, + fontSize: 16, + height: 20.8 / 16, + ); } } @@ -1349,6 +1699,12 @@ class STextStyles { fontWeight: FontWeight.w600, fontSize: 8, ); + case ThemeType.oledBlack: + return GoogleFonts.roboto( + color: _theme(context).textDark, + fontWeight: FontWeight.w600, + fontSize: 8, + ); } } @@ -1372,6 +1728,12 @@ class STextStyles { fontWeight: FontWeight.w400, fontSize: 26, ); + case ThemeType.oledBlack: + return GoogleFonts.roboto( + color: _theme(context).numberTextDefault, + fontWeight: FontWeight.w400, + fontSize: 26, + ); } } @@ -1398,6 +1760,13 @@ class STextStyles { fontWeight: FontWeight.w400, fontSize: 12, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + letterSpacing: 0.5, + color: _theme(context).accentColorDark, + fontWeight: FontWeight.w400, + fontSize: 12, + ); } } @@ -1424,6 +1793,13 @@ class STextStyles { fontWeight: FontWeight.w600, fontSize: 16, ); + case ThemeType.oledBlack: + return GoogleFonts.inter( + letterSpacing: 0.5, + color: _theme(context).accentColorDark, + fontWeight: FontWeight.w600, + fontSize: 16, + ); } } } diff --git a/lib/utilities/theme/color_theme.dart b/lib/utilities/theme/color_theme.dart index 43012ffe6..8e85a69c1 100644 --- a/lib/utilities/theme/color_theme.dart +++ b/lib/utilities/theme/color_theme.dart @@ -3,12 +3,11 @@ import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/theme/dark_colors.dart'; import 'package:stackwallet/utilities/theme/light_colors.dart'; import 'package:stackwallet/utilities/theme/ocean_breeze_colors.dart'; +import 'package:stackwallet/utilities/theme/oled_black_colors.dart'; -enum ThemeType { - light, - dark, - oceanBreeze, -} +enum ThemeType { light, dark, oceanBreeze, oledBlack } + +// adjust this file extension ThemeTypeExt on ThemeType { StackColorTheme get colorTheme { @@ -19,6 +18,8 @@ extension ThemeTypeExt on ThemeType { return DarkColors(); case ThemeType.oceanBreeze: return OceanBreezeColors(); + case ThemeType.oledBlack: + return OledBlackColors(); } } @@ -30,6 +31,8 @@ extension ThemeTypeExt on ThemeType { return "Dark"; case ThemeType.oceanBreeze: return "Ocean Breeze"; + case ThemeType.oledBlack: + return "Oled Black"; } } } @@ -65,6 +68,7 @@ abstract class StackColorTheme { Color get textWhite; Color get textFavoriteCard; Color get textError; + Color get textRestore; // button background Color get buttonBackPrimary; @@ -143,6 +147,8 @@ abstract class StackColorTheme { Color get textFieldDefaultBG; Color get textFieldErrorBG; Color get textFieldSuccessBG; + Color get textFieldErrorBorder; + Color get textFieldSuccessBorder; Color get textFieldActiveSearchIconLeft; Color get textFieldDefaultSearchIconLeft; Color get textFieldErrorSearchIconLeft; diff --git a/lib/utilities/theme/dark_colors.dart b/lib/utilities/theme/dark_colors.dart index d55581921..9e3a625c1 100644 --- a/lib/utilities/theme/dark_colors.dart +++ b/lib/utilities/theme/dark_colors.dart @@ -55,6 +55,8 @@ class DarkColors extends StackColorTheme { Color get textFavoriteCard => const Color(0xFF232323); @override Color get textError => const Color(0xFFF37475); + @override + Color get textRestore => overlay; // button background @override @@ -194,6 +196,10 @@ class DarkColors extends StackColorTheme { Color get textFieldErrorBG => const Color(0xFFFFB4A9); @override Color get textFieldSuccessBG => const Color(0xFF8EF5C3); + @override + Color get textFieldErrorBorder => textFieldErrorBG; + @override + Color get textFieldSuccessBorder => textFieldSuccessBG; @override Color get textFieldActiveSearchIconLeft => const Color(0xFFA9ACAC); diff --git a/lib/utilities/theme/light_colors.dart b/lib/utilities/theme/light_colors.dart index 1303d0b75..ef59ed622 100644 --- a/lib/utilities/theme/light_colors.dart +++ b/lib/utilities/theme/light_colors.dart @@ -55,6 +55,8 @@ class LightColors extends StackColorTheme { Color get textFavoriteCard => const Color(0xFF232323); @override Color get textError => const Color(0xFF930006); + @override + Color get textRestore => overlay; // button background @override @@ -194,6 +196,10 @@ class LightColors extends StackColorTheme { Color get textFieldErrorBG => const Color(0xFFFFDAD4); @override Color get textFieldSuccessBG => const Color(0xFFB9E9D4); + @override + Color get textFieldErrorBorder => textFieldErrorBG; + @override + Color get textFieldSuccessBorder => textFieldSuccessBG; @override Color get textFieldActiveSearchIconLeft => const Color(0xFFA9ACAC); diff --git a/lib/utilities/theme/ocean_breeze_colors.dart b/lib/utilities/theme/ocean_breeze_colors.dart index 8c4259bb9..8bc9dab52 100644 --- a/lib/utilities/theme/ocean_breeze_colors.dart +++ b/lib/utilities/theme/ocean_breeze_colors.dart @@ -62,6 +62,8 @@ class OceanBreezeColors extends StackColorTheme { Color get textFavoriteCard => const Color(0xFF232323); @override Color get textError => const Color(0xFF8D0006); + @override + Color get textRestore => overlay; // button background @override @@ -201,6 +203,10 @@ class OceanBreezeColors extends StackColorTheme { Color get textFieldErrorBG => const Color(0xFFF6C7C3); @override Color get textFieldSuccessBG => const Color(0xFFADD6D2); + @override + Color get textFieldErrorBorder => textFieldErrorBG; + @override + Color get textFieldSuccessBorder => textFieldSuccessBG; @override Color get textFieldActiveSearchIconLeft => const Color(0xFF86898C); diff --git a/lib/utilities/theme/oled_black_colors.dart b/lib/utilities/theme/oled_black_colors.dart new file mode 100644 index 000000000..5a878d7c6 --- /dev/null +++ b/lib/utilities/theme/oled_black_colors.dart @@ -0,0 +1,319 @@ +import 'package:flutter/material.dart'; +import 'package:stackwallet/utilities/theme/color_theme.dart'; + +class OledBlackColors extends StackColorTheme { + @override + ThemeType get themeType => ThemeType.oledBlack; + + @override + Color get background => const Color(0xFF000000); + @override + Color get backgroundAppBar => background; + @override + Gradient? get gradientBackground => null; + + @override + Color get overlay => const Color(0xFF121212); + + @override + Color get accentColorBlue => const Color(0xFF77A7F9); + @override + Color get accentColorGreen => const Color(0xFF4CC0A0); + @override + Color get accentColorYellow => const Color(0xFFD4A51E); + @override + Color get accentColorRed => const Color(0xFFD34E50); + @override + Color get accentColorOrange => const Color(0xFFDE7456); + //accent color white (0xFFDEDEDE) + @override + Color get accentColorDark => const Color(0xFFDEDEDE); + + @override + Color get shadow => const Color(0x0F2D3132); //not done yet + + @override + Color get textDark => const Color(0xFFDEDEDE); + @override + Color get textDark2 => const Color(0xFFCCCCCC); + @override + Color get textDark3 => const Color(0xFFB2B2B2); + @override + Color get textSubtitle1 => const Color(0xFFB2B2B2); + @override + Color get textSubtitle2 => const Color(0xFFA0A0A0); + @override + Color get textSubtitle3 => const Color(0xFF878A8A); + @override + Color get textSubtitle4 => const Color(0xFF878A8A); + @override + Color get textSubtitle5 => const Color(0xFF878A8A); + @override + Color get textSubtitle6 => const Color(0xFF878A8A); + @override + Color get textWhite => const Color(0xFF242424); + @override + Color get textFavoriteCard => const Color(0xFF232323); + @override + Color get textError => const Color(0xFFCF6679); + @override + Color get textRestore => textDark; + + // button background + @override + Color get buttonBackPrimary => const Color(0xFF6F9CE9); + @override + Color get buttonBackSecondary => const Color(0xFF1F1F1F); + @override + Color get buttonBackPrimaryDisabled => const Color(0xFF212F46); + @override + Color get buttonBackSecondaryDisabled => const Color(0xFF3D3D3D); + @override + Color get buttonBackBorder => const Color(0xFF6F9CE9); + @override + Color get buttonBackBorderDisabled => const Color(0xFF212F46); + + @override + Color get numberBackDefault => const Color(0xFF242424); + @override + Color get numpadBackDefault => const Color(0xFF6F9CE9); + @override + Color get bottomNavBack => const Color(0xFF202122); + + // button text/element + @override + Color get buttonTextPrimary => const Color(0xFF000000); + @override + Color get buttonTextSecondary => const Color(0xFFDEDEDE); + @override + Color get buttonTextPrimaryDisabled => const Color(0xFF000000); + @override + Color get buttonTextSecondaryDisabled => const Color(0xFF090909); + @override + Color get buttonTextBorder => const Color(0xFF6F9CE9); + @override + Color get buttonTextDisabled => const Color(0xFF000000); + @override + Color get buttonTextBorderless => const Color(0xFF6F9CE9); + @override + Color get buttonTextBorderlessDisabled => const Color(0xFF212F46); + @override + Color get numberTextDefault => const Color(0xFFD3D3D3); + @override + Color get numpadTextDefault => const Color(0xFF000000); + @override + Color get bottomNavText => const Color(0xFFDEDEDE); + + // switch + @override + Color get switchBGOn => const Color(0xFF77A7F9); + @override + Color get switchBGOff => const Color(0xFF445C85); + @override + Color get switchBGDisabled => const Color(0xFF333538); + @override + Color get switchCircleOn => const Color(0xFFC9DDF5); + @override + Color get switchCircleOff => const Color(0xFF94AAC9); + @override + Color get switchCircleDisabled => const Color(0xFF848484); + + // step indicator background + @override + Color get stepIndicatorBGCheck => const Color(0xFF77A7F9); + @override + Color get stepIndicatorBGNumber => const Color(0xFF77A7F9); + @override + Color get stepIndicatorBGInactive => const Color(0xFF3B3F46); + @override + Color get stepIndicatorBGLines => const Color(0xFF6393E5); + @override + Color get stepIndicatorBGLinesInactive => const Color(0xFF63676E); + @override + Color get stepIndicatorIconText => const Color(0xFF000000); + @override + Color get stepIndicatorIconNumber => const Color(0xFF000000); + @override + Color get stepIndicatorIconInactive => const Color(0xFFA5A5A5); + + // checkbox + @override + Color get checkboxBGChecked => const Color(0xFF77A7F9); + @override + Color get checkboxBorderEmpty => const Color(0xFF353536); + @override + Color get checkboxBGDisabled => const Color(0xFF5D759B); + @override + Color get checkboxIconChecked => const Color(0xFF000000); + @override + Color get checkboxIconDisabled => const Color(0xFF000000); + @override + Color get checkboxTextLabel => const Color(0xFFDEDEDE); + + // snack bar + @override + Color get snackBarBackSuccess => const Color(0xFF1F1F1F); + @override + Color get snackBarBackError => const Color(0xFF1F1F1F); + @override + Color get snackBarBackInfo => const Color(0xFF1F1F1F); + @override + Color get snackBarTextSuccess => const Color(0xFF69C297); + @override + Color get snackBarTextError => const Color(0xFFCF6679); + @override + Color get snackBarTextInfo => const Color(0xFFABAEFF); + + // icons + @override + Color get bottomNavIconBack => const Color(0xFF69696A); + @override + Color get bottomNavIconIcon => const Color(0xFFDEDEDE); + + @override + Color get topNavIconPrimary => const Color(0xFFDEDEDE); + @override + Color get topNavIconGreen => const Color(0xFF4CC0A0); + @override + Color get topNavIconYellow => const Color(0xFFD4A51E); + @override + Color get topNavIconRed => const Color(0xFFD34E50); + + @override + Color get settingsIconBack => const Color(0xFFDEDEDE); + @override + Color get settingsIconIcon => const Color(0xFF232323); + @override + Color get settingsIconBack2 => const Color(0xFF94D6C4); + @override + Color get settingsIconElement => const Color(0xFF4CC0A0); + + // text field + @override + Color get textFieldActiveBG => const Color(0xFF232323); + @override + Color get textFieldDefaultBG => const Color(0xFF171717); + @override + Color get textFieldErrorBG => const Color(0xFF141414); + @override + Color get textFieldSuccessBG => const Color(0xFF141414); + //add border color vars here + @override + Color get textFieldErrorBorder => const Color(0xFFCF6679); + @override + Color get textFieldSuccessBorder => const Color(0xFF23CFA1); + + @override + Color get textFieldActiveSearchIconLeft => const Color(0xFF9C9C9C); + @override + Color get textFieldDefaultSearchIconLeft => const Color(0xFF979797); + @override + Color get textFieldErrorSearchIconLeft => const Color(0xFFCF6679); + @override + Color get textFieldSuccessSearchIconLeft => const Color(0xFF23CFA1); + + @override + Color get textFieldActiveText => const Color(0xFFC2C2C2); + @override + Color get textFieldDefaultText => const Color(0xFF979797); + @override + Color get textFieldErrorText => const Color(0xFFCF6679); + @override + Color get textFieldSuccessText => const Color(0xFFDEDEDE); + + @override + Color get textFieldActiveLabel => const Color(0xFF979797); + @override + Color get textFieldErrorLabel => const Color(0xFFCF6679); + @override + Color get textFieldSuccessLabel => const Color(0xFF69C297); + + @override + Color get textFieldActiveSearchIconRight => const Color(0xFF9C9C9C); + @override + Color get textFieldDefaultSearchIconRight => const Color(0xFF5D5D5D); + @override + Color get textFieldErrorSearchIconRight => const Color(0xFFCF6679); + @override + Color get textFieldSuccessSearchIconRight => const Color(0xFF69C297); + + // settings item level2 + @override + Color get settingsItem2ActiveBG => const Color(0xFF242424); + @override + Color get settingsItem2ActiveText => const Color(0xFFD3D3D3); + @override + Color get settingsItem2ActiveSub => const Color(0xFFB2B2B2); + + // radio buttons + @override + Color get radioButtonIconBorder => const Color(0xFF77A7F9); + @override + Color get radioButtonIconBorderDisabled => const Color(0xFF7D7D7D); + @override + Color get radioButtonBorderEnabled => const Color(0xFF77A7F9); + @override + Color get radioButtonBorderDisabled => const Color(0xFF7D7D7D); + @override + Color get radioButtonIconCircle => const Color(0xFF77A7F9); + @override + Color get radioButtonIconEnabled => const Color(0xFF77A7F9); + @override + Color get radioButtonTextEnabled => const Color(0xFFA8AAB2); + @override + Color get radioButtonTextDisabled => const Color(0xFFA8AAB2); + @override + Color get radioButtonLabelEnabled => const Color(0xFF878A8A); + @override + Color get radioButtonLabelDisabled => const Color(0xFF878A8A); + + // info text + @override + Color get infoItemBG => const Color(0xFF141414); + @override + Color get infoItemLabel => const Color(0xFFB2B2B2); + @override + Color get infoItemText => const Color(0xFFDEDEDE); + @override + Color get infoItemIcons => const Color(0xFF77A7F9); + + // popup + @override + Color get popupBG => const Color(0xFF212121); + + // currency list + @override + Color get currencyListItemBG => const Color(0xFF252525); + + // bottom nav + @override + Color get stackWalletBG => const Color(0xFF35383D); + @override + Color get stackWalletMid => const Color(0xFF292D34); + @override + Color get stackWalletBottom => const Color(0xFF292D34); + @override + Color get bottomNavShadow => const Color(0xFF282E33); + + @override + Color get favoriteStarActive => accentColorYellow; + @override + Color get favoriteStarInactive => textSubtitle2; + + @override + Color get splash => const Color(0xFF7A7D7E); + @override + Color get highlight => const Color(0xFF878A8A); + @override + Color get warningForeground => snackBarTextError; + @override + Color get warningBackground => const Color(0xFF1F1F1F); + @override + Color get loadingOverlayTextColor => const Color(0xFFCFCFCF); + @override + Color get myStackContactIconBG => const Color(0xFF747778); + @override + Color get textConfirmTotalAmount => const Color(0xFF144D35); + @override + Color get textSelectedWordTableItem => const Color(0xFF143D8E); +} diff --git a/lib/utilities/theme/stack_colors.dart b/lib/utilities/theme/stack_colors.dart index 9764128e4..b47e93128 100644 --- a/lib/utilities/theme/stack_colors.dart +++ b/lib/utilities/theme/stack_colors.dart @@ -32,6 +32,7 @@ class StackColors extends ThemeExtension { final Color textWhite; final Color textFavoriteCard; final Color textError; + final Color textRestore; // button background final Color buttonBackPrimary; @@ -110,6 +111,8 @@ class StackColors extends ThemeExtension { final Color textFieldDefaultBG; final Color textFieldErrorBG; final Color textFieldSuccessBG; + final Color textFieldErrorBorder; + final Color textFieldSuccessBorder; final Color textFieldActiveSearchIconLeft; final Color textFieldDefaultSearchIconLeft; final Color textFieldErrorSearchIconLeft; @@ -198,6 +201,7 @@ class StackColors extends ThemeExtension { required this.textWhite, required this.textFavoriteCard, required this.textError, + required this.textRestore, required this.buttonBackPrimary, required this.buttonBackSecondary, required this.buttonBackPrimaryDisabled, @@ -258,6 +262,8 @@ class StackColors extends ThemeExtension { required this.textFieldDefaultBG, required this.textFieldErrorBG, required this.textFieldSuccessBG, + required this.textFieldErrorBorder, + required this.textFieldSuccessBorder, required this.textFieldActiveSearchIconLeft, required this.textFieldDefaultSearchIconLeft, required this.textFieldErrorSearchIconLeft, @@ -334,6 +340,7 @@ class StackColors extends ThemeExtension { textWhite: colorTheme.textWhite, textFavoriteCard: colorTheme.textFavoriteCard, textError: colorTheme.textError, + textRestore: colorTheme.textRestore, buttonBackPrimary: colorTheme.buttonBackPrimary, buttonBackSecondary: colorTheme.buttonBackSecondary, buttonBackPrimaryDisabled: colorTheme.buttonBackPrimaryDisabled, @@ -394,6 +401,8 @@ class StackColors extends ThemeExtension { textFieldDefaultBG: colorTheme.textFieldDefaultBG, textFieldErrorBG: colorTheme.textFieldErrorBG, textFieldSuccessBG: colorTheme.textFieldSuccessBG, + textFieldErrorBorder: colorTheme.textFieldErrorBorder, + textFieldSuccessBorder: colorTheme.textFieldSuccessBorder, textFieldActiveSearchIconLeft: colorTheme.textFieldActiveSearchIconLeft, textFieldDefaultSearchIconLeft: colorTheme.textFieldDefaultSearchIconLeft, textFieldErrorSearchIconLeft: colorTheme.textFieldErrorSearchIconLeft, @@ -473,6 +482,7 @@ class StackColors extends ThemeExtension { Color? textWhite, Color? textFavoriteCard, Color? textError, + Color? textRestore, Color? buttonBackPrimary, Color? buttonBackSecondary, Color? buttonBackPrimaryDisabled, @@ -533,6 +543,8 @@ class StackColors extends ThemeExtension { Color? textFieldDefaultBG, Color? textFieldErrorBG, Color? textFieldSuccessBG, + Color? textFieldErrorBorder, + Color? textFieldSuccessBorder, Color? textFieldActiveSearchIconLeft, Color? textFieldDefaultSearchIconLeft, Color? textFieldErrorSearchIconLeft, @@ -607,6 +619,7 @@ class StackColors extends ThemeExtension { textWhite: textWhite ?? this.textWhite, textFavoriteCard: textFavoriteCard ?? this.textFavoriteCard, textError: textError ?? this.textError, + textRestore: textRestore ?? this.textRestore, buttonBackPrimary: buttonBackPrimary ?? this.buttonBackPrimary, buttonBackSecondary: buttonBackSecondary ?? this.buttonBackSecondary, buttonBackPrimaryDisabled: @@ -679,6 +692,9 @@ class StackColors extends ThemeExtension { textFieldDefaultBG: textFieldDefaultBG ?? this.textFieldDefaultBG, textFieldErrorBG: textFieldErrorBG ?? this.textFieldErrorBG, textFieldSuccessBG: textFieldSuccessBG ?? this.textFieldSuccessBG, + textFieldErrorBorder: textFieldErrorBorder ?? this.textFieldErrorBorder, + textFieldSuccessBorder: + textFieldSuccessBorder ?? this.textFieldSuccessBorder, textFieldActiveSearchIconLeft: textFieldActiveSearchIconLeft ?? this.textFieldActiveSearchIconLeft, textFieldDefaultSearchIconLeft: @@ -877,6 +893,11 @@ class StackColors extends ThemeExtension { other.textError, t, )!, + textRestore: Color.lerp( + textRestore, + other.textRestore, + t, + )!, buttonBackPrimary: Color.lerp( buttonBackPrimary, other.buttonBackPrimary, @@ -1177,6 +1198,16 @@ class StackColors extends ThemeExtension { other.textFieldSuccessBG, t, )!, + textFieldErrorBorder: Color.lerp( + textFieldErrorBorder, + other.textFieldErrorBorder, + t, + )!, + textFieldSuccessBorder: Color.lerp( + textFieldSuccessBorder, + other.textFieldSuccessBorder, + t, + )!, textFieldActiveSearchIconLeft: Color.lerp( textFieldActiveSearchIconLeft, other.textFieldActiveSearchIconLeft, diff --git a/lib/widgets/background.dart b/lib/widgets/background.dart index 67ff44f55..0a14e2df6 100644 --- a/lib/widgets/background.dart +++ b/lib/widgets/background.dart @@ -20,6 +20,7 @@ class Background extends StatelessWidget { switch (Theme.of(context).extension()!.themeType) { case ThemeType.light: case ThemeType.dark: + case ThemeType.oledBlack: color = Theme.of(context).extension()!.background; break; case ThemeType.oceanBreeze: diff --git a/pubspec.yaml b/pubspec.yaml index e7dca762d..a4ba77948 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: Stack Wallet # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.5.29+103 +version: 1.5.30+104 environment: sdk: ">=2.17.0 <3.0.0" @@ -345,6 +345,7 @@ flutter: - assets/svg/dark-theme.svg - assets/svg/light-mode.svg - assets/svg/ocean-breeze-theme.svg + - assets/svg/oled-black-theme.svg # light theme specific - assets/svg/light/tx-exchange-icon.svg @@ -392,6 +393,21 @@ flutter: - assets/svg/oceanBreeze/buy-coins-icon.svg - assets/svg/oceanBreeze/bg.svg + # OLED black theme specific + - assets/svg/oledBlack/tx-exchange-icon.svg + - assets/svg/oledBlack/tx-exchange-icon-pending.svg + - assets/svg/oledBlack/tx-exchange-icon-failed.svg + - assets/svg/oledBlack/tx-icon-send.svg + - assets/svg/oledBlack/tx-icon-send-pending.svg + - assets/svg/oledBlack/tx-icon-send-failed.svg + - assets/svg/oledBlack/tx-icon-receive.svg + - assets/svg/oledBlack/tx-icon-receive-pending.svg + - assets/svg/oledBlack/tx-icon-receive-failed.svg + - assets/svg/oledBlack/exchange-2.svg + - assets/svg/oledBlack/bell-new.svg + - assets/svg/oledBlack/stack-icon1.svg + - assets/svg/oledBlack/buy-coins-icon.svg + # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware. # For details regarding adding assets from package dependencies, see diff --git a/test/pages/send_view/send_view_test.mocks.dart b/test/pages/send_view/send_view_test.mocks.dart index 1fd95c2a2..bcd5f44fc 100644 --- a/test/pages/send_view/send_view_test.mocks.dart +++ b/test/pages/send_view/send_view_test.mocks.dart @@ -1557,9 +1557,9 @@ class MockBitcoinWallet extends _i1.Mock implements _i21.BitcoinWallet { returnValueForMissingStub: _i17.Future.value(), ) as _i17.Future); @override - void isarInit({_i13.MainDB? mockableOverride}) => super.noSuchMethod( + void initWalletDB({_i13.MainDB? mockableOverride}) => super.noSuchMethod( Invocation.method( - #isarInit, + #initWalletDB, [], {#mockableOverride: mockableOverride}, ), diff --git a/test/services/coins/manager_test.mocks.dart b/test/services/coins/manager_test.mocks.dart index 71a77970e..af988ae76 100644 --- a/test/services/coins/manager_test.mocks.dart +++ b/test/services/coins/manager_test.mocks.dart @@ -977,9 +977,9 @@ class MockFiroWallet extends _i1.Mock implements _i9.FiroWallet { returnValueForMissingStub: _i10.Future.value(), ) as _i10.Future); @override - void isarInit({_i7.MainDB? mockableOverride}) => super.noSuchMethod( + void initWalletDB({_i7.MainDB? mockableOverride}) => super.noSuchMethod( Invocation.method( - #isarInit, + #initWalletDB, [], {#mockableOverride: mockableOverride}, ), diff --git a/test/widget_tests/managed_favorite_test.mocks.dart b/test/widget_tests/managed_favorite_test.mocks.dart index 15213e274..a5ee69930 100644 --- a/test/widget_tests/managed_favorite_test.mocks.dart +++ b/test/widget_tests/managed_favorite_test.mocks.dart @@ -1347,9 +1347,9 @@ class MockBitcoinWallet extends _i1.Mock implements _i20.BitcoinWallet { returnValueForMissingStub: _i17.Future.value(), ) as _i17.Future); @override - void isarInit({_i12.MainDB? mockableOverride}) => super.noSuchMethod( + void initWalletDB({_i12.MainDB? mockableOverride}) => super.noSuchMethod( Invocation.method( - #isarInit, + #initWalletDB, [], {#mockableOverride: mockableOverride}, ), diff --git a/test/widget_tests/table_view/table_view_row_test.mocks.dart b/test/widget_tests/table_view/table_view_row_test.mocks.dart index e549bfe09..d31019d37 100644 --- a/test/widget_tests/table_view/table_view_row_test.mocks.dart +++ b/test/widget_tests/table_view/table_view_row_test.mocks.dart @@ -1332,9 +1332,9 @@ class MockBitcoinWallet extends _i1.Mock implements _i19.BitcoinWallet { returnValueForMissingStub: _i16.Future.value(), ) as _i16.Future); @override - void isarInit({_i12.MainDB? mockableOverride}) => super.noSuchMethod( + void initWalletDB({_i12.MainDB? mockableOverride}) => super.noSuchMethod( Invocation.method( - #isarInit, + #initWalletDB, [], {#mockableOverride: mockableOverride}, ), diff --git a/test/widget_tests/transaction_card_test.mocks.dart b/test/widget_tests/transaction_card_test.mocks.dart index 185b84c60..c3b2cce4b 100644 --- a/test/widget_tests/transaction_card_test.mocks.dart +++ b/test/widget_tests/transaction_card_test.mocks.dart @@ -1891,9 +1891,9 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { returnValueForMissingStub: _i18.Future.value(), ) as _i18.Future); @override - void isarInit({_i13.MainDB? mockableOverride}) => super.noSuchMethod( + void initWalletDB({_i13.MainDB? mockableOverride}) => super.noSuchMethod( Invocation.method( - #isarInit, + #initWalletDB, [], {#mockableOverride: mockableOverride}, ), diff --git a/test/widget_tests/wallet_card_test.mocks.dart b/test/widget_tests/wallet_card_test.mocks.dart index fc4e5bb8b..5a5d048b3 100644 --- a/test/widget_tests/wallet_card_test.mocks.dart +++ b/test/widget_tests/wallet_card_test.mocks.dart @@ -1095,9 +1095,9 @@ class MockBitcoinWallet extends _i1.Mock implements _i18.BitcoinWallet { returnValueForMissingStub: _i15.Future.value(), ) as _i15.Future); @override - void isarInit({_i12.MainDB? mockableOverride}) => super.noSuchMethod( + void initWalletDB({_i12.MainDB? mockableOverride}) => super.noSuchMethod( Invocation.method( - #isarInit, + #initWalletDB, [], {#mockableOverride: mockableOverride}, ), diff --git a/test/widget_tests/wallet_info_row/sub_widgets/wallet_info_row_balance_future_test.mocks.dart b/test/widget_tests/wallet_info_row/sub_widgets/wallet_info_row_balance_future_test.mocks.dart index 67354fe01..41f874146 100644 --- a/test/widget_tests/wallet_info_row/sub_widgets/wallet_info_row_balance_future_test.mocks.dart +++ b/test/widget_tests/wallet_info_row/sub_widgets/wallet_info_row_balance_future_test.mocks.dart @@ -1346,9 +1346,9 @@ class MockBitcoinWallet extends _i1.Mock implements _i20.BitcoinWallet { returnValueForMissingStub: _i17.Future.value(), ) as _i17.Future); @override - void isarInit({_i12.MainDB? mockableOverride}) => super.noSuchMethod( + void initWalletDB({_i12.MainDB? mockableOverride}) => super.noSuchMethod( Invocation.method( - #isarInit, + #initWalletDB, [], {#mockableOverride: mockableOverride}, ), diff --git a/test/widget_tests/wallet_info_row/wallet_info_row_test.mocks.dart b/test/widget_tests/wallet_info_row/wallet_info_row_test.mocks.dart index 21b8cb10f..3e88ef129 100644 --- a/test/widget_tests/wallet_info_row/wallet_info_row_test.mocks.dart +++ b/test/widget_tests/wallet_info_row/wallet_info_row_test.mocks.dart @@ -1346,9 +1346,9 @@ class MockBitcoinWallet extends _i1.Mock implements _i20.BitcoinWallet { returnValueForMissingStub: _i17.Future.value(), ) as _i17.Future); @override - void isarInit({_i12.MainDB? mockableOverride}) => super.noSuchMethod( + void initWalletDB({_i12.MainDB? mockableOverride}) => super.noSuchMethod( Invocation.method( - #isarInit, + #initWalletDB, [], {#mockableOverride: mockableOverride}, ),