diff --git a/assets/svg/coin_icons/Wownero.svg b/assets/svg/coin_icons/Wownero.svg
new file mode 100644
index 000000000..f7a90e94c
--- /dev/null
+++ b/assets/svg/coin_icons/Wownero.svg
@@ -0,0 +1,7 @@
+
diff --git a/assets/svg/drd-icon.svg b/assets/svg/drd-icon.svg
new file mode 100644
index 000000000..7f65c820d
--- /dev/null
+++ b/assets/svg/drd-icon.svg
@@ -0,0 +1,25 @@
+
diff --git a/crypto_plugins/flutter_libmonero b/crypto_plugins/flutter_libmonero
index 4bffa40cb..8e3afd002 160000
--- a/crypto_plugins/flutter_libmonero
+++ b/crypto_plugins/flutter_libmonero
@@ -1 +1 @@
-Subproject commit 4bffa40cb60ad3d98cf0ea5b5d819f3f4895dcd6
+Subproject commit 8e3afd002968d21a3de788569356587a70818022
diff --git a/lib/main.dart b/lib/main.dart
index be1d11d0c..0be26c39e 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -8,6 +8,7 @@ import 'package:cw_core/wallet_type.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_libmonero/monero/monero.dart';
+import 'package:flutter_libmonero/wownero/wownero.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:hive_flutter/hive_flutter.dart';
@@ -84,7 +85,6 @@ void main() async {
appDirectory = (await getLibraryDirectory());
}
// FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
- await Hive.initFlutter(appDirectory.path);
if (!(Logging.isArmLinux || Logging.isTestEnv)) {
final isar = await Isar.open(
[LogSchema],
@@ -128,11 +128,14 @@ void main() async {
Hive.registerAdapter(NodeAdapter());
- Hive.registerAdapter(WalletInfoAdapter());
+ if (!Hive.isAdapterRegistered(WalletInfoAdapter().typeId)) {
+ Hive.registerAdapter(WalletInfoAdapter());
+ }
Hive.registerAdapter(WalletTypeAdapter());
Hive.registerAdapter(UnspentCoinsInfoAdapter());
+ await Hive.initFlutter(appDirectory.path);
await Hive.openBox(DB.boxNameDBInfo);
int dbVersion = DB.instance.get(
@@ -143,6 +146,7 @@ void main() async {
}
monero.onStartup();
+ wownero.onStartup();
await Hive.openBox(DB.boxNameTheme);
diff --git a/lib/pages/add_wallet_views/create_or_restore_wallet_view/create_or_restore_wallet_view.dart b/lib/pages/add_wallet_views/create_or_restore_wallet_view/create_or_restore_wallet_view.dart
index ffd32479d..b3be99e25 100644
--- a/lib/pages/add_wallet_views/create_or_restore_wallet_view/create_or_restore_wallet_view.dart
+++ b/lib/pages/add_wallet_views/create_or_restore_wallet_view/create_or_restore_wallet_view.dart
@@ -37,9 +37,11 @@ class CreateOrRestoreWalletView extends StatelessWidget {
body: SizedBox(
width: 480,
child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
+ const Spacer(
+ flex: 10,
+ ),
CreateRestoreWalletTitle(
coin: coin,
isDesktop: isDesktop,
@@ -67,6 +69,9 @@ class CreateOrRestoreWalletView extends StatelessWidget {
coin: coin,
isDesktop: isDesktop,
),
+ const Spacer(
+ flex: 15,
+ ),
],
),
),
diff --git a/lib/pages/add_wallet_views/name_your_wallet_view/name_your_wallet_view.dart b/lib/pages/add_wallet_views/name_your_wallet_view/name_your_wallet_view.dart
index cff9fd2cf..f7dbe3d33 100644
--- a/lib/pages/add_wallet_views/name_your_wallet_view/name_your_wallet_view.dart
+++ b/lib/pages/add_wallet_views/name_your_wallet_view/name_your_wallet_view.dart
@@ -151,6 +151,10 @@ class _NameYourWalletViewState extends ConsumerState {
crossAxisAlignment:
isDesktop ? CrossAxisAlignment.center : CrossAxisAlignment.stretch,
children: [
+ if (isDesktop)
+ const Spacer(
+ flex: 10,
+ ),
if (!isDesktop)
const Spacer(
flex: 1,
@@ -163,7 +167,7 @@ class _NameYourWalletViewState extends ConsumerState {
height: 100,
),
SizedBox(
- height: isDesktop ? 24 : 16,
+ height: isDesktop ? 0 : 16,
),
Text(
"Name your ${coin.prettyName} wallet",
@@ -358,6 +362,10 @@ class _NameYourWalletViewState extends ConsumerState {
),
),
),
+ if (isDesktop)
+ const Spacer(
+ flex: 15,
+ ),
],
);
}
diff --git a/lib/pages/add_wallet_views/new_wallet_recovery_phrase_view/new_wallet_recovery_phrase_view.dart b/lib/pages/add_wallet_views/new_wallet_recovery_phrase_view/new_wallet_recovery_phrase_view.dart
index 207451569..faab6d08c 100644
--- a/lib/pages/add_wallet_views/new_wallet_recovery_phrase_view/new_wallet_recovery_phrase_view.dart
+++ b/lib/pages/add_wallet_views/new_wallet_recovery_phrase_view/new_wallet_recovery_phrase_view.dart
@@ -90,224 +90,233 @@ class _NewWalletRecoveryPhraseViewState
Widget build(BuildContext context) {
debugPrint("BUILD: $runtimeType");
return WillPopScope(
- onWillPop: onWillPop,
- child: MasterScaffold(
- isDesktop: isDesktop,
- appBar: isDesktop
- ? DesktopAppBar(
- isCompactHeight: false,
- leading: AppBarBackButton(
- onPressed: () async {
- await delete();
+ onWillPop: onWillPop,
+ child: MasterScaffold(
+ isDesktop: isDesktop,
+ appBar: isDesktop
+ ? DesktopAppBar(
+ isCompactHeight: false,
+ leading: AppBarBackButton(
+ onPressed: () async {
+ await delete();
- if (mounted) {
- Navigator.of(context).popUntil(
- ModalRoute.withName(
- NewWalletRecoveryPhraseWarningView.routeName,
- ),
- );
- }
- // Navigator.of(context).pop();
- },
- ),
- trailing: ExitToMyStackButton(
- onPressed: () async {
- await delete();
- if (mounted) {
- Navigator.of(context).popUntil(
- ModalRoute.withName(DesktopHomeView.routeName),
- );
- }
- },
- ),
- )
- : AppBar(
- leading: AppBarBackButton(
- onPressed: () async {
- await delete();
+ if (mounted) {
+ Navigator.of(context).popUntil(
+ ModalRoute.withName(
+ NewWalletRecoveryPhraseWarningView.routeName,
+ ),
+ );
+ }
+ // Navigator.of(context).pop();
+ },
+ ),
+ trailing: ExitToMyStackButton(
+ onPressed: () async {
+ await delete();
+ if (mounted) {
+ Navigator.of(context).popUntil(
+ ModalRoute.withName(DesktopHomeView.routeName),
+ );
+ }
+ },
+ ),
+ )
+ : AppBar(
+ leading: AppBarBackButton(
+ onPressed: () async {
+ await delete();
- if (mounted) {
- Navigator.of(context).popUntil(
- ModalRoute.withName(
- NewWalletRecoveryPhraseWarningView.routeName,
- ),
- );
- }
- },
- ),
- actions: [
- Padding(
- padding: const EdgeInsets.all(10),
- child: AspectRatio(
- aspectRatio: 1,
- child: AppBarIconButton(
+ if (mounted) {
+ Navigator.of(context).popUntil(
+ ModalRoute.withName(
+ NewWalletRecoveryPhraseWarningView.routeName,
+ ),
+ );
+ }
+ },
+ ),
+ actions: [
+ Padding(
+ padding: const EdgeInsets.all(10),
+ child: AspectRatio(
+ aspectRatio: 1,
+ child: AppBarIconButton(
+ color: Theme.of(context)
+ .extension()!
+ .background,
+ shadows: const [],
+ icon: SvgPicture.asset(
+ Assets.svg.copy,
+ width: 24,
+ height: 24,
color: Theme.of(context)
.extension()!
- .background,
- shadows: const [],
- icon: SvgPicture.asset(
- Assets.svg.copy,
- width: 24,
- height: 24,
- color: Theme.of(context)
- .extension()!
- .topNavIconPrimary,
- ),
- onPressed: () async {
- await _copy();
- },
+ .topNavIconPrimary,
),
- ),
- ),
- ],
- ),
- body: Container(
- color: Theme.of(context).extension()!.background,
- width: isDesktop ? 600 : null,
- child: Padding(
- padding: isDesktop
- ? const EdgeInsets.all(0)
- : const EdgeInsets.all(16),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: [
- if (!isDesktop)
- const SizedBox(
- height: 4,
- ),
- if (!isDesktop)
- Text(
- _manager.walletName,
- textAlign: TextAlign.center,
- style: STextStyles.label(context).copyWith(
- fontSize: 12,
- ),
- ),
- SizedBox(
- height: isDesktop ? 24 : 4,
- ),
- Text(
- "Recovery Phrase",
- textAlign: TextAlign.center,
- style: isDesktop
- ? STextStyles.desktopH2(context)
- : STextStyles.pageTitleH1(context),
- ),
- const SizedBox(
- height: 16,
- ),
- Container(
- decoration: BoxDecoration(
- color: isDesktop
- ? Theme.of(context)
- .extension()!
- .background
- : Theme.of(context).extension()!.popupBG,
- borderRadius: BorderRadius.circular(
- Constants.size.circularBorderRadius),
- ),
- child: Padding(
- padding: isDesktop
- ? const EdgeInsets.all(0)
- : const EdgeInsets.all(12),
- child: Text(
- "Please write down your recovery phrase in the correct order and save it to keep your funds secure. You will also be asked to verify the words on the next screen.",
- textAlign: TextAlign.center,
- style: isDesktop
- ? STextStyles.desktopSubtitleH2(context)
- : STextStyles.label(context).copyWith(
- color: Theme.of(context)
- .extension()!
- .accentColorDark),
- ),
- ),
- ),
- SizedBox(
- height: isDesktop ? 21 : 8,
- ),
- if (!isDesktop)
- Expanded(
- child: SingleChildScrollView(
- child: MnemonicTable(
- words: _mnemonic,
- isDesktop: isDesktop,
- ),
- ),
- ),
- if (isDesktop)
- MnemonicTable(
- words: _mnemonic,
- isDesktop: isDesktop,
- ),
- SizedBox(
- height: isDesktop ? 24 : 16,
- ),
- if (isDesktop)
- SizedBox(
- height: 70,
- child: TextButton(
onPressed: () async {
await _copy();
},
- child: Row(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- SvgPicture.asset(
- Assets.svg.copy,
- width: 20,
- height: 20,
- ),
- const SizedBox(
- width: 10,
- ),
- Text(
- "Copy to clipboard",
- style: STextStyles.desktopButtonSecondaryEnabled(
- context),
- )
- ],
- ),
- ),
- ),
- if (isDesktop)
- const SizedBox(
- height: 16,
- ),
- ConstrainedBox(
- constraints: BoxConstraints(
- minHeight: isDesktop ? 70 : 0,
- ),
- child: TextButton(
- onPressed: () async {
- final int next = Random().nextInt(_mnemonic.length);
- ref
- .read(verifyMnemonicWordIndexStateProvider.state)
- .update((state) => next);
-
- ref
- .read(verifyMnemonicCorrectWordStateProvider.state)
- .update((state) => _mnemonic[next]);
-
- unawaited(Navigator.of(context).pushNamed(
- VerifyRecoveryPhraseView.routeName,
- arguments: Tuple2(_manager, _mnemonic),
- ));
- },
- style: Theme.of(context)
- .extension()!
- .getPrimaryEnabledButtonColor(context),
- child: Text(
- "I saved my recovery phrase",
- style: isDesktop
- ? STextStyles.desktopButtonEnabled(context)
- : STextStyles.button(context),
),
),
),
],
),
+ body: Container(
+ color: Theme.of(context).extension()!.background,
+ width: isDesktop ? 600 : null,
+ child: Padding(
+ padding:
+ isDesktop ? const EdgeInsets.all(0) : const EdgeInsets.all(16),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ if (isDesktop)
+ const Spacer(
+ flex: 10,
+ ),
+ if (!isDesktop)
+ const SizedBox(
+ height: 4,
+ ),
+ if (!isDesktop)
+ Text(
+ _manager.walletName,
+ textAlign: TextAlign.center,
+ style: STextStyles.label(context).copyWith(
+ fontSize: 12,
+ ),
+ ),
+ SizedBox(
+ height: isDesktop ? 24 : 4,
+ ),
+ Text(
+ "Recovery Phrase",
+ textAlign: TextAlign.center,
+ style: isDesktop
+ ? STextStyles.desktopH2(context)
+ : STextStyles.pageTitleH1(context),
+ ),
+ const SizedBox(
+ height: 16,
+ ),
+ Container(
+ decoration: BoxDecoration(
+ color: isDesktop
+ ? Theme.of(context).extension()!.background
+ : Theme.of(context).extension()!.popupBG,
+ borderRadius: BorderRadius.circular(
+ Constants.size.circularBorderRadius),
+ ),
+ child: Padding(
+ padding: isDesktop
+ ? const EdgeInsets.all(0)
+ : const EdgeInsets.all(12),
+ child: Text(
+ "Please write down your recovery phrase in the correct order and save it to keep your funds secure. You will also be asked to verify the words on the next screen.",
+ textAlign: TextAlign.center,
+ style: isDesktop
+ ? STextStyles.desktopSubtitleH2(context)
+ : STextStyles.label(context).copyWith(
+ color: Theme.of(context)
+ .extension()!
+ .accentColorDark),
+ ),
+ ),
+ ),
+ SizedBox(
+ height: isDesktop ? 21 : 8,
+ ),
+ if (!isDesktop)
+ Expanded(
+ child: SingleChildScrollView(
+ child: MnemonicTable(
+ words: _mnemonic,
+ isDesktop: isDesktop,
+ ),
+ ),
+ ),
+ if (isDesktop)
+ MnemonicTable(
+ words: _mnemonic,
+ isDesktop: isDesktop,
+ ),
+ SizedBox(
+ height: isDesktop ? 24 : 16,
+ ),
+ if (isDesktop)
+ SizedBox(
+ height: 70,
+ child: TextButton(
+ onPressed: () async {
+ await _copy();
+ },
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ SvgPicture.asset(
+ Assets.svg.copy,
+ width: 20,
+ height: 20,
+ color: Theme.of(context)
+ .extension()!
+ .buttonTextSecondary,
+ ),
+ const SizedBox(
+ width: 10,
+ ),
+ Text(
+ "Copy to clipboard",
+ style: STextStyles.desktopButtonSecondaryEnabled(
+ context),
+ )
+ ],
+ ),
+ ),
+ ),
+ if (isDesktop)
+ const SizedBox(
+ height: 16,
+ ),
+ ConstrainedBox(
+ constraints: BoxConstraints(
+ minHeight: isDesktop ? 70 : 0,
+ ),
+ child: TextButton(
+ onPressed: () async {
+ final int next = Random().nextInt(_mnemonic.length);
+ ref
+ .read(verifyMnemonicWordIndexStateProvider.state)
+ .update((state) => next);
+
+ ref
+ .read(verifyMnemonicCorrectWordStateProvider.state)
+ .update((state) => _mnemonic[next]);
+
+ unawaited(Navigator.of(context).pushNamed(
+ VerifyRecoveryPhraseView.routeName,
+ arguments: Tuple2(_manager, _mnemonic),
+ ));
+ },
+ style: Theme.of(context)
+ .extension()!
+ .getPrimaryEnabledButtonColor(context),
+ child: Text(
+ "I saved my recovery phrase",
+ style: isDesktop
+ ? STextStyles.desktopButtonEnabled(context)
+ : STextStyles.button(context),
+ ),
+ ),
+ ),
+ if (isDesktop)
+ const Spacer(
+ flex: 15,
+ ),
+ ],
),
),
- ));
+ ),
+ ),
+ );
}
}
diff --git a/lib/pages/add_wallet_views/new_wallet_recovery_phrase_warning_view/new_wallet_recovery_phrase_warning_view.dart b/lib/pages/add_wallet_views/new_wallet_recovery_phrase_warning_view/new_wallet_recovery_phrase_warning_view.dart
index 603e5cca1..83dc43933 100644
--- a/lib/pages/add_wallet_views/new_wallet_recovery_phrase_warning_view/new_wallet_recovery_phrase_warning_view.dart
+++ b/lib/pages/add_wallet_views/new_wallet_recovery_phrase_warning_view/new_wallet_recovery_phrase_warning_view.dart
@@ -59,7 +59,9 @@ class _NewWalletRecoveryPhraseWarningViewState
final _numberOfPhraseWords = coin == Coin.monero
? Constants.seedPhraseWordCountMonero
- : Constants.seedPhraseWordCountBip39;
+ : coin == Coin.wownero
+ ? 14
+ : Constants.seedPhraseWordCountBip39;
return MasterScaffold(
isDesktop: isDesktop,
@@ -79,9 +81,14 @@ class _NewWalletRecoveryPhraseWarningViewState
? CrossAxisAlignment.center
: CrossAxisAlignment.stretch,
children: [
- const SizedBox(
- height: 4,
- ),
+ if (isDesktop)
+ const Spacer(
+ flex: 10,
+ ),
+ if (!isDesktop)
+ const SizedBox(
+ height: 4,
+ ),
if (!isDesktop)
Text(
walletName,
@@ -90,9 +97,10 @@ class _NewWalletRecoveryPhraseWarningViewState
fontSize: 12,
),
),
- const SizedBox(
- height: 4,
- ),
+ if (!isDesktop)
+ const SizedBox(
+ height: 4,
+ ),
Text(
"Recovery Phrase",
textAlign: TextAlign.center,
@@ -130,6 +138,7 @@ class _NewWalletRecoveryPhraseWarningViewState
builder: (_, ref, __) {
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
+ mainAxisSize: MainAxisSize.min,
children: [
GestureDetector(
onTap: () {
@@ -291,6 +300,10 @@ class _NewWalletRecoveryPhraseWarningViewState
},
),
),
+ if (isDesktop)
+ const Spacer(
+ flex: 15,
+ ),
],
),
),
diff --git a/lib/pages/add_wallet_views/restore_wallet_view/confirm_recovery_dialog.dart b/lib/pages/add_wallet_views/restore_wallet_view/confirm_recovery_dialog.dart
index 6ccc44d03..8c50b75b4 100644
--- a/lib/pages/add_wallet_views/restore_wallet_view/confirm_recovery_dialog.dart
+++ b/lib/pages/add_wallet_views/restore_wallet_view/confirm_recovery_dialog.dart
@@ -1,6 +1,13 @@
import 'package:flutter/material.dart';
+import 'package:flutter_svg/svg.dart';
+import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
+import 'package:stackwallet/utilities/util.dart';
+import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
+import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart';
+import 'package:stackwallet/widgets/desktop/primary_button.dart';
+import 'package:stackwallet/widgets/desktop/secondary_button.dart';
import 'package:stackwallet/widgets/stack_dialog.dart';
class ConfirmRecoveryDialog extends StatelessWidget {
@@ -11,40 +18,94 @@ class ConfirmRecoveryDialog extends StatelessWidget {
@override
Widget build(BuildContext context) {
- return WillPopScope(
- onWillPop: () async {
- return true;
- },
- child: StackDialog(
- title: "Are you ready?",
- message:
- "Restoring your wallet may take a while. Please do not exit this screen once the process is started.",
- leftButton: TextButton(
- style: Theme.of(context)
- .extension()!
- .getSecondaryEnabledButtonColor(context),
- child: Text(
- "Cancel",
- style: STextStyles.itemSubtitle12(context),
- ),
- onPressed: () {
- Navigator.of(context).pop();
- },
+ if (Util.isDesktop) {
+ return DesktopDialog(
+ child: Column(
+ children: [
+ const DesktopDialogCloseButton(),
+ const SizedBox(
+ height: 5,
+ ),
+ SvgPicture.asset(
+ Assets.svg.drd,
+ width: 99,
+ height: 70,
+ ),
+ const Spacer(),
+ Text(
+ "Restore wallet",
+ style: STextStyles.desktopH2(context),
+ textAlign: TextAlign.center,
+ ),
+ const SizedBox(
+ height: 16,
+ ),
+ Text(
+ "Restoring your wallet may take a while.\nPlease do not exit this screen once the process is started.",
+ style: STextStyles.desktopTextMedium(context).copyWith(
+ color: Theme.of(context).extension()!.textDark3,
+ ),
+ textAlign: TextAlign.center,
+ ),
+ const Spacer(),
+ Padding(
+ padding: const EdgeInsets.only(
+ left: 32,
+ right: 32,
+ bottom: 32,
+ ),
+ child: Row(
+ children: [
+ Expanded(
+ child: SecondaryButton(
+ label: "Cancel",
+ onPressed: () {
+ Navigator.of(context).pop();
+ },
+ ),
+ ),
+ const SizedBox(
+ width: 16,
+ ),
+ Expanded(
+ child: PrimaryButton(
+ label: "Restore",
+ onPressed: () {
+ Navigator.of(context).pop();
+ onConfirm.call();
+ },
+ ),
+ )
+ ],
+ ),
+ )
+ ],
),
- rightButton: TextButton(
- style: Theme.of(context)
- .extension()!
- .getPrimaryEnabledButtonColor(context),
- child: Text(
- "Restore",
- style: STextStyles.button(context),
+ );
+ } else {
+ return WillPopScope(
+ onWillPop: () async {
+ return true;
+ },
+ child: StackDialog(
+ title: "Are you ready?",
+ message:
+ "Restoring your wallet may take a while. Please do not exit this screen once the process is started.",
+ leftButton: SecondaryButton(
+ label: "Cancel",
+ onPressed: () {
+ Navigator.of(context).pop();
+ },
+ ),
+ rightButton: PrimaryButton(
+ label: "Restore",
+ onPressed: () {
+ Navigator.of(context).pop();
+ onConfirm.call();
+ },
),
- onPressed: () {
- Navigator.of(context).pop();
- onConfirm.call();
- },
),
- ),
- );
+ );
+ }
}
}
diff --git a/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/restore_options_view.dart b/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/restore_options_view.dart
index ffa10afc4..0edc110be 100644
--- a/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/restore_options_view.dart
+++ b/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/restore_options_view.dart
@@ -10,6 +10,7 @@ import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/restore_o
import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/restore_options_platform_layout.dart';
import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart';
import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/sub_widgets/mnemonic_word_count_select_sheet.dart';
+import 'package:stackwallet/pages_desktop_specific/home/my_stack_view/exit_to_my_stack_button.dart';
import 'package:stackwallet/providers/ui/color_theme_provider.dart';
import 'package:stackwallet/providers/ui/verify_recovery_phrase/mnemonic_word_count_state_provider.dart';
import 'package:stackwallet/utilities/assets.dart';
@@ -79,59 +80,30 @@ class _RestoreOptionsViewState extends ConsumerState {
colorArrowNext: Theme.of(context).extension()!.textSubtitle1,
colorArrowPrevious:
Theme.of(context).extension()!.textSubtitle1,
- textStyleButtonNegative: GoogleFonts.inter(
+ textStyleButtonNegative: STextStyles.datePicker600(context).copyWith(
color: baseColor,
- letterSpacing: 0.5,
- fontSize: 16,
- fontWeight: FontWeight.w600,
),
- textStyleButtonPositive: GoogleFonts.inter(
+ textStyleButtonPositive: STextStyles.datePicker600(context).copyWith(
color: baseColor,
- letterSpacing: 0.5,
- fontSize: 16,
- fontWeight: FontWeight.w600,
),
- textStyleCurrentDayOnCalendar: GoogleFonts.inter(
- fontSize: 12,
- fontWeight: FontWeight.w400,
- letterSpacing: 0.5,
- color: Theme.of(context).extension()!.accentColorDark,
- ),
- textStyleDayHeader: GoogleFonts.inter(
- letterSpacing: 0.5,
- color: Theme.of(context).extension()!.accentColorDark,
- fontSize: 16,
- fontWeight: FontWeight.w600,
- ),
- textStyleDayOnCalendar: GoogleFonts.inter(
+ textStyleCurrentDayOnCalendar: STextStyles.datePicker400(context),
+ textStyleDayHeader: STextStyles.datePicker600(context),
+ textStyleDayOnCalendar: STextStyles.datePicker400(context).copyWith(
color: baseColor,
- fontSize: 12,
- fontWeight: FontWeight.w400,
- letterSpacing: 0.5,
),
- textStyleDayOnCalendarDisabled: GoogleFonts.inter(
- fontSize: 12,
- fontWeight: FontWeight.w400,
- letterSpacing: 0.5,
+ textStyleDayOnCalendarDisabled:
+ STextStyles.datePicker400(context).copyWith(
color: Theme.of(context).extension()!.textSubtitle3,
),
- textStyleDayOnCalendarSelected: GoogleFonts.inter(
- fontSize: 12,
- fontWeight: FontWeight.w400,
- letterSpacing: 0.5,
+ textStyleDayOnCalendarSelected:
+ STextStyles.datePicker400(context).copyWith(
color: Theme.of(context).extension()!.popupBG,
),
- textStyleMonthYearHeader: GoogleFonts.inter(
- letterSpacing: 0.5,
+ textStyleMonthYearHeader: STextStyles.datePicker600(context).copyWith(
color: Theme.of(context).extension()!.textSubtitle1,
- fontSize: 16,
- fontWeight: FontWeight.w600,
),
- textStyleYearButton: GoogleFonts.inter(
- letterSpacing: 0.5,
+ textStyleYearButton: STextStyles.datePicker600(context).copyWith(
color: Theme.of(context).extension()!.textWhite,
- fontSize: 16,
- fontWeight: FontWeight.w600,
),
textStyleButtonAction: GoogleFonts.inter(),
);
@@ -139,16 +111,10 @@ class _RestoreOptionsViewState extends ConsumerState {
MaterialRoundedYearPickerStyle _buildYearPickerStyle() {
return MaterialRoundedYearPickerStyle(
- textStyleYear: GoogleFonts.inter(
- letterSpacing: 0.5,
+ textStyleYear: STextStyles.datePicker600(context).copyWith(
color: Theme.of(context).extension()!.textSubtitle2,
- fontWeight: FontWeight.w600,
- fontSize: 16,
),
- textStyleYearSelected: GoogleFonts.inter(
- letterSpacing: 0.5,
- color: Theme.of(context).extension()!.accentColorDark,
- fontWeight: FontWeight.w600,
+ textStyleYearSelected: STextStyles.datePicker600(context).copyWith(
fontSize: 18,
),
);
@@ -232,11 +198,13 @@ class _RestoreOptionsViewState extends ConsumerState {
final lengths = Constants.possibleLengthsForCoin(coin).toList();
- return DesktopScaffold(
+ return MasterScaffold(
+ isDesktop: isDesktop,
appBar: isDesktop
? const DesktopAppBar(
isCompactHeight: false,
leading: AppBarBackButton(),
+ trailing: ExitToMyStackButton(),
)
: AppBar(
leading: AppBarBackButton(
@@ -260,10 +228,9 @@ class _RestoreOptionsViewState extends ConsumerState {
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
- if (!isDesktop)
- const Spacer(
- flex: 1,
- ),
+ Spacer(
+ flex: isDesktop ? 10 : 1,
+ ),
if (!isDesktop)
Image(
image: AssetImage(
@@ -272,7 +239,7 @@ class _RestoreOptionsViewState extends ConsumerState {
height: 100,
),
SizedBox(
- height: isDesktop ? 24 : 16,
+ height: isDesktop ? 0 : 16,
),
Text(
"Restore options",
@@ -417,6 +384,11 @@ class _RestoreOptionsViewState extends ConsumerState {
isDesktop: isDesktop,
onPressed: _nextEnabled ? nextPressed : null,
),
+
+ if (isDesktop)
+ const Spacer(
+ flex: 15,
+ ),
],
),
),
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 a0ac25383..68f116a95 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
@@ -17,6 +17,7 @@ import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/sub_widge
import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/sub_widgets/restoring_dialog.dart';
import 'package:stackwallet/pages/home_view/home_view.dart';
import 'package:stackwallet/pages_desktop_specific/home/desktop_home_view.dart';
+import 'package:stackwallet/pages_desktop_specific/home/my_stack_view/exit_to_my_stack_button.dart';
import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/services/coins/coin_service.dart';
import 'package:stackwallet/services/coins/manager.dart';
@@ -36,8 +37,14 @@ import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
+import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart';
+import 'package:stackwallet/widgets/desktop/desktop_scaffold.dart';
+import 'package:stackwallet/widgets/desktop/primary_button.dart';
import 'package:stackwallet/widgets/icon_widgets/clipboard_icon.dart';
import 'package:stackwallet/widgets/icon_widgets/qrcode_icon.dart';
+import 'package:stackwallet/widgets/table_view/table_view.dart';
+import 'package:stackwallet/widgets/table_view/table_view_cell.dart';
+import 'package:stackwallet/widgets/table_view/table_view_row.dart';
import 'package:wakelock/wakelock.dart';
class RestoreWalletView extends ConsumerStatefulWidget {
@@ -193,7 +200,7 @@ class _RestoreWalletViewState extends ConsumerState {
// TODO: do actual check to make sure it is a valid mnemonic for monero
if (bip39.validateMnemonic(mnemonic) == false &&
- !(widget.coin == Coin.monero)) {
+ !(widget.coin == Coin.monero || widget.coin == Coin.wownero)) {
unawaited(showFloatingFlushBar(
type: FlushBarType.warning,
message: "Invalid seed phrase!",
@@ -404,6 +411,7 @@ class _RestoreWalletViewState extends ConsumerState {
prefix,
style: STextStyles.fieldLabel(context).copyWith(
color: prefixColor,
+ fontSize: Util.isDesktop ? 16 : 14,
),
),
),
@@ -412,7 +420,7 @@ class _RestoreWalletViewState extends ConsumerState {
minWidth: 16,
minHeight: 16,
maxWidth: 36,
- maxHeight: 20,
+ maxHeight: 32,
),
suffixIconConstraints: const BoxConstraints(
minWidth: 16,
@@ -529,193 +537,483 @@ class _RestoreWalletViewState extends ConsumerState {
@override
Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- leading: AppBarBackButton(
- onPressed: () async {
- if (FocusScope.of(context).hasFocus) {
- FocusScope.of(context).unfocus();
- await Future.delayed(const Duration(milliseconds: 50));
- }
- if (mounted) {
- Navigator.of(context).pop();
- }
- },
- ),
- actions: [
- Padding(
- padding: const EdgeInsets.only(
- top: 10,
- bottom: 10,
- right: 10,
- ),
- child: AspectRatio(
- aspectRatio: 1,
- child: AppBarIconButton(
- key: const Key("restoreWalletViewQrCodeButton"),
- size: 36,
- shadows: const [],
- color: Theme.of(context).extension()!.background,
- icon: QrCodeIcon(
- width: 20,
- height: 20,
- color: Theme.of(context)
- .extension()!
- .accentColorDark,
- ),
- onPressed: scanMnemonicQr,
+ final isDesktop = Util.isDesktop;
+ return MasterScaffold(
+ isDesktop: isDesktop,
+ appBar: isDesktop
+ ? const DesktopAppBar(
+ isCompactHeight: false,
+ leading: AppBarBackButton(),
+ trailing: ExitToMyStackButton(),
+ )
+ : AppBar(
+ leading: AppBarBackButton(
+ onPressed: () async {
+ if (FocusScope.of(context).hasFocus) {
+ FocusScope.of(context).unfocus();
+ await Future.delayed(
+ const Duration(milliseconds: 50));
+ }
+ if (mounted) {
+ Navigator.of(context).pop();
+ }
+ },
),
- ),
- ),
- Padding(
- padding: const EdgeInsets.only(
- top: 10,
- bottom: 10,
- right: 10,
- ),
- child: AspectRatio(
- aspectRatio: 1,
- child: AppBarIconButton(
- key: const Key("restoreWalletPasteButton"),
- size: 36,
- shadows: const [],
- color: Theme.of(context).extension()!.background,
- icon: ClipboardIcon(
- width: 20,
- height: 20,
- color: Theme.of(context)
- .extension()!
- .accentColorDark,
+ actions: [
+ Padding(
+ padding: const EdgeInsets.only(
+ top: 10,
+ bottom: 10,
+ right: 10,
+ ),
+ child: AspectRatio(
+ aspectRatio: 1,
+ child: AppBarIconButton(
+ key: const Key("restoreWalletViewQrCodeButton"),
+ size: 36,
+ shadows: const [],
+ color: Theme.of(context)
+ .extension()!
+ .background,
+ icon: QrCodeIcon(
+ width: 20,
+ height: 20,
+ color: Theme.of(context)
+ .extension()!
+ .accentColorDark,
+ ),
+ onPressed: scanMnemonicQr,
+ ),
+ ),
),
- onPressed: pasteMnemonic,
- ),
+ Padding(
+ padding: const EdgeInsets.only(
+ top: 10,
+ bottom: 10,
+ right: 10,
+ ),
+ child: AspectRatio(
+ aspectRatio: 1,
+ child: AppBarIconButton(
+ key: const Key("restoreWalletPasteButton"),
+ size: 36,
+ shadows: const [],
+ color: Theme.of(context)
+ .extension()!
+ .background,
+ icon: ClipboardIcon(
+ width: 20,
+ height: 20,
+ color: Theme.of(context)
+ .extension()!
+ .accentColorDark,
+ ),
+ onPressed: pasteMnemonic,
+ ),
+ ),
+ ),
+ ],
),
- ),
- ],
- ),
body: Container(
color: Theme.of(context).extension()!.background,
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
children: [
- Text(
- widget.walletName,
- style: STextStyles.itemSubtitle(context),
- ),
- const SizedBox(
- height: 4,
+ if (isDesktop)
+ const Spacer(
+ flex: 10,
+ ),
+ if (!isDesktop)
+ Text(
+ widget.walletName,
+ style: STextStyles.itemSubtitle(context),
+ ),
+ SizedBox(
+ height: isDesktop ? 0 : 4,
),
Text(
"Recovery phrase",
- style: STextStyles.pageTitleH1(context),
+ style: isDesktop
+ ? STextStyles.desktopH2(context)
+ : STextStyles.pageTitleH1(context),
),
- const SizedBox(
- height: 8,
+ SizedBox(
+ height: isDesktop ? 16 : 8,
),
Text(
"Enter your $_seedWordCount-word recovery phrase.",
- style: STextStyles.subtitle(context),
+ style: isDesktop
+ ? STextStyles.desktopSubtitleH2(context)
+ : STextStyles.subtitle(context),
),
- const SizedBox(
- height: 10,
+ SizedBox(
+ height: isDesktop ? 16 : 10,
),
- Expanded(
- child: SingleChildScrollView(
- controller: controller,
- child: Padding(
- padding: const EdgeInsets.all(4.0),
- child: Form(
- key: _formKey,
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.stretch,
+ if (isDesktop)
+ Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ TextButton(
+ onPressed: pasteMnemonic,
+ child: Padding(
+ padding: const EdgeInsets.symmetric(
+ horizontal: 16.0,
+ vertical: 12,
+ ),
+ child: Row(
+ children: [
+ SvgPicture.asset(
+ Assets.svg.clipboard,
+ width: 22,
+ height: 22,
+ color: Theme.of(context)
+ .extension()!
+ .buttonTextSecondary,
+ ),
+ const SizedBox(
+ width: 8,
+ ),
+ Text(
+ "Paste",
+ style: STextStyles
+ .desktopButtonSmallSecondaryEnabled(context),
+ )
+ ],
+ ),
+ ),
+ ),
+ ],
+ ),
+ if (isDesktop)
+ const SizedBox(
+ height: 20,
+ ),
+ if (isDesktop)
+ ConstrainedBox(
+ constraints: const BoxConstraints(
+ maxWidth: 1008,
+ ),
+ child: Builder(
+ builder: (BuildContext context) {
+ const cols = 4;
+ final int rows = _seedWordCount ~/ cols;
+ final int remainder = _seedWordCount % cols;
+
+ return Column(
children: [
- for (int i = 1; i <= _seedWordCount; i++)
- Column(
- children: [
- Padding(
- padding:
- const EdgeInsets.symmetric(vertical: 4),
- child: TextFormField(
- textCapitalization: TextCapitalization.none,
- key: Key("restoreMnemonicFormField_$i"),
- decoration: _getInputDecorationFor(
- _inputStatuses[i - 1], "$i"),
- autovalidateMode:
- AutovalidateMode.onUserInteraction,
- selectionControls:
- i == 1 ? textSelectionControls : null,
- onChanged: (value) {
- if (value.isEmpty) {
- setState(() {
- _inputStatuses[i - 1] =
- FormInputStatus.empty;
- });
- } else if (_isValidMnemonicWord(
- value.trim().toLowerCase())) {
- setState(() {
- _inputStatuses[i - 1] =
- FormInputStatus.valid;
- });
- } else {
- setState(() {
- _inputStatuses[i - 1] =
- FormInputStatus.invalid;
- });
- }
- },
- controller: _controllers[i - 1],
- style: STextStyles.field(context).copyWith(
- color: Theme.of(context)
- .extension()!
- .overlay,
- ),
- ),
- ),
- if (_inputStatuses[i - 1] ==
- FormInputStatus.invalid)
- Align(
- alignment: Alignment.topLeft,
- child: Padding(
- padding: const EdgeInsets.only(
- left: 12.0,
- bottom: 4.0,
- ),
- child: Text(
- "Please check spelling",
- textAlign: TextAlign.left,
- style:
- STextStyles.label(context).copyWith(
- color: Theme.of(context)
- .extension()!
- .textError,
+ Form(
+ key: _formKey,
+ child: TableView(
+ shrinkWrap: true,
+ rowSpacing: 20,
+ rows: [
+ for (int i = 0; i < rows; i++)
+ TableViewRow(
+ crossAxisAlignment:
+ CrossAxisAlignment.start,
+ spacing: 16,
+ cells: [
+ for (int j = 1; j <= cols; j++)
+ TableViewCell(
+ flex: 1,
+ child: Column(
+ children: [
+ TextFormField(
+ textCapitalization:
+ TextCapitalization.none,
+ key: Key(
+ "restoreMnemonicFormField_$i"),
+ decoration:
+ _getInputDecorationFor(
+ _inputStatuses[
+ i * 4 + j - 1],
+ "${i * 4 + j}"),
+ autovalidateMode:
+ AutovalidateMode
+ .onUserInteraction,
+ selectionControls:
+ i * 4 + j - 1 == 1
+ ? textSelectionControls
+ : null,
+ onChanged: (value) {
+ if (value.isEmpty) {
+ setState(() {
+ _inputStatuses[
+ i * 4 + j - 1] =
+ FormInputStatus.empty;
+ });
+ } else if (_isValidMnemonicWord(
+ value
+ .trim()
+ .toLowerCase())) {
+ setState(() {
+ _inputStatuses[
+ i * 4 + j - 1] =
+ FormInputStatus.valid;
+ });
+ } else {
+ setState(() {
+ _inputStatuses[
+ i * 4 + j - 1] =
+ FormInputStatus
+ .invalid;
+ });
+ }
+ },
+ controller:
+ _controllers[i * 4 + j - 1],
+ style:
+ STextStyles.field(context)
+ .copyWith(
+ color: Theme.of(context)
+ .extension()!
+ .overlay,
+ fontSize: isDesktop ? 16 : 14,
+ ),
+ ),
+ if (_inputStatuses[
+ i * 4 + j - 1] ==
+ FormInputStatus.invalid)
+ Align(
+ alignment: Alignment.topLeft,
+ child: Padding(
+ padding:
+ const EdgeInsets.only(
+ left: 12.0,
+ bottom: 4.0,
+ ),
+ child: Text(
+ "Please check spelling",
+ textAlign: TextAlign.left,
+ style: STextStyles.label(
+ context)
+ .copyWith(
+ color: Theme.of(context)
+ .extension<
+ StackColors>()!
+ .textError,
+ ),
+ ),
+ ),
+ )
+ ],
+ ),
),
- ),
- ),
- )
+ ],
+ expandingChild: null,
+ ),
+ if (remainder > 0)
+ TableViewRow(
+ spacing: 16,
+ cells: [
+ for (int i = rows * cols;
+ i < _seedWordCount;
+ i++) ...[
+ TableViewCell(
+ flex: 1,
+ child: Column(
+ children: [
+ TextFormField(
+ textCapitalization:
+ TextCapitalization.none,
+ key: Key(
+ "restoreMnemonicFormField_$i"),
+ decoration:
+ _getInputDecorationFor(
+ _inputStatuses[i],
+ "${i + 1}"),
+ autovalidateMode:
+ AutovalidateMode
+ .onUserInteraction,
+ selectionControls: i == 1
+ ? textSelectionControls
+ : null,
+ onChanged: (value) {
+ if (value.isEmpty) {
+ setState(() {
+ _inputStatuses[i] =
+ FormInputStatus.empty;
+ });
+ } else if (_isValidMnemonicWord(
+ value
+ .trim()
+ .toLowerCase())) {
+ setState(() {
+ _inputStatuses[i] =
+ FormInputStatus.valid;
+ });
+ } else {
+ setState(() {
+ _inputStatuses[i] =
+ FormInputStatus
+ .invalid;
+ });
+ }
+ },
+ controller: _controllers[i],
+ style:
+ STextStyles.field(context)
+ .copyWith(
+ color: Theme.of(context)
+ .extension()!
+ .overlay,
+ fontSize: isDesktop ? 16 : 14,
+ ),
+ ),
+ if (_inputStatuses[i] ==
+ FormInputStatus.invalid)
+ Align(
+ alignment: Alignment.topLeft,
+ child: Padding(
+ padding:
+ const EdgeInsets.only(
+ left: 12.0,
+ bottom: 4.0,
+ ),
+ child: Text(
+ "Please check spelling",
+ textAlign: TextAlign.left,
+ style: STextStyles.label(
+ context)
+ .copyWith(
+ color: Theme.of(context)
+ .extension<
+ StackColors>()!
+ .textError,
+ ),
+ ),
+ ),
+ )
+ ],
+ ),
+ ),
+ ],
+ for (int i = remainder;
+ i < cols;
+ i++) ...[
+ TableViewCell(
+ flex: 1,
+ child: Container(),
+ ),
+ ],
+ ],
+ expandingChild: null,
+ ),
],
),
- Padding(
- padding: const EdgeInsets.only(
- top: 8.0,
- ),
- child: TextButton(
- style: Theme.of(context)
- .extension()!
- .getPrimaryEnabledButtonColor(context),
- onPressed: requestRestore,
- child: Text(
- "Restore",
- style: STextStyles.button(context),
- ),
- ),
+ ),
+ const SizedBox(
+ height: 32,
+ ),
+ PrimaryButton(
+ label: "Restore wallet",
+ width: 480,
+ onPressed: requestRestore,
),
],
+ );
+ },
+ ),
+ ),
+ if (isDesktop)
+ const Spacer(
+ flex: 15,
+ ),
+ if (!isDesktop)
+ Expanded(
+ child: SingleChildScrollView(
+ controller: controller,
+ child: Padding(
+ padding: const EdgeInsets.all(4.0),
+ child: Form(
+ key: _formKey,
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ for (int i = 1; i <= _seedWordCount; i++)
+ Column(
+ children: [
+ Padding(
+ padding:
+ const EdgeInsets.symmetric(vertical: 4),
+ child: TextFormField(
+ textCapitalization:
+ TextCapitalization.none,
+ key: Key("restoreMnemonicFormField_$i"),
+ decoration: _getInputDecorationFor(
+ _inputStatuses[i - 1], "$i"),
+ autovalidateMode:
+ AutovalidateMode.onUserInteraction,
+ selectionControls:
+ i == 1 ? textSelectionControls : null,
+ onChanged: (value) {
+ if (value.isEmpty) {
+ setState(() {
+ _inputStatuses[i - 1] =
+ FormInputStatus.empty;
+ });
+ } else if (_isValidMnemonicWord(
+ value.trim().toLowerCase())) {
+ setState(() {
+ _inputStatuses[i - 1] =
+ FormInputStatus.valid;
+ });
+ } else {
+ setState(() {
+ _inputStatuses[i - 1] =
+ FormInputStatus.invalid;
+ });
+ }
+ },
+ controller: _controllers[i - 1],
+ style:
+ STextStyles.field(context).copyWith(
+ color: Theme.of(context)
+ .extension()!
+ .overlay,
+ fontSize: isDesktop ? 16 : 14,
+ ),
+ ),
+ ),
+ if (_inputStatuses[i - 1] ==
+ FormInputStatus.invalid)
+ Align(
+ alignment: Alignment.topLeft,
+ child: Padding(
+ padding: const EdgeInsets.only(
+ left: 12.0,
+ bottom: 4.0,
+ ),
+ child: Text(
+ "Please check spelling",
+ textAlign: TextAlign.left,
+ style: STextStyles.label(context)
+ .copyWith(
+ color: Theme.of(context)
+ .extension()!
+ .textError,
+ ),
+ ),
+ ),
+ )
+ ],
+ ),
+ Padding(
+ padding: const EdgeInsets.only(
+ top: 8.0,
+ ),
+ child: PrimaryButton(
+ onPressed: requestRestore,
+ label: "Restore",
+ ),
+ ),
+ ],
+ ),
),
),
),
),
- ),
],
),
),
diff --git a/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/restore_succeeded_dialog.dart b/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/restore_succeeded_dialog.dart
index 2cd539c0c..51bb8f2d7 100644
--- a/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/restore_succeeded_dialog.dart
+++ b/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/restore_succeeded_dialog.dart
@@ -3,6 +3,10 @@ import 'package:flutter_svg/svg.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
+import 'package:stackwallet/utilities/util.dart';
+import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
+import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart';
+import 'package:stackwallet/widgets/desktop/primary_button.dart';
import 'package:stackwallet/widgets/stack_dialog.dart';
class RestoreSucceededDialog extends StatelessWidget {
@@ -10,27 +14,82 @@ class RestoreSucceededDialog extends StatelessWidget {
@override
Widget build(BuildContext context) {
- return StackDialog(
- title: "Wallet restored",
- message: "You can use your wallet now.",
- icon: SvgPicture.asset(
- Assets.svg.checkCircle,
- width: 24,
- height: 24,
- color: Theme.of(context).extension()!.accentColorGreen,
- ),
- rightButton: TextButton(
- style: Theme.of(context)
- .extension()!
- .getSecondaryEnabledButtonColor(context),
- child: Text(
- "Ok",
- style: STextStyles.itemSubtitle12(context),
+ if (Util.isDesktop) {
+ return DesktopDialog(
+ child: Column(
+ children: [
+ const DesktopDialogCloseButton(),
+ const Spacer(
+ flex: 1,
+ ),
+ SvgPicture.asset(
+ Assets.svg.checkCircle,
+ width: 40,
+ height: 40,
+ color:
+ Theme.of(context).extension()!.accentColorDark,
+ ),
+ const Spacer(
+ flex: 2,
+ ),
+ Text(
+ "Wallet restored",
+ style: STextStyles.desktopH2(context),
+ textAlign: TextAlign.center,
+ ),
+ const SizedBox(
+ height: 16,
+ ),
+ Text(
+ "You can use your wallet now.",
+ style: STextStyles.desktopTextMedium(context).copyWith(
+ color: Theme.of(context).extension()!.textDark3,
+ ),
+ textAlign: TextAlign.center,
+ ),
+ const Spacer(
+ flex: 2,
+ ),
+ Padding(
+ padding: const EdgeInsets.only(
+ left: 32,
+ right: 32,
+ bottom: 32,
+ ),
+ child: PrimaryButton(
+ width: 272.5,
+ label: "OK",
+ onPressed: () {
+ Navigator.of(context).pop();
+ },
+ ),
+ ),
+ ],
),
- onPressed: () {
- Navigator.of(context).pop();
- },
- ),
- );
+ );
+ } else {
+ return StackDialog(
+ title: "Wallet restored",
+ message: "You can use your wallet now.",
+ icon: SvgPicture.asset(
+ Assets.svg.checkCircle,
+ width: 24,
+ height: 24,
+ color: Theme.of(context).extension()!.accentColorGreen,
+ ),
+ rightButton: TextButton(
+ style: Theme.of(context)
+ .extension()!
+ .getSecondaryEnabledButtonColor(context),
+ child: Text(
+ "Ok",
+ style: STextStyles.itemSubtitle12(context),
+ ),
+ onPressed: () {
+ Navigator.of(context).pop();
+ },
+ ),
+ );
+ }
}
}
diff --git a/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/restoring_dialog.dart b/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/restoring_dialog.dart
index 80a688d03..001fff6c0 100644
--- a/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/restoring_dialog.dart
+++ b/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/restoring_dialog.dart
@@ -3,6 +3,10 @@ import 'package:flutter_svg/svg.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
+import 'package:stackwallet/utilities/util.dart';
+import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
+import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart';
+import 'package:stackwallet/widgets/desktop/secondary_button.dart';
import 'package:stackwallet/widgets/stack_dialog.dart';
class RestoringDialog extends StatefulWidget {
@@ -50,37 +54,105 @@ class _RestoringDialogState extends State
@override
Widget build(BuildContext context) {
- return WillPopScope(
- onWillPop: () async {
- return false;
- },
- child: StackDialog(
- title: "Restoring wallet",
- message: "This may take a while. Please do not exit this screen.",
- icon: RotationTransition(
- turns: _spinAnimation,
- child: SvgPicture.asset(Assets.svg.arrowRotate3,
- width: 24,
- height: 24,
- color:
- Theme.of(context).extension()!.accentColorDark),
+ if (Util.isDesktop) {
+ return DesktopDialog(
+ child: Column(
+ children: [
+ DesktopDialogCloseButton(
+ onPressedOverride: () async {
+ await onCancel.call();
+ if (mounted) {
+ Navigator.of(context).pop();
+ }
+ },
+ ),
+ const Spacer(
+ flex: 1,
+ ),
+ RotationTransition(
+ turns: _spinAnimation,
+ child: SvgPicture.asset(Assets.svg.arrowRotate3,
+ width: 40,
+ height: 40,
+ color: Theme.of(context)
+ .extension()!
+ .accentColorDark),
+ ),
+ const Spacer(
+ flex: 2,
+ ),
+ Text(
+ "Restoring wallet...",
+ style: STextStyles.desktopH2(context),
+ textAlign: TextAlign.center,
+ ),
+ const SizedBox(
+ height: 16,
+ ),
+ Text(
+ "Restoring your wallet may take a while.\nPlease do not exit this screen.",
+ style: STextStyles.desktopTextMedium(context).copyWith(
+ color: Theme.of(context).extension()!.textDark3,
+ ),
+ textAlign: TextAlign.center,
+ ),
+ const Spacer(
+ flex: 2,
+ ),
+ Padding(
+ padding: const EdgeInsets.only(
+ left: 32,
+ right: 32,
+ bottom: 32,
+ ),
+ child: SecondaryButton(
+ label: "Cancel",
+ width: 272.5,
+ onPressed: () async {
+ await onCancel.call();
+ if (mounted) {
+ Navigator.of(context).pop();
+ }
+ },
+ ),
+ ),
+ ],
),
- rightButton: TextButton(
- style: Theme.of(context)
- .extension()!
- .getSecondaryEnabledButtonColor(context),
- child: Text(
- "Cancel",
- style: STextStyles.itemSubtitle12(context),
+ );
+ } else {
+ return WillPopScope(
+ onWillPop: () async {
+ return false;
+ },
+ child: StackDialog(
+ title: "Restoring wallet",
+ message: "This may take a while. Please do not exit this screen.",
+ icon: RotationTransition(
+ turns: _spinAnimation,
+ child: SvgPicture.asset(Assets.svg.arrowRotate3,
+ width: 24,
+ height: 24,
+ color: Theme.of(context)
+ .extension()!
+ .accentColorDark),
+ ),
+ rightButton: TextButton(
+ style: Theme.of(context)
+ .extension()!
+ .getSecondaryEnabledButtonColor(context),
+ child: Text(
+ "Cancel",
+ style: STextStyles.itemSubtitle12(context),
+ ),
+ onPressed: () async {
+ await onCancel.call();
+ if (mounted) {
+ Navigator.of(context).pop();
+ }
+ },
),
- onPressed: () async {
- await onCancel.call();
- if (mounted) {
- Navigator.of(context).pop();
- }
- },
),
- ),
- );
+ );
+ }
}
}
diff --git a/lib/pages/add_wallet_views/verify_recovery_phrase_view/sub_widgets/word_table_item.dart b/lib/pages/add_wallet_views/verify_recovery_phrase_view/sub_widgets/word_table_item.dart
index 1cdc1a4f8..9f8f43b59 100644
--- a/lib/pages/add_wallet_views/verify_recovery_phrase_view/sub_widgets/word_table_item.dart
+++ b/lib/pages/add_wallet_views/verify_recovery_phrase_view/sub_widgets/word_table_item.dart
@@ -56,10 +56,23 @@ class WordTableItem extends ConsumerWidget {
textAlign: TextAlign.center,
style: isDesktop
? STextStyles.desktopTextExtraSmall(context).copyWith(
- color:
- Theme.of(context).extension()!.textDark,
+ color: selectedWord == word
+ ? Theme.of(context)
+ .extension()!
+ .textSelectedWordTableItem
+ : Theme.of(context)
+ .extension()!
+ .textDark,
)
- : STextStyles.baseXS(context),
+ : STextStyles.baseXS(context).copyWith(
+ color: selectedWord == word
+ ? Theme.of(context)
+ .extension()!
+ .textSelectedWordTableItem
+ : Theme.of(context)
+ .extension()!
+ .textDark,
+ ),
),
],
),
diff --git a/lib/pages/add_wallet_views/verify_recovery_phrase_view/verify_recovery_phrase_view.dart b/lib/pages/add_wallet_views/verify_recovery_phrase_view/verify_recovery_phrase_view.dart
index 5745c6b65..1e0b422cd 100644
--- a/lib/pages/add_wallet_views/verify_recovery_phrase_view/verify_recovery_phrase_view.dart
+++ b/lib/pages/add_wallet_views/verify_recovery_phrase_view/verify_recovery_phrase_view.dart
@@ -236,6 +236,10 @@ class _VerifyRecoveryPhraseViewState
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
+ if (isDesktop)
+ const Spacer(
+ flex: 10,
+ ),
SizedBox(
height: isDesktop ? 24 : 4,
),
@@ -349,6 +353,10 @@ class _VerifyRecoveryPhraseViewState
),
],
),
+ if (isDesktop)
+ const Spacer(
+ flex: 15,
+ ),
],
),
),
diff --git a/lib/pages/exchange_view/send_from_view.dart b/lib/pages/exchange_view/send_from_view.dart
index e677ab5c0..586ffc0da 100644
--- a/lib/pages/exchange_view/send_from_view.dart
+++ b/lib/pages/exchange_view/send_from_view.dart
@@ -85,7 +85,7 @@ class _SendFromViewState extends ConsumerState {
height: 8,
),
Text(
- "You need to send ${amount.toStringAsFixed(coin == Coin.monero ? 12 : 8)} ${coin.ticker}",
+ "You need to send ${amount.toStringAsFixed(coin == Coin.monero ? Constants.satsPerCoinMonero : coin == Coin.wownero ? Constants.satsPerCoinWownero : Constants.satsPerCoin)} ${coin.ticker}",
style: STextStyles.itemSubtitle(context),
),
const SizedBox(
@@ -307,7 +307,11 @@ class _SendFromCardState extends ConsumerState {
"${Format.localizedStringAsFixed(
value: snapshot.data!,
locale: locale,
- decimalPlaces: coin == Coin.monero ? 12 : 8,
+ decimalPlaces: coin == Coin.monero
+ ? Constants.satsPerCoinMonero
+ : coin == Coin.wownero
+ ? Constants.satsPerCoinWownero
+ : Constants.satsPerCoin,
)} ${coin.ticker}",
style: STextStyles.itemSubtitle(context),
);
diff --git a/lib/pages/exchange_view/sub_widgets/step_indicator.dart b/lib/pages/exchange_view/sub_widgets/step_indicator.dart
index fd0d3a859..96e1d4a4c 100644
--- a/lib/pages/exchange_view/sub_widgets/step_indicator.dart
+++ b/lib/pages/exchange_view/sub_widgets/step_indicator.dart
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
-import 'package:google_fonts/google_fonts.dart';
import 'package:stackwallet/utilities/assets.dart';
+import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
enum StepIndicatorStatus { current, completed, incomplete }
@@ -39,9 +39,7 @@ class StepIndicator extends StatelessWidget {
case StepIndicatorStatus.current:
return Text(
step.toString(),
- style: GoogleFonts.roboto(
- fontWeight: FontWeight.w600,
- fontSize: 8,
+ style: STextStyles.stepIndicator(context).copyWith(
color: Theme.of(context)
.extension()!
.stepIndicatorIconNumber,
@@ -57,9 +55,7 @@ class StepIndicator extends StatelessWidget {
case StepIndicatorStatus.incomplete:
return Text(
step.toString(),
- style: GoogleFonts.roboto(
- fontWeight: FontWeight.w600,
- fontSize: 8,
+ style: STextStyles.stepIndicator(context).copyWith(
color: Theme.of(context)
.extension()!
.stepIndicatorIconInactive,
diff --git a/lib/pages/manage_favorites_view/manage_favorites_view.dart b/lib/pages/manage_favorites_view/manage_favorites_view.dart
index 7d2b58781..7d15974a8 100644
--- a/lib/pages/manage_favorites_view/manage_favorites_view.dart
+++ b/lib/pages/manage_favorites_view/manage_favorites_view.dart
@@ -4,7 +4,10 @@ import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
+import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
+import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart';
+import 'package:stackwallet/widgets/desktop/desktop_scaffold.dart';
import 'package:stackwallet/widgets/managed_favorite.dart';
class ManageFavoritesView extends StatelessWidget {
@@ -15,142 +18,306 @@ class ManageFavoritesView extends StatelessWidget {
@override
Widget build(BuildContext context) {
debugPrint("BUILD: $runtimeType");
- return Scaffold(
- appBar: AppBar(
- title: Text(
- "Favorite wallets",
- style: STextStyles.navBarTitle(context),
- ),
- leading: AppBarBackButton(
- onPressed: () {
- Navigator.of(context).pop();
- },
- ),
- ),
- body: Container(
- color: Theme.of(context).extension()!.background,
- child: Padding(
- padding: const EdgeInsets.only(
- left: 12,
- right: 12,
- top: 4,
- ),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: [
- Padding(
- padding: const EdgeInsets.symmetric(horizontal: 4),
- child: Container(
- decoration: BoxDecoration(
- color: Theme.of(context).extension()!.popupBG,
- borderRadius: BorderRadius.circular(
- Constants.size.circularBorderRadius,
- ),
- ),
- child: Padding(
- padding: const EdgeInsets.all(12.0),
- child: Text(
- "Drag to change wallet order.",
- style: STextStyles.label(context),
- ),
- ),
+
+ final isDesktop = Util.isDesktop;
+
+ return MasterScaffold(
+ isDesktop: isDesktop,
+ appBar: isDesktop
+ ? DesktopAppBar(
+ background: Theme.of(context).extension()!.popupBG,
+ isCompactHeight: true,
+ leading: const AppBarBackButton(
+ isCompact: true,
+ ),
+ center: Expanded(
+ child: Text(
+ "Favorite wallets",
+ style: STextStyles.desktopH3(context),
),
),
- const SizedBox(
- height: 8,
+ )
+ : AppBar(
+ title: Text(
+ "Favorite wallets",
+ style: STextStyles.navBarTitle(context),
),
- Expanded(
- child: Consumer(
- builder: (_, ref, __) {
- final favorites = ref.watch(favoritesProvider);
- return ReorderableListView.builder(
- key: key,
- itemCount: favorites.length,
- itemBuilder: (builderContext, index) {
- final walletId = ref.read(favorites[index]).walletId;
- return Padding(
- key: Key(
- "manageFavoriteWalletsItem_$walletId",
- ),
- padding: const EdgeInsets.all(4.0),
- child: ManagedFavorite(
- walletId: walletId,
- ),
- );
- },
- onReorder: (oldIndex, newIndex) {
- ref
- .read(walletsServiceChangeNotifierProvider)
- .moveFavorite(
- fromIndex: oldIndex, toIndex: newIndex);
+ leading: AppBarBackButton(
+ onPressed: () {
+ Navigator.of(context).pop();
+ },
+ ),
+ ),
+ body: isDesktop
+ ? Consumer(
+ builder: (_, ref, __) {
+ final favorites = ref.watch(favoritesProvider);
+ final nonFavorites = ref.watch(nonFavoritesProvider);
- ref
- .read(favoritesProvider)
- .reorder(oldIndex, newIndex, true);
- },
- proxyDecorator: (child, index, animation) {
- return Material(
- elevation: 15,
- color: Colors.transparent,
- // shadowColor: Colors.red,
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.all(
- Radius.circular(
- Constants.size.circularBorderRadius * 1.5,
+ return Column(
+ children: [
+ const SizedBox(
+ height: 24,
+ ),
+ Expanded(
+ child: ListView(
+ children: [
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 24),
+ child: Container(
+ decoration: BoxDecoration(
+ color: Theme.of(context)
+ .extension()!
+ .popupBG,
+ borderRadius: BorderRadius.circular(
+ Constants.size.circularBorderRadius,
+ ),
+ ),
+ child: Padding(
+ padding: const EdgeInsets.all(12.0),
+ child: Text(
+ "Drag to change wallet order.",
+ style:
+ STextStyles.desktopTextExtraSmall(context)
+ .copyWith(
+ color: Theme.of(context)
+ .extension()!
+ .textSubtitle1,
+ ),
+ ),
),
),
),
- child: child,
- );
- },
- );
- },
- ),
- ),
- Padding(
- padding: const EdgeInsets.only(
- top: 30,
- bottom: 12,
- left: 4,
- right: 4,
- ),
- child: Text(
- "Add to favorites",
- style: STextStyles.itemSubtitle12(context).copyWith(
- color:
- Theme.of(context).extension()!.textDark3,
- ),
- ),
- ),
- Expanded(
- child: Consumer(
- builder: (_, ref, __) {
- final nonFavorites = ref.watch(nonFavoritesProvider);
+ const SizedBox(
+ height: 5,
+ ),
+ ReorderableListView.builder(
+ buildDefaultDragHandles: false,
+ shrinkWrap: true,
+ primary: false,
+ key: key,
+ itemCount: favorites.length,
+ itemBuilder: (builderContext, index) {
+ final walletId =
+ ref.read(favorites[index]).walletId;
+ return Padding(
+ key: Key(
+ "manageFavoriteWalletsItem_$walletId",
+ ),
+ padding: const EdgeInsets.symmetric(
+ vertical: 5,
+ horizontal: 24,
+ ),
+ child: ReorderableDelayedDragStartListener(
+ index: index,
+ child: ManagedFavorite(
+ walletId: walletId,
+ ),
+ ),
+ );
+ },
+ onReorder: (oldIndex, newIndex) {
+ ref
+ .read(walletsServiceChangeNotifierProvider)
+ .moveFavorite(
+ fromIndex: oldIndex, toIndex: newIndex);
- return ListView.builder(
- itemCount: nonFavorites.length,
- itemBuilder: (buildContext, index) {
- // final walletId = ref.watch(
- // nonFavorites[index].select((value) => value.walletId));
- final walletId = ref.read(nonFavorites[index]).walletId;
- return Padding(
- key: Key(
- "manageNonFavoriteWalletsItem_$walletId",
+ ref
+ .read(favoritesProvider)
+ .reorder(oldIndex, newIndex, true);
+ },
+ proxyDecorator: (child, index, animation) {
+ return Material(
+ elevation: 15,
+ color: Colors.transparent,
+ // shadowColor: Colors.red,
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.all(
+ Radius.circular(
+ Constants.size.circularBorderRadius * 1.5,
+ ),
+ ),
+ ),
+ child: child,
+ );
+ },
),
- padding: const EdgeInsets.all(4.0),
- child: ManagedFavorite(
- walletId: walletId,
+ Padding(
+ padding: const EdgeInsets.only(
+ top: 32,
+ bottom: 11,
+ left: 24,
+ right: 24,
+ ),
+ child: Text(
+ "Add to favorites",
+ style:
+ STextStyles.itemSubtitle12(context).copyWith(
+ color: Theme.of(context)
+ .extension()!
+ .textDark3,
+ ),
+ ),
),
- );
- },
- );
- },
+ ListView.builder(
+ shrinkWrap: true,
+ primary: false,
+ itemCount: nonFavorites.length,
+ itemBuilder: (buildContext, index) {
+ // final walletId = ref.watch(
+ // nonFavorites[index].select((value) => value.walletId));
+ final walletId =
+ ref.read(nonFavorites[index]).walletId;
+ return Padding(
+ key: Key(
+ "manageNonFavoriteWalletsItem_$walletId",
+ ),
+ padding: const EdgeInsets.symmetric(
+ horizontal: 24,
+ vertical: 5,
+ ),
+ child: ManagedFavorite(
+ walletId: walletId,
+ ),
+ );
+ },
+ )
+ ],
+ ),
+ ),
+ ],
+ );
+ },
+ )
+ : Container(
+ color: Theme.of(context).extension()!.background,
+ child: Padding(
+ padding: const EdgeInsets.only(
+ left: 12,
+ right: 12,
+ top: 4,
+ ),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 4),
+ child: Container(
+ decoration: BoxDecoration(
+ color: Theme.of(context)
+ .extension()!
+ .popupBG,
+ borderRadius: BorderRadius.circular(
+ Constants.size.circularBorderRadius,
+ ),
+ ),
+ child: Padding(
+ padding: const EdgeInsets.all(12.0),
+ child: Text(
+ "Drag to change wallet order.",
+ style: STextStyles.label(context),
+ ),
+ ),
+ ),
+ ),
+ const SizedBox(
+ height: 8,
+ ),
+ Expanded(
+ child: Consumer(
+ builder: (_, ref, __) {
+ final favorites = ref.watch(favoritesProvider);
+ return ReorderableListView.builder(
+ key: key,
+ itemCount: favorites.length,
+ itemBuilder: (builderContext, index) {
+ final walletId =
+ ref.read(favorites[index]).walletId;
+ return Padding(
+ key: Key(
+ "manageFavoriteWalletsItem_$walletId",
+ ),
+ padding: const EdgeInsets.all(4.0),
+ child: ManagedFavorite(
+ walletId: walletId,
+ ),
+ );
+ },
+ onReorder: (oldIndex, newIndex) {
+ ref
+ .read(walletsServiceChangeNotifierProvider)
+ .moveFavorite(
+ fromIndex: oldIndex, toIndex: newIndex);
+
+ ref
+ .read(favoritesProvider)
+ .reorder(oldIndex, newIndex, true);
+ },
+ proxyDecorator: (child, index, animation) {
+ return Material(
+ elevation: 15,
+ color: Colors.transparent,
+ // shadowColor: Colors.red,
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.all(
+ Radius.circular(
+ Constants.size.circularBorderRadius * 1.5,
+ ),
+ ),
+ ),
+ child: child,
+ );
+ },
+ );
+ },
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsets.only(
+ top: 30,
+ bottom: 12,
+ left: 4,
+ right: 4,
+ ),
+ child: Text(
+ "Add to favorites",
+ style: STextStyles.itemSubtitle12(context).copyWith(
+ color: Theme.of(context)
+ .extension()!
+ .textDark3,
+ ),
+ ),
+ ),
+ Expanded(
+ child: Consumer(
+ builder: (_, ref, __) {
+ final nonFavorites = ref.watch(nonFavoritesProvider);
+
+ return ListView.builder(
+ itemCount: nonFavorites.length,
+ itemBuilder: (buildContext, index) {
+ // final walletId = ref.watch(
+ // nonFavorites[index].select((value) => value.walletId));
+ final walletId =
+ ref.read(nonFavorites[index]).walletId;
+ return Padding(
+ key: Key(
+ "manageNonFavoriteWalletsItem_$walletId",
+ ),
+ padding: const EdgeInsets.all(4.0),
+ child: ManagedFavorite(
+ walletId: walletId,
+ ),
+ );
+ },
+ );
+ },
+ ),
+ ),
+ ],
),
),
- ],
- ),
- ),
- ),
+ ),
);
}
}
diff --git a/lib/pages/pinpad_views/create_pin_view.dart b/lib/pages/pinpad_views/create_pin_view.dart
index c4e4ee592..f8b84cfb4 100644
--- a/lib/pages/pinpad_views/create_pin_view.dart
+++ b/lib/pages/pinpad_views/create_pin_view.dart
@@ -3,7 +3,6 @@ import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
-import 'package:google_fonts/google_fonts.dart';
import 'package:stackwallet/notifications/show_flush_bar.dart';
import 'package:stackwallet/pages/home_view/home_view.dart';
import 'package:stackwallet/providers/global/prefs_provider.dart';
@@ -188,7 +187,10 @@ class _CreatePinViewState extends ConsumerState {
fieldsCount: Constants.pinLength,
eachFieldHeight: 12,
eachFieldWidth: 12,
- textStyle: GoogleFonts.workSans(
+ textStyle: STextStyles.infoSmall(context).copyWith(
+ color: Theme.of(context)
+ .extension()!
+ .textSubtitle3,
fontSize: 1,
),
focusNode: _pinPutFocusNode2,
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 0cf3ebc4f..143b1e84d 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
@@ -90,6 +90,7 @@ class _AddEditNodeViewState extends ConsumerState {
break;
case Coin.monero:
+ case Coin.wownero:
try {
final uri = Uri.parse(formData.host!);
if (uri.scheme.startsWith("http")) {
@@ -113,12 +114,12 @@ class _AddEditNodeViewState extends ConsumerState {
break;
case Coin.bitcoin:
- // case Coin.bitcoincash:
+ case Coin.bitcoincash:
case Coin.dogecoin:
case Coin.firo:
case Coin.namecoin:
case Coin.bitcoinTestNet:
- // case Coin.bitcoincashTestnet:
+ case Coin.bitcoincashTestnet:
case Coin.firoTestNet:
case Coin.dogecoinTestNet:
final client = ElectrumX(
@@ -384,6 +385,7 @@ class _AddEditNodeViewState extends ConsumerState {
// strip unused path
String address = formData.host!;
if (coin == Coin.monero ||
+ coin == Coin.wownero ||
coin == Coin.epicCash) {
if (address.startsWith("http")) {
final uri = Uri.parse(address);
@@ -530,15 +532,16 @@ class _NodeFormState extends ConsumerState {
case Coin.dogecoin:
case Coin.firo:
case Coin.namecoin:
- // case Coin.bitcoincash:
+ case Coin.bitcoincash:
case Coin.bitcoinTestNet:
- // case Coin.bitcoincashTestnet:
+ case Coin.bitcoincashTestnet:
case Coin.firoTestNet:
case Coin.dogecoinTestNet:
return false;
case Coin.epicCash:
case Coin.monero:
+ case Coin.wownero:
return true;
}
}
@@ -699,7 +702,9 @@ class _NodeFormState extends ConsumerState {
focusNode: _hostFocusNode,
style: STextStyles.field(context),
decoration: standardInputDecoration(
- (widget.coin != Coin.monero && widget.coin != Coin.epicCash)
+ (widget.coin != Coin.monero &&
+ widget.coin != Coin.wownero &&
+ widget.coin != Coin.epicCash)
? "IP address"
: "Url",
_hostFocusNode,
@@ -880,7 +885,9 @@ class _NodeFormState extends ConsumerState {
const SizedBox(
height: 8,
),
- if (widget.coin != Coin.monero && widget.coin != Coin.epicCash)
+ if (widget.coin != Coin.monero &&
+ widget.coin != Coin.wownero &&
+ widget.coin != Coin.epicCash)
Row(
children: [
GestureDetector(
@@ -931,11 +938,15 @@ class _NodeFormState extends ConsumerState {
),
],
),
- if (widget.coin != Coin.monero && widget.coin != Coin.epicCash)
+ if (widget.coin != Coin.monero &&
+ widget.coin != Coin.wownero &&
+ widget.coin != Coin.epicCash)
const SizedBox(
height: 8,
),
- if (widget.coin != Coin.monero && widget.coin != Coin.epicCash)
+ if (widget.coin != Coin.monero &&
+ widget.coin != Coin.wownero &&
+ widget.coin != Coin.epicCash)
Row(
children: [
GestureDetector(
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 377905630..8baddb700 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
@@ -81,6 +81,7 @@ class _NodeDetailsViewState extends ConsumerState {
break;
case Coin.monero:
+ case Coin.wownero:
try {
final uri = Uri.parse(node!.host);
if (uri.scheme.startsWith("http")) {
@@ -102,9 +103,9 @@ class _NodeDetailsViewState extends ConsumerState {
case Coin.bitcoinTestNet:
case Coin.firoTestNet:
case Coin.dogecoinTestNet:
- // case Coin.bitcoincash:
+ case Coin.bitcoincash:
case Coin.namecoin:
- // case Coin.bitcoincashTestnet:
+ case Coin.bitcoincashTestnet:
final client = ElectrumX(
host: node!.host,
port: node.port,
diff --git a/lib/pages/settings_views/global_settings_view/security_views/change_pin_view/change_pin_view.dart b/lib/pages/settings_views/global_settings_view/security_views/change_pin_view/change_pin_view.dart
index f083eb63a..39c95cad7 100644
--- a/lib/pages/settings_views/global_settings_view/security_views/change_pin_view/change_pin_view.dart
+++ b/lib/pages/settings_views/global_settings_view/security_views/change_pin_view/change_pin_view.dart
@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
-import 'package:google_fonts/google_fonts.dart';
import 'package:stackwallet/notifications/show_flush_bar.dart';
import 'package:stackwallet/pages/settings_views/global_settings_view/security_views/security_view.dart';
import 'package:stackwallet/utilities/assets.dart';
@@ -168,7 +167,10 @@ class _ChangePinViewState extends State {
fieldsCount: Constants.pinLength,
eachFieldHeight: 12,
eachFieldWidth: 12,
- textStyle: GoogleFonts.workSans(
+ textStyle: STextStyles.infoSmall(context).copyWith(
+ color: Theme.of(context)
+ .extension()!
+ .textSubtitle3,
fontSize: 1,
),
focusNode: _pinPutFocusNode2,
diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart b/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart
index 892cd13d8..c4045dc9b 100644
--- a/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart
+++ b/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart
@@ -12,6 +12,7 @@ import 'package:stackwallet/pages/settings_views/wallet_settings_view/wallet_net
import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/services/coins/epiccash/epiccash_wallet.dart';
import 'package:stackwallet/services/coins/monero/monero_wallet.dart';
+import 'package:stackwallet/services/coins/wownero/wownero_wallet.dart';
import 'package:stackwallet/services/event_bus/events/global/blocks_remaining_event.dart';
import 'package:stackwallet/services/event_bus/events/global/node_connection_status_changed_event.dart';
import 'package:stackwallet/services/event_bus/events/global/refresh_percent_changed_event.dart';
@@ -205,7 +206,7 @@ class _WalletNetworkSettingsViewState
.getManager(widget.walletId)
.coin;
- if (coin == Coin.monero || coin == Coin.epicCash) {
+ if (coin == Coin.monero || coin == Coin.wownero || coin == Coin.epicCash) {
_blocksRemainingSubscription = eventBus.on().listen(
(event) async {
if (event.walletId == widget.walletId) {
@@ -271,6 +272,15 @@ class _WalletNetworkSettingsViewState
if (_percent < highestPercent) {
_percent = highestPercent.clamp(0.0, 1.0);
}
+ } else if (coin == Coin.wownero) {
+ double highestPercent = (ref
+ .read(walletsChangeNotifierProvider)
+ .getManager(widget.walletId)
+ .wallet as WowneroWallet)
+ .highestPercentCached;
+ if (_percent < highestPercent) {
+ _percent = highestPercent.clamp(0.0, 1.0);
+ }
} else if (coin == Coin.epicCash) {
double highestPercent = (ref
.read(walletsChangeNotifierProvider)
@@ -545,6 +555,7 @@ class _WalletNetworkSettingsViewState
),
),
if (coin == Coin.monero ||
+ coin == Coin.wownero ||
coin == Coin.epicCash)
Text(
" (Blocks to go: ${_blocksRemaining == -1 ? "?" : _blocksRemaining})",
diff --git a/lib/pages/wallet_view/transaction_views/transaction_details_view.dart b/lib/pages/wallet_view/transaction_views/transaction_details_view.dart
index 391b5caec..fdb8bf1a9 100644
--- a/lib/pages/wallet_view/transaction_views/transaction_details_view.dart
+++ b/lib/pages/wallet_view/transaction_views/transaction_details_view.dart
@@ -241,7 +241,9 @@ class _TransactionDetailsViewState
"$amountPrefix${Format.localizedStringAsFixed(
value: coin == Coin.monero
? (amount / 10000.toDecimal()).toDecimal()
- : amount,
+ : coin == Coin.wownero
+ ? (amount / 1000.toDecimal()).toDecimal()
+ : amount,
locale: ref.watch(
localeServiceChangeNotifierProvider
.select((value) => value.locale),
@@ -254,7 +256,7 @@ class _TransactionDetailsViewState
height: 2,
),
SelectableText(
- "${Format.localizedStringAsFixed(value: (coin == Coin.monero ? (amount / 10000.toDecimal()).toDecimal() : amount) * ref.watch(priceAnd24hChangeNotifierProvider.select((value) => value.getPrice(coin).item1)), locale: ref.watch(
+ "${Format.localizedStringAsFixed(value: (coin == Coin.monero ? (amount / 10000.toDecimal()).toDecimal() : coin == Coin.wownero ? (amount / 1000.toDecimal()).toDecimal() : amount) * ref.watch(priceAnd24hChangeNotifierProvider.select((value) => value.getPrice(coin).item1)), locale: ref.watch(
localeServiceChangeNotifierProvider
.select((value) => value.locale),
), decimalPlaces: 2)} ${ref.watch(
@@ -298,14 +300,14 @@ class _TransactionDetailsViewState
],
),
),
- if (!(coin == Coin.monero &&
+ if (!((coin == Coin.monero || coin == Coin.wownero) &&
_transaction.txType.toLowerCase() == "sent") &&
!((coin == Coin.firo || coin == Coin.firoTestNet) &&
_transaction.subType == "mint"))
const SizedBox(
height: 12,
),
- if (!(coin == Coin.monero &&
+ if (!((coin == Coin.monero || coin == Coin.wownero) &&
_transaction.txType.toLowerCase() == "sent") &&
!((coin == Coin.firo || coin == Coin.firoTestNet) &&
_transaction.subType == "mint"))
@@ -464,7 +466,10 @@ class _TransactionDetailsViewState
? Format.localizedStringAsFixed(
value: coin == Coin.monero
? (fee / 10000.toDecimal()).toDecimal()
- : fee,
+ : coin == Coin.wownero
+ ? (fee / 1000.toDecimal())
+ .toDecimal()
+ : fee,
locale: ref.watch(
localeServiceChangeNotifierProvider
.select((value) => value.locale)),
@@ -473,7 +478,9 @@ class _TransactionDetailsViewState
: Format.localizedStringAsFixed(
value: coin == Coin.monero
? (fee / 10000.toDecimal()).toDecimal()
- : fee,
+ : coin == Coin.wownero
+ ? (fee / 1000.toDecimal()).toDecimal()
+ : fee,
locale: ref.watch(
localeServiceChangeNotifierProvider
.select((value) => value.locale)),
diff --git a/lib/pages/wallet_view/transaction_views/transaction_search_filter_view.dart b/lib/pages/wallet_view/transaction_views/transaction_search_filter_view.dart
index 48fe89e65..8175597f6 100644
--- a/lib/pages/wallet_view/transaction_views/transaction_search_filter_view.dart
+++ b/lib/pages/wallet_view/transaction_views/transaction_search_filter_view.dart
@@ -4,7 +4,6 @@ import 'package:flutter/services.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_rounded_date_picker/flutter_rounded_date_picker.dart';
import 'package:flutter_svg/svg.dart';
-import 'package:google_fonts/google_fonts.dart';
import 'package:stackwallet/models/transaction_filter.dart';
import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/providers/ui/color_theme_provider.dart';
@@ -122,77 +121,43 @@ class _TransactionSearchViewState
colorArrowNext: Theme.of(context).extension()!.textSubtitle1,
colorArrowPrevious:
Theme.of(context).extension()!.textSubtitle1,
- textStyleButtonNegative: GoogleFonts.inter(
- letterSpacing: 0.5,
+ textStyleButtonNegative: STextStyles.datePicker600(context).copyWith(
color: baseColor,
- fontSize: 16,
- fontWeight: FontWeight.w600,
),
- textStyleButtonPositive: GoogleFonts.inter(
- letterSpacing: 0.5,
+ textStyleButtonPositive: STextStyles.datePicker600(context).copyWith(
color: baseColor,
- fontSize: 16,
- fontWeight: FontWeight.w600,
),
- textStyleCurrentDayOnCalendar: GoogleFonts.inter(
- letterSpacing: 0.5,
- color: Theme.of(context).extension()!.accentColorDark,
- fontWeight: FontWeight.w400,
- fontSize: 12,
- ),
- textStyleDayHeader: GoogleFonts.inter(
- letterSpacing: 0.5,
- color: Theme.of(context).extension()!.accentColorDark,
- fontSize: 16,
- fontWeight: FontWeight.w600,
- ),
- textStyleDayOnCalendar: GoogleFonts.inter(
- letterSpacing: 0.5,
+ textStyleCurrentDayOnCalendar: STextStyles.datePicker400(context),
+ textStyleDayHeader: STextStyles.datePicker600(context),
+ textStyleDayOnCalendar: STextStyles.datePicker400(context).copyWith(
color: baseColor,
- fontSize: 12,
- fontWeight: FontWeight.w400,
),
- textStyleDayOnCalendarDisabled: GoogleFonts.inter(
- letterSpacing: 0.5,
+ textStyleDayOnCalendarDisabled:
+ STextStyles.datePicker400(context).copyWith(
color: Theme.of(context).extension()!.textSubtitle3,
- fontWeight: FontWeight.w400,
- fontSize: 12,
),
- textStyleDayOnCalendarSelected: GoogleFonts.inter(
- letterSpacing: 0.5,
+ textStyleDayOnCalendarSelected:
+ STextStyles.datePicker400(context).copyWith(
color: Theme.of(context).extension()!.textWhite,
- fontWeight: FontWeight.w400,
- fontSize: 12,
),
- textStyleMonthYearHeader: GoogleFonts.inter(
- letterSpacing: 0.5,
+ textStyleMonthYearHeader: STextStyles.datePicker600(context).copyWith(
color: Theme.of(context).extension()!.textSubtitle1,
- fontSize: 16,
- fontWeight: FontWeight.w600,
),
- textStyleYearButton: GoogleFonts.inter(
- letterSpacing: 0.5,
+ textStyleYearButton: STextStyles.datePicker600(context).copyWith(
color: Theme.of(context).extension()!.textWhite,
- fontSize: 16,
- fontWeight: FontWeight.w600,
),
- textStyleButtonAction: GoogleFonts.inter(),
+ // textStyleButtonAction: GoogleFonts.inter(),
);
}
MaterialRoundedYearPickerStyle _buildYearPickerStyle() {
return MaterialRoundedYearPickerStyle(
backgroundPicker: Theme.of(context).extension()!.popupBG,
- textStyleYear: GoogleFonts.inter(
- letterSpacing: 0.5,
+ textStyleYear: STextStyles.datePicker600(context).copyWith(
color: Theme.of(context).extension()!.textSubtitle2,
- fontWeight: FontWeight.w600,
fontSize: 16,
),
- textStyleYearSelected: GoogleFonts.inter(
- letterSpacing: 0.5,
- color: Theme.of(context).extension()!.accentColorDark,
- fontWeight: FontWeight.w600,
+ textStyleYearSelected: STextStyles.datePicker600(context).copyWith(
fontSize: 18,
),
);
@@ -790,6 +755,11 @@ class _TransactionSearchViewState
.floor()
.toBigInt()
.toInt();
+ } else if (widget.coin == Coin.wownero) {
+ amount = (amountDecimal * Decimal.fromInt(Constants.satsPerCoinWownero))
+ .floor()
+ .toBigInt()
+ .toInt();
} else {
amount = (amountDecimal * Decimal.fromInt(Constants.satsPerCoin))
.floor()
diff --git a/lib/pages_desktop_specific/home/desktop_home_view.dart b/lib/pages_desktop_specific/home/desktop_home_view.dart
index bd4996ec1..adfcdfb6a 100644
--- a/lib/pages_desktop_specific/home/desktop_home_view.dart
+++ b/lib/pages_desktop_specific/home/desktop_home_view.dart
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:stackwallet/pages_desktop_specific/home/desktop_menu.dart';
import 'package:stackwallet/pages_desktop_specific/home/my_stack_view/my_stack_view.dart';
+import 'package:stackwallet/route_generator.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
class DesktopHomeView extends ConsumerStatefulWidget {
@@ -16,12 +17,9 @@ class DesktopHomeView extends ConsumerStatefulWidget {
class _DesktopHomeViewState extends ConsumerState {
int currentViewIndex = 0;
final List contentViews = [
- // const Navigator(
- // onGenerateRoute: RouteGenerator.generateRoute,
- // initialRoute: MyStackView.routeName,
- // ),
- const MyStackView(
- key: Key("myStackViewKey"),
+ const Navigator(
+ onGenerateRoute: RouteGenerator.generateRoute,
+ initialRoute: MyStackView.routeName,
),
Container(
color: Colors.green,
diff --git a/lib/pages_desktop_specific/home/my_stack_view/desktop_favorite_wallets.dart b/lib/pages_desktop_specific/home/my_stack_view/desktop_favorite_wallets.dart
new file mode 100644
index 000000000..91130fe19
--- /dev/null
+++ b/lib/pages_desktop_specific/home/my_stack_view/desktop_favorite_wallets.dart
@@ -0,0 +1,137 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:flutter_svg/svg.dart';
+import 'package:stackwallet/pages/manage_favorites_view/manage_favorites_view.dart';
+import 'package:stackwallet/pages/wallets_view/sub_widgets/favorite_card.dart';
+import 'package:stackwallet/providers/providers.dart';
+import 'package:stackwallet/utilities/assets.dart';
+import 'package:stackwallet/utilities/constants.dart';
+import 'package:stackwallet/utilities/text_styles.dart';
+import 'package:stackwallet/utilities/theme/stack_colors.dart';
+import 'package:stackwallet/widgets/custom_buttons/blue_text_button.dart';
+
+class DesktopFavoriteWallets extends ConsumerWidget {
+ const DesktopFavoriteWallets({Key? key}) : super(key: key);
+
+ static const cardWidth = 220.0;
+ static const cardHeight = 125.0;
+ static const standardPadding = 16.0;
+
+ @override
+ Widget build(BuildContext context, WidgetRef ref) {
+ debugPrint("BUILD: $runtimeType");
+
+ final favorites = ref.watch(favoritesProvider);
+ bool hasFavorites = favorites.length > 0;
+
+ return Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [
+ Text(
+ "Favorite wallets",
+ style: STextStyles.desktopTextExtraSmall(context).copyWith(
+ color: Theme.of(context)
+ .extension()!
+ .textFieldActiveSearchIconRight,
+ ),
+ ),
+ BlueTextButton(
+ text: "Edit",
+ onTap: () {
+ Navigator.of(context).pushNamed(ManageFavoritesView.routeName);
+ },
+ ),
+ ],
+ ),
+ const SizedBox(
+ height: 20,
+ ),
+ ConstrainedBox(
+ constraints: const BoxConstraints(
+ maxHeight: (cardHeight * 2) + standardPadding,
+ minHeight: cardHeight,
+ ),
+ child: hasFavorites
+ ? SingleChildScrollView(
+ primary: false,
+ child: Wrap(
+ spacing: 16,
+ runSpacing: 16,
+ children: [
+ ...favorites.map((p0) {
+ final walletId = ref.read(p0).walletId;
+ final managerProvider = ref
+ .read(walletsChangeNotifierProvider)
+ .getManagerProvider(walletId);
+
+ return FavoriteCard(
+ walletId: walletId,
+ width: cardWidth,
+ height: cardHeight,
+ managerProvider: managerProvider,
+ );
+ })
+ ],
+ ),
+ )
+ : Container(
+ height: cardHeight,
+ width: cardWidth,
+ decoration: BoxDecoration(
+ color: Theme.of(context)
+ .extension()!
+ .textFieldDefaultBG,
+ borderRadius: BorderRadius.circular(
+ Constants.size.circularBorderRadius,
+ ),
+ ),
+ child: MaterialButton(
+ splashColor:
+ Theme.of(context).extension()!.highlight,
+ key: const Key("favoriteWalletsAddFavoriteButtonKey"),
+ padding: const EdgeInsets.all(12),
+ materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(
+ Constants.size.circularBorderRadius),
+ ),
+ onPressed: () {
+ Navigator.of(context)
+ .pushNamed(ManageFavoritesView.routeName);
+ },
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ SvgPicture.asset(
+ Assets.svg.plus,
+ width: 14,
+ height: 14,
+ color: Theme.of(context)
+ .extension()!
+ .textSubtitle1,
+ ),
+ const SizedBox(
+ width: 4,
+ ),
+ Text(
+ "Add a favorite",
+ style: STextStyles.itemSubtitle(context).copyWith(
+ fontSize: 18,
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ ),
+ const SizedBox(
+ height: 40,
+ ),
+ ],
+ );
+ }
+}
diff --git a/lib/pages_desktop_specific/home/my_stack_view/my_stack_view.dart b/lib/pages_desktop_specific/home/my_stack_view/my_stack_view.dart
index b7860542a..6b60902c4 100644
--- a/lib/pages_desktop_specific/home/my_stack_view/my_stack_view.dart
+++ b/lib/pages_desktop_specific/home/my_stack_view/my_stack_view.dart
@@ -3,7 +3,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:stackwallet/pages/wallets_view/sub_widgets/empty_wallets.dart';
import 'package:stackwallet/pages_desktop_specific/home/my_stack_view/my_wallets.dart';
-import 'package:stackwallet/providers/global/prefs_provider.dart';
import 'package:stackwallet/providers/global/wallets_provider.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/text_styles.dart';
@@ -24,9 +23,6 @@ class _MyStackViewState extends ConsumerState {
debugPrint("BUILD: $runtimeType");
final hasWallets = ref.watch(walletsChangeNotifierProvider).hasWallets;
- final showFavorites = ref.watch(prefsChangeNotifierProvider
- .select((value) => value.showFavoriteWallets));
-
return Column(
children: [
DesktopAppBar(
diff --git a/lib/pages_desktop_specific/home/my_stack_view/my_wallets.dart b/lib/pages_desktop_specific/home/my_stack_view/my_wallets.dart
index e41c7643d..550db293e 100644
--- a/lib/pages_desktop_specific/home/my_stack_view/my_wallets.dart
+++ b/lib/pages_desktop_specific/home/my_stack_view/my_wallets.dart
@@ -1,46 +1,32 @@
import 'package:flutter/material.dart';
+import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:stackwallet/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart';
+import 'package:stackwallet/pages_desktop_specific/home/my_stack_view/desktop_favorite_wallets.dart';
import 'package:stackwallet/pages_desktop_specific/home/my_stack_view/wallet_summary_table.dart';
+import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/blue_text_button.dart';
-class MyWallets extends StatefulWidget {
+class MyWallets extends ConsumerStatefulWidget {
const MyWallets({Key? key}) : super(key: key);
@override
- State createState() => _MyWalletsState();
+ ConsumerState createState() => _MyWalletsState();
}
-class _MyWalletsState extends State {
+class _MyWalletsState extends ConsumerState {
@override
Widget build(BuildContext context) {
+ final showFavorites = ref.watch(prefsChangeNotifierProvider
+ .select((value) => value.showFavoriteWallets));
+
return Padding(
padding: const EdgeInsets.all(24),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
- Text(
- "Favorite wallets",
- style: STextStyles.desktopTextExtraSmall(context).copyWith(
- color: Theme.of(context)
- .extension()!
- .textFieldActiveSearchIconRight,
- ),
- ),
- const SizedBox(
- height: 20,
- ),
- // TODO favorites grid
- Container(
- color: Colors.deepPurpleAccent,
- height: 210,
- ),
-
- const SizedBox(
- height: 40,
- ),
-
+ if (showFavorites) const DesktopFavoriteWallets(),
Row(
children: [
Text(
@@ -55,12 +41,14 @@ class _MyWalletsState extends State {
BlueTextButton(
text: "Add new wallet",
onTap: () {
- Navigator.of(context).pushNamed(AddWalletView.routeName);
+ Navigator.of(
+ context,
+ rootNavigator: true,
+ ).pushNamed(AddWalletView.routeName);
},
),
],
),
-
const SizedBox(
height: 20,
),
diff --git a/lib/services/coins/bitcoincash/bitcoincash_wallet.dart b/lib/services/coins/bitcoincash/bitcoincash_wallet.dart
index 81b8198e5..30f04e918 100644
--- a/lib/services/coins/bitcoincash/bitcoincash_wallet.dart
+++ b/lib/services/coins/bitcoincash/bitcoincash_wallet.dart
@@ -1,3111 +1,3408 @@
-// import 'dart:async';
-// import 'dart:convert';
-// import 'dart:io';
-// import 'dart:typed_data';
-//
-// import 'package:bech32/bech32.dart';
-// import 'package:bip32/bip32.dart' as bip32;
-// import 'package:bip39/bip39.dart' as bip39;
-// import 'package:bitcoindart/bitcoindart.dart';
-// import 'package:bs58check/bs58check.dart' as bs58check;
-// import 'package:crypto/crypto.dart';
-// import 'package:decimal/decimal.dart';
-// import 'package:flutter/foundation.dart';
-// import 'package:flutter_secure_storage/flutter_secure_storage.dart';
-// import 'package:http/http.dart';
-// import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart';
-// import 'package:stackwallet/electrumx_rpc/electrumx.dart';
-// import 'package:stackwallet/hive/db.dart';
-// import 'package:stackwallet/models/models.dart' as models;
-// import 'package:stackwallet/models/paymint/fee_object_model.dart';
-// import 'package:stackwallet/models/paymint/transactions_model.dart';
-// import 'package:stackwallet/models/paymint/utxo_model.dart';
-// import 'package:stackwallet/services/coins/coin_service.dart';
-// import 'package:stackwallet/services/event_bus/events/global/node_connection_status_changed_event.dart';
-// import 'package:stackwallet/services/event_bus/events/global/refresh_percent_changed_event.dart';
-// import 'package:stackwallet/services/event_bus/events/global/updated_in_background_event.dart';
-// import 'package:stackwallet/services/event_bus/events/global/wallet_sync_status_changed_event.dart';
-// import 'package:stackwallet/services/event_bus/global_event_bus.dart';
-// import 'package:stackwallet/services/node_service.dart';
-// import 'package:stackwallet/services/notifications_api.dart';
-// import 'package:stackwallet/services/price.dart';
-// import 'package:stackwallet/services/transaction_notification_tracker.dart';
-// import 'package:stackwallet/utilities/assets.dart';
-// import 'package:stackwallet/utilities/constants.dart';
-// import 'package:stackwallet/utilities/default_nodes.dart';
-// import 'package:stackwallet/utilities/enums/coin_enum.dart';
-// import 'package:stackwallet/utilities/enums/fee_rate_type_enum.dart';
-// import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart';
-// import 'package:stackwallet/utilities/format.dart';
-// import 'package:stackwallet/utilities/logger.dart';
-// import 'package:stackwallet/utilities/prefs.dart';
-// import 'package:tuple/tuple.dart';
-// import 'package:uuid/uuid.dart';
-// import 'package:bitbox/bitbox.dart' as Bitbox;
-//
-// const int MINIMUM_CONFIRMATIONS = 3;
-// const int DUST_LIMIT = 546;
-//
-// const String GENESIS_HASH_MAINNET =
-// "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f";
-// const String GENESIS_HASH_TESTNET =
-// "000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943";
-//
-// enum DerivePathType { bip44 }
-//
-// bip32.BIP32 getBip32Node(int chain, int index, String mnemonic,
-// NetworkType network, DerivePathType derivePathType) {
-// final root = getBip32Root(mnemonic, network);
-//
-// final node = getBip32NodeFromRoot(chain, index, root, derivePathType);
-// return node;
-// }
-//
-// /// wrapper for compute()
-// bip32.BIP32 getBip32NodeWrapper(
-// Tuple5 args,
-// ) {
-// return getBip32Node(
-// args.item1,
-// args.item2,
-// args.item3,
-// args.item4,
-// args.item5,
-// );
-// }
-//
-// bip32.BIP32 getBip32NodeFromRoot(
-// int chain, int index, bip32.BIP32 root, DerivePathType derivePathType) {
-// String coinType;
-// switch (root.network.wif) {
-// case 0x80: // bch mainnet wif
-// coinType = "145"; // bch mainnet
-// break;
-// case 0xef: // bch testnet wif
-// coinType = "1"; // bch testnet
-// break;
-// default:
-// throw Exception("Invalid Bitcoincash network type used!");
-// }
-// switch (derivePathType) {
-// case DerivePathType.bip44:
-// return root.derivePath("m/44'/$coinType'/0'/$chain/$index");
-// default:
-// throw Exception("DerivePathType must not be null.");
-// }
-// }
-//
-// /// wrapper for compute()
-// bip32.BIP32 getBip32NodeFromRootWrapper(
-// Tuple4 args,
-// ) {
-// return getBip32NodeFromRoot(
-// args.item1,
-// args.item2,
-// args.item3,
-// args.item4,
-// );
-// }
-//
-// bip32.BIP32 getBip32Root(String mnemonic, NetworkType network) {
-// final seed = bip39.mnemonicToSeed(mnemonic);
-// final networkType = bip32.NetworkType(
-// wif: network.wif,
-// bip32: bip32.Bip32Type(
-// public: network.bip32.public,
-// private: network.bip32.private,
-// ),
-// );
-//
-// final root = bip32.BIP32.fromSeed(seed, networkType);
-// return root;
-// }
-//
-// /// wrapper for compute()
-// bip32.BIP32 getBip32RootWrapper(Tuple2 args) {
-// return getBip32Root(args.item1, args.item2);
-// }
-//
-// class BitcoinCashWallet extends CoinServiceAPI {
-// static const integrationTestFlag =
-// bool.fromEnvironment("IS_INTEGRATION_TEST");
-// final _prefs = Prefs.instance;
-//
-// Timer? timer;
-// late Coin _coin;
-//
-// late final TransactionNotificationTracker txTracker;
-//
-// NetworkType get _network {
-// switch (coin) {
-// case Coin.bitcoincash:
-// return bitcoincash;
-// case Coin.bitcoincashTestnet:
-// return bitcoincashtestnet;
-// default:
-// throw Exception("Bitcoincash network type not set!");
-// }
-// }
-//
-// List outputsList = [];
-//
-// @override
-// Coin get coin => _coin;
-//
-// @override
-// Future> get allOwnAddresses =>
-// _allOwnAddresses ??= _fetchAllOwnAddresses();
-// Future>? _allOwnAddresses;
-//
-// Future? _utxoData;
-// Future get utxoData => _utxoData ??= _fetchUtxoData();
-//
-// @override
-// Future> get unspentOutputs async =>
-// (await utxoData).unspentOutputArray;
-//
-// @override
-// Future get availableBalance async {
-// final data = await utxoData;
-// return Format.satoshisToAmount(
-// data.satoshiBalance - data.satoshiBalanceUnconfirmed);
-// }
-//
-// @override
-// Future get pendingBalance async {
-// final data = await utxoData;
-// return Format.satoshisToAmount(data.satoshiBalanceUnconfirmed);
-// }
-//
-// @override
-// Future get balanceMinusMaxFee async =>
-// (await availableBalance) -
-// (Decimal.fromInt((await maxFee)) / Decimal.fromInt(Constants.satsPerCoin))
-// .toDecimal();
-//
-// @override
-// Future get totalBalance async {
-// if (!isActive) {
-// final totalBalance = DB.instance
-// .get(boxName: walletId, key: 'totalBalance') as int?;
-// if (totalBalance == null) {
-// final data = await utxoData;
-// return Format.satoshisToAmount(data.satoshiBalance);
-// } else {
-// return Format.satoshisToAmount(totalBalance);
-// }
-// }
-// final data = await utxoData;
-// return Format.satoshisToAmount(data.satoshiBalance);
-// }
-//
-// @override
-// Future get currentReceivingAddress =>
-// _currentReceivingAddressP2PKH ??=
-// _getCurrentAddressForChain(0, DerivePathType.bip44);
-//
-// Future? _currentReceivingAddressP2PKH;
-//
-// @override
-// Future exit() async {
-// _hasCalledExit = true;
-// timer?.cancel();
-// timer = null;
-// stopNetworkAlivePinging();
-// }
-//
-// bool _hasCalledExit = false;
-//
-// @override
-// bool get hasCalledExit => _hasCalledExit;
-//
-// @override
-// Future get fees => _feeObject ??= _getFees();
-// Future? _feeObject;
-//
-// @override
-// Future get maxFee async {
-// final fee = (await fees).fast;
-// final satsFee =
-// Format.satoshisToAmount(fee) * Decimal.fromInt(Constants.satsPerCoin);
-// return satsFee.floor().toBigInt().toInt();
-// }
-//
-// @override
-// Future> get mnemonic => _getMnemonicList();
-//
-// Future get chainHeight async {
-// try {
-// final result = await _electrumXClient.getBlockHeadTip();
-// return result["height"] as int;
-// } catch (e, s) {
-// Logging.instance.log("Exception caught in chainHeight: $e\n$s",
-// level: LogLevel.Error);
-// return -1;
-// }
-// }
-//
-// Future get storedChainHeight async {
-// final storedHeight = DB.instance
-// .get(boxName: walletId, key: "storedChainHeight") as int?;
-// return storedHeight ?? 0;
-// }
-//
-// Future updateStoredChainHeight({required int newHeight}) async {
-// DB.instance.put(
-// boxName: walletId, key: "storedChainHeight", value: newHeight);
-// }
-//
-// DerivePathType addressType({required String address}) {
-// Uint8List? decodeBase58;
-// Segwit? decodeBech32;
-// try {
-// decodeBase58 = bs58check.decode(address);
-// } catch (err) {
-// // Base58check decode fail
-// }
-// if (decodeBase58 != null) {
-// if (decodeBase58[0] == _network.pubKeyHash) {
-// // P2PKH
-// return DerivePathType.bip44;
-// }
-// throw ArgumentError('Invalid version or Network mismatch');
-// } else {
-// try {
-// decodeBech32 = segwit.decode(address);
-// } catch (err) {
-// // Bech32 decode fail
-// }
-// if (_network.bech32 != decodeBech32!.hrp) {
-// throw ArgumentError('Invalid prefix or Network mismatch');
-// }
-// if (decodeBech32.version != 0) {
-// throw ArgumentError('Invalid address version');
-// }
-// }
-// throw ArgumentError('$address has no matching Script');
-// }
-//
-// bool longMutex = false;
-//
-// @override
-// Future recoverFromMnemonic({
-// required String mnemonic,
-// required int maxUnusedAddressGap,
-// required int maxNumberOfIndexesToCheck,
-// required int height,
-// }) async {
-// longMutex = true;
-// final start = DateTime.now();
-// try {
-// Logging.instance.log("IS_INTEGRATION_TEST: $integrationTestFlag",
-// level: LogLevel.Info);
-// if (!integrationTestFlag) {
-// final features = await electrumXClient.getServerFeatures();
-// Logging.instance.log("features: $features", level: LogLevel.Info);
-// switch (coin) {
-// case Coin.bitcoincash:
-// if (features['genesis_hash'] != GENESIS_HASH_MAINNET) {
-// throw Exception("genesis hash does not match main net!");
-// }
-// break;
-// case Coin.bitcoincashTestnet:
-// if (features['genesis_hash'] != GENESIS_HASH_TESTNET) {
-// throw Exception("genesis hash does not match test net!");
-// }
-// break;
-// default:
-// throw Exception(
-// "Attempted to generate a BitcoinCashWallet using a non bch coin type: ${coin.name}");
-// }
-// }
-// // check to make sure we aren't overwriting a mnemonic
-// // this should never fail
-// if ((await _secureStore.read(key: '${_walletId}_mnemonic')) != null) {
-// longMutex = false;
-// throw Exception("Attempted to overwrite mnemonic on restore!");
-// }
-// await _secureStore.write(
-// key: '${_walletId}_mnemonic', value: mnemonic.trim());
-// await _recoverWalletFromBIP32SeedPhrase(
-// mnemonic: mnemonic.trim(),
-// maxUnusedAddressGap: maxUnusedAddressGap,
-// maxNumberOfIndexesToCheck: maxNumberOfIndexesToCheck,
-// );
-// } catch (e, s) {
-// Logging.instance.log(
-// "Exception rethrown from recoverFromMnemonic(): $e\n$s",
-// level: LogLevel.Error);
-// longMutex = false;
-// rethrow;
-// }
-// longMutex = false;
-//
-// final end = DateTime.now();
-// Logging.instance.log(
-// "$walletName recovery time: ${end.difference(start).inMilliseconds} millis",
-// level: LogLevel.Info);
-// }
-//
-// Future _recoverWalletFromBIP32SeedPhrase({
-// required String mnemonic,
-// int maxUnusedAddressGap = 20,
-// int maxNumberOfIndexesToCheck = 1000,
-// }) async {
-// longMutex = true;
-//
-// Map> p2pkhReceiveDerivations = {};
-// Map> p2pkhChangeDerivations = {};
-//
-// final root = await compute(getBip32RootWrapper, Tuple2(mnemonic, _network));
-//
-// List p2pkhReceiveAddressArray = [];
-// int p2pkhReceiveIndex = -1;
-//
-// List p2pkhChangeAddressArray = [];
-// int p2pkhChangeIndex = -1;
-//
-// // The gap limit will be capped at [maxUnusedAddressGap]
-// int receivingGapCounter = 0;
-// int changeGapCounter = 0;
-//
-// // actual size is 12 due to p2pkh so 12x1
-// const txCountBatchSize = 12;
-//
-// try {
-// // receiving addresses
-// Logging.instance
-// .log("checking receiving addresses...", level: LogLevel.Info);
-// for (int index = 0;
-// index < maxNumberOfIndexesToCheck &&
-// receivingGapCounter < maxUnusedAddressGap;
-// index += txCountBatchSize) {
-// Logging.instance.log(
-// "index: $index, \t receivingGapCounter: $receivingGapCounter",
-// level: LogLevel.Info);
-//
-// final receivingP2pkhID = "k_$index";
-// Map txCountCallArgs = {};
-// final Map receivingNodes = {};
-//
-// for (int j = 0; j < txCountBatchSize; j++) {
-// // bip44 / P2PKH
-// final node44 = await compute(
-// getBip32NodeFromRootWrapper,
-// Tuple4(
-// 0,
-// index + j,
-// root,
-// DerivePathType.bip44,
-// ),
-// );
-// final p2pkhReceiveAddress = P2PKH(
-// data: PaymentData(pubkey: node44.publicKey),
-// network: _network)
-// .data
-// .address!;
-// receivingNodes.addAll({
-// "${receivingP2pkhID}_$j": {
-// "node": node44,
-// "address": p2pkhReceiveAddress,
-// }
-// });
-// txCountCallArgs.addAll({
-// "${receivingP2pkhID}_$j": p2pkhReceiveAddress,
-// });
-// }
-//
-// // get address tx counts
-// final counts = await _getBatchTxCount(addresses: txCountCallArgs);
-//
-// // check and add appropriate addresses
-// for (int k = 0; k < txCountBatchSize; k++) {
-// int p2pkhTxCount = counts["${receivingP2pkhID}_$k"]!;
-// if (p2pkhTxCount > 0) {
-// final node = receivingNodes["${receivingP2pkhID}_$k"];
-// // add address to array
-// p2pkhReceiveAddressArray.add(node["address"] as String);
-// // set current index
-// p2pkhReceiveIndex = index + k;
-// // reset counter
-// receivingGapCounter = 0;
-// // add info to derivations
-// p2pkhReceiveDerivations[node["address"] as String] = {
-// "pubKey": Format.uint8listToString(
-// (node["node"] as bip32.BIP32).publicKey),
-// "wif": (node["node"] as bip32.BIP32).toWIF(),
-// };
-// }
-//
-// // increase counter when no tx history found
-// if (p2pkhTxCount == 0) {
-// receivingGapCounter++;
-// }
-// }
-// }
-//
-// Logging.instance
-// .log("checking change addresses...", level: LogLevel.Info);
-// // change addresses
-// for (int index = 0;
-// index < maxNumberOfIndexesToCheck &&
-// changeGapCounter < maxUnusedAddressGap;
-// index += txCountBatchSize) {
-// Logging.instance.log(
-// "index: $index, \t changeGapCounter: $changeGapCounter",
-// level: LogLevel.Info);
-// final changeP2pkhID = "k_$index";
-// Map args = {};
-// final Map changeNodes = {};
-//
-// for (int j = 0; j < txCountBatchSize; j++) {
-// // bip44 / P2PKH
-// final node44 = await compute(
-// getBip32NodeFromRootWrapper,
-// Tuple4(
-// 1,
-// index + j,
-// root,
-// DerivePathType.bip44,
-// ),
-// );
-// final p2pkhChangeAddress = P2PKH(
-// data: PaymentData(pubkey: node44.publicKey),
-// network: _network)
-// .data
-// .address!;
-// changeNodes.addAll({
-// "${changeP2pkhID}_$j": {
-// "node": node44,
-// "address": p2pkhChangeAddress,
-// }
-// });
-// args.addAll({
-// "${changeP2pkhID}_$j": p2pkhChangeAddress,
-// });
-// }
-//
-// // get address tx counts
-// final counts = await _getBatchTxCount(addresses: args);
-//
-// // check and add appropriate addresses
-// for (int k = 0; k < txCountBatchSize; k++) {
-// int p2pkhTxCount = counts["${changeP2pkhID}_$k"]!;
-// if (p2pkhTxCount > 0) {
-// final node = changeNodes["${changeP2pkhID}_$k"];
-// // add address to array
-// p2pkhChangeAddressArray.add(node["address"] as String);
-// // set current index
-// p2pkhChangeIndex = index + k;
-// // reset counter
-// changeGapCounter = 0;
-// // add info to derivations
-// p2pkhChangeDerivations[node["address"] as String] = {
-// "pubKey": Format.uint8listToString(
-// (node["node"] as bip32.BIP32).publicKey),
-// "wif": (node["node"] as bip32.BIP32).toWIF(),
-// };
-// }
-//
-// // increase counter when no tx history found
-// if (p2pkhTxCount == 0) {
-// changeGapCounter++;
-// }
-// }
-// }
-//
-// // save the derivations (if any)
-// if (p2pkhReceiveDerivations.isNotEmpty) {
-// await addDerivations(
-// chain: 0,
-// derivePathType: DerivePathType.bip44,
-// derivationsToAdd: p2pkhReceiveDerivations);
-// }
-// if (p2pkhChangeDerivations.isNotEmpty) {
-// await addDerivations(
-// chain: 1,
-// derivePathType: DerivePathType.bip44,
-// derivationsToAdd: p2pkhChangeDerivations);
-// }
-//
-// // If restoring a wallet that never received any funds, then set receivingArray manually
-// // If we didn't do this, it'd store an empty array
-// if (p2pkhReceiveIndex == -1) {
-// final address =
-// await _generateAddressForChain(0, 0, DerivePathType.bip44);
-// p2pkhReceiveAddressArray.add(address);
-// p2pkhReceiveIndex = 0;
-// }
-//
-// // If restoring a wallet that never sent any funds with change, then set changeArray
-// // manually. If we didn't do this, it'd store an empty array.
-// if (p2pkhChangeIndex == -1) {
-// final address =
-// await _generateAddressForChain(1, 0, DerivePathType.bip44);
-// p2pkhChangeAddressArray.add(address);
-// p2pkhChangeIndex = 0;
-// }
-//
-// await DB.instance.put(
-// boxName: walletId,
-// key: 'receivingAddressesP2PKH',
-// value: p2pkhReceiveAddressArray);
-// await DB.instance.put(
-// boxName: walletId,
-// key: 'changeAddressesP2PKH',
-// value: p2pkhChangeAddressArray);
-// await DB.instance.put(
-// boxName: walletId,
-// key: 'receivingIndexP2PKH',
-// value: p2pkhReceiveIndex);
-// await DB.instance.put(
-// boxName: walletId, key: 'changeIndexP2PKH', value: p2pkhChangeIndex);
-// await DB.instance
-// .put(boxName: walletId, key: "id", value: _walletId);
-// await DB.instance
-// .put(boxName: walletId, key: "isFavorite", value: false);
-//
-// longMutex = false;
-// } catch (e, s) {
-// Logging.instance.log(
-// "Exception rethrown from _recoverWalletFromBIP32SeedPhrase(): $e\n$s",
-// level: LogLevel.Info);
-//
-// longMutex = false;
-// rethrow;
-// }
-// }
-//
-// Future refreshIfThereIsNewData() async {
-// if (longMutex) return false;
-// if (_hasCalledExit) return false;
-// Logging.instance.log("refreshIfThereIsNewData", level: LogLevel.Info);
-//
-// try {
-// bool needsRefresh = false;
-// Logging.instance.log(
-// "notified unconfirmed transactions: ${txTracker.pendings}",
-// level: LogLevel.Info);
-// Set txnsToCheck = {};
-//
-// for (final String txid in txTracker.pendings) {
-// if (!txTracker.wasNotifiedConfirmed(txid)) {
-// txnsToCheck.add(txid);
-// }
-// }
-//
-// for (String txid in txnsToCheck) {
-// final txn = await electrumXClient.getTransaction(txHash: txid);
-// var confirmations = txn["confirmations"];
-// if (confirmations is! int) continue;
-// bool isUnconfirmed = confirmations < MINIMUM_CONFIRMATIONS;
-// if (!isUnconfirmed) {
-// // unconfirmedTxs = {};
-// needsRefresh = true;
-// break;
-// }
-// }
-// if (!needsRefresh) {
-// var allOwnAddresses = await _fetchAllOwnAddresses();
-// List