Skip to content

Commit 48d2ac5

Browse files
committed
firo desktop wallet header refactor
1 parent 3146f4d commit 48d2ac5

File tree

1 file changed

+83
-39
lines changed

1 file changed

+83
-39
lines changed

lib/pages_desktop_specific/my_stack_view/wallet_view/desktop_wallet_view.dart

Lines changed: 83 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import '../../../utilities/wallet_tools.dart';
4545
import '../../../wallets/isar/providers/wallet_info_provider.dart';
4646
import '../../../wallets/wallet/impl/banano_wallet.dart';
4747
import '../../../wallets/wallet/impl/firo_wallet.dart';
48+
import '../../../wallets/wallet/wallet.dart';
4849
import '../../../wallets/wallet/wallet_mixin_interfaces/view_only_option_interface.dart';
4950
import '../../../widgets/custom_buttons/app_bar_icon_button.dart';
5051
import '../../../widgets/custom_buttons/blue_text_button.dart';
@@ -315,45 +316,7 @@ class _DesktopWalletViewState extends ConsumerState<DesktopWalletView> {
315316
padding: const EdgeInsets.all(24),
316317
child: Column(
317318
children: [
318-
RoundedWhiteContainer(
319-
padding: const EdgeInsets.all(20),
320-
child: Row(
321-
children: [
322-
if (monke != null)
323-
SvgPicture.memory(
324-
Uint8List.fromList(monke),
325-
width: 60,
326-
height: 60,
327-
),
328-
if (monke == null)
329-
SvgPicture.file(
330-
File(ref.watch(coinIconProvider(wallet.info.coin))),
331-
width: 40,
332-
height: 40,
333-
),
334-
const SizedBox(width: 10),
335-
if (wallet is FiroWallet)
336-
FiroDesktopWalletSummary(
337-
walletId: widget.walletId,
338-
initialSyncStatus:
339-
wallet.refreshMutex.isLocked
340-
? WalletSyncStatus.syncing
341-
: WalletSyncStatus.synced,
342-
),
343-
344-
if (wallet is! FiroWallet)
345-
DesktopWalletSummary(
346-
walletId: widget.walletId,
347-
initialSyncStatus:
348-
wallet.refreshMutex.isLocked
349-
? WalletSyncStatus.syncing
350-
: WalletSyncStatus.synced,
351-
),
352-
const Spacer(),
353-
DesktopWalletFeatures(walletId: widget.walletId),
354-
],
355-
),
356-
),
319+
DesktopWalletHeaderRow(wallet, monke),
357320
const SizedBox(height: 24),
358321
Row(
359322
children: [
@@ -449,3 +412,84 @@ class _DesktopWalletViewState extends ConsumerState<DesktopWalletView> {
449412
);
450413
}
451414
}
415+
416+
class DesktopWalletHeaderRow extends ConsumerWidget {
417+
const DesktopWalletHeaderRow(this.wallet, this.monke, {super.key});
418+
419+
final Wallet wallet;
420+
final List<int>? monke;
421+
422+
@override
423+
Widget build(BuildContext context, WidgetRef ref) {
424+
return RoundedWhiteContainer(
425+
padding: const EdgeInsets.all(20),
426+
child:
427+
wallet is FiroWallet && MediaQuery.of(context).size.width < 1600
428+
? Column(
429+
children: [
430+
Row(
431+
children: [
432+
SvgPicture.file(
433+
File(ref.watch(coinIconProvider(wallet.info.coin))),
434+
width: 40,
435+
height: 40,
436+
),
437+
const SizedBox(width: 10),
438+
FiroDesktopWalletSummary(
439+
walletId: wallet.walletId,
440+
initialSyncStatus:
441+
wallet.refreshMutex.isLocked
442+
? WalletSyncStatus.syncing
443+
: WalletSyncStatus.synced,
444+
),
445+
446+
const Spacer(),
447+
],
448+
),
449+
const SizedBox(height: 10),
450+
Row(
451+
children: [
452+
DesktopWalletFeatures(walletId: wallet.walletId),
453+
],
454+
),
455+
],
456+
)
457+
: Row(
458+
children: [
459+
if (monke != null)
460+
SvgPicture.memory(
461+
Uint8List.fromList(monke!),
462+
width: 60,
463+
height: 60,
464+
),
465+
if (monke == null)
466+
SvgPicture.file(
467+
File(ref.watch(coinIconProvider(wallet.info.coin))),
468+
width: 40,
469+
height: 40,
470+
),
471+
const SizedBox(width: 10),
472+
if (wallet is FiroWallet)
473+
FiroDesktopWalletSummary(
474+
walletId: wallet.walletId,
475+
initialSyncStatus:
476+
wallet.refreshMutex.isLocked
477+
? WalletSyncStatus.syncing
478+
: WalletSyncStatus.synced,
479+
),
480+
481+
if (wallet is! FiroWallet)
482+
DesktopWalletSummary(
483+
walletId: wallet.walletId,
484+
initialSyncStatus:
485+
wallet.refreshMutex.isLocked
486+
? WalletSyncStatus.syncing
487+
: WalletSyncStatus.synced,
488+
),
489+
const Spacer(),
490+
DesktopWalletFeatures(walletId: wallet.walletId),
491+
],
492+
),
493+
);
494+
}
495+
}

0 commit comments

Comments
 (0)