fix keys popup, add copy buttons, and add basic style

and import cleanup
This commit is contained in:
sneurlax 2024-03-06 10:55:15 -06:00
parent 445fc832a3
commit 5d1615b72e
3 changed files with 57 additions and 14 deletions

View file

@ -17,6 +17,7 @@ import 'package:flutter_svg/svg.dart';
import 'package:qr_flutter/qr_flutter.dart'; import 'package:qr_flutter/qr_flutter.dart';
import 'package:stackwallet/notifications/show_flush_bar.dart'; import 'package:stackwallet/notifications/show_flush_bar.dart';
import 'package:stackwallet/pages/add_wallet_views/new_wallet_recovery_phrase_view/sub_widgets/mnemonic_table.dart'; import 'package:stackwallet/pages/add_wallet_views/new_wallet_recovery_phrase_view/sub_widgets/mnemonic_table.dart';
import 'package:stackwallet/pages/wallet_view/transaction_views/transaction_details_view.dart';
import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/themes/stack_colors.dart';
import 'package:stackwallet/utilities/address_utils.dart'; import 'package:stackwallet/utilities/address_utils.dart';
import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/assets.dart';
@ -32,8 +33,6 @@ import 'package:stackwallet/widgets/detail_item.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart';
import 'package:stackwallet/widgets/stack_dialog.dart'; import 'package:stackwallet/widgets/stack_dialog.dart';
import '../../../wallet_view/transaction_views/transaction_details_view.dart';
class WalletBackupView extends ConsumerWidget { class WalletBackupView extends ConsumerWidget {
const WalletBackupView({ const WalletBackupView({
Key? key, Key? key,

View file

@ -89,9 +89,11 @@ class _UnlockWalletKeysDesktopState
if (wallet is! MnemonicInterface) { if (wallet is! MnemonicInterface) {
if (wallet is BitcoinFrostWallet) { if (wallet is BitcoinFrostWallet) {
frostData = ( frostData = (
keys: (await wallet.getMultisigConfig())!, keys: (await wallet.getSerializedKeys())!,
config: (await wallet.getMultisigConfig())!, config: (await wallet.getMultisigConfig())!,
); );
print(1111111);
print(frostData);
} else { } else {
throw Exception("FIXME ~= see todo in code"); throw Exception("FIXME ~= see todo in code");
} }
@ -325,7 +327,7 @@ class _UnlockWalletKeysDesktopState
if (wallet is! MnemonicInterface) { if (wallet is! MnemonicInterface) {
if (wallet is BitcoinFrostWallet) { if (wallet is BitcoinFrostWallet) {
frostData = ( frostData = (
keys: (await wallet.getMultisigConfig())!, keys: (await wallet.getSerializedKeys())!,
config: (await wallet.getMultisigConfig())!, config: (await wallet.getMultisigConfig())!,
); );
} else { } else {

View file

@ -14,6 +14,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:stackwallet/notifications/show_flush_bar.dart'; import 'package:stackwallet/notifications/show_flush_bar.dart';
import 'package:stackwallet/pages/add_wallet_views/new_wallet_recovery_phrase_view/sub_widgets/mnemonic_table.dart'; import 'package:stackwallet/pages/add_wallet_views/new_wallet_recovery_phrase_view/sub_widgets/mnemonic_table.dart';
import 'package:stackwallet/pages/wallet_view/transaction_views/transaction_details_view.dart';
import 'package:stackwallet/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/qr_code_desktop_popup_content.dart'; import 'package:stackwallet/pages_desktop_specific/my_stack_view/wallet_view/sub_widgets/qr_code_desktop_popup_content.dart';
import 'package:stackwallet/themes/stack_colors.dart'; import 'package:stackwallet/themes/stack_colors.dart';
import 'package:stackwallet/utilities/address_utils.dart'; import 'package:stackwallet/utilities/address_utils.dart';
@ -24,6 +25,7 @@ import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart'; import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart';
import 'package:stackwallet/widgets/desktop/primary_button.dart'; import 'package:stackwallet/widgets/desktop/primary_button.dart';
import 'package:stackwallet/widgets/desktop/secondary_button.dart'; import 'package:stackwallet/widgets/desktop/secondary_button.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
class WalletKeysDesktopPopup extends StatelessWidget { class WalletKeysDesktopPopup extends StatelessWidget {
const WalletKeysDesktopPopup({ const WalletKeysDesktopPopup({
@ -83,13 +85,33 @@ class WalletKeysDesktopPopup extends StatelessWidget {
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 32, horizontal: 32,
), ),
child: RoundedWhiteContainer(
borderColor: Theme.of(context)
.extension<StackColors>()!
.textFieldDefaultBG,
padding: const EdgeInsets.symmetric(
horizontal: 12, vertical: 9),
child: Row(
children: [
Flexible(
child: SelectableText( child: SelectableText(
frostData!.keys, frostData!.keys,
style: style: STextStyles.desktopTextExtraExtraSmall(
STextStyles.desktopTextExtraExtraSmall(context), context),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),
const SizedBox(
width: 10,
),
IconCopyButton(
data: frostData!.keys,
)
// TODO [prio=low: Add QR code button and dialog.
],
),
),
),
), ),
const SizedBox( const SizedBox(
height: 24, height: 24,
@ -106,13 +128,33 @@ class WalletKeysDesktopPopup extends StatelessWidget {
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 32, horizontal: 32,
), ),
child: RoundedWhiteContainer(
borderColor: Theme.of(context)
.extension<StackColors>()!
.textFieldDefaultBG,
padding: const EdgeInsets.symmetric(
horizontal: 12, vertical: 9),
child: Row(
children: [
Flexible(
child: SelectableText( child: SelectableText(
frostData!.config, frostData!.config,
style: style: STextStyles.desktopTextExtraExtraSmall(
STextStyles.desktopTextExtraExtraSmall(context), context),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),
const SizedBox(
width: 10,
),
IconCopyButton(
data: frostData!.config,
)
// TODO [prio=low: Add QR code button and dialog.
],
),
),
),
), ),
const SizedBox( const SizedBox(
height: 24, height: 24,