stack_wallet/lib/pages/wallet_view/sub_widgets/wallet_summary.dart

73 lines
1.9 KiB
Dart
Raw Normal View History

2023-05-26 21:21:16 +00:00
/*
* This file is part of Stack Wallet.
*
* Copyright (c) 2023 Cypher Stack
* All Rights Reserved.
* The code is distributed under GPLv3 license, see LICENSE file for details.
* Generated by Cypher Stack on 2023-05-26
*
*/
2022-08-26 08:11:35 +00:00
import 'package:flutter/material.dart';
import 'wallet_summary_info.dart';
import '../../../services/event_bus/events/global/wallet_sync_status_changed_event.dart';
import '../../../widgets/coin_card.dart';
2023-06-07 20:34:27 +00:00
2023-06-08 16:59:44 +00:00
class WalletSummary extends StatelessWidget {
2022-08-26 08:11:35 +00:00
const WalletSummary({
2024-05-14 16:26:03 +00:00
super.key,
2022-08-26 08:11:35 +00:00
required this.walletId,
required this.initialSyncStatus,
this.aspectRatio = 2.0,
this.minHeight = 100.0,
this.minWidth = 200.0,
this.maxHeight = 250.0,
this.maxWidth = 400.0,
2024-05-14 16:26:03 +00:00
});
2022-08-26 08:11:35 +00:00
final String walletId;
final WalletSyncStatus initialSyncStatus;
final double aspectRatio;
final double minHeight;
final double minWidth;
final double maxHeight;
final double maxWidth;
@override
2023-06-08 16:59:44 +00:00
Widget build(BuildContext context) {
2022-08-26 08:11:35 +00:00
return AspectRatio(
aspectRatio: aspectRatio,
child: ConstrainedBox(
constraints: BoxConstraints(
minHeight: minHeight,
minWidth: minWidth,
maxHeight: maxHeight,
maxWidth: minWidth,
),
2023-06-08 16:59:44 +00:00
child: LayoutBuilder(
builder: (_, constraints) => Stack(
children: [
CoinCard(
walletId: walletId,
width: constraints.maxWidth,
height: constraints.maxHeight,
isFavorite: false,
2023-06-07 20:34:27 +00:00
),
Positioned.fill(
2023-06-08 16:59:44 +00:00
child: Padding(
padding: const EdgeInsets.all(16.0),
child: WalletSummaryInfo(
walletId: walletId,
initialSyncStatus: initialSyncStatus,
),
2022-08-26 08:11:35 +00:00
),
),
2023-06-08 16:59:44 +00:00
],
),
2022-08-26 08:11:35 +00:00
),
),
);
}
}