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 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
|
|
import 'package:stackwallet/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart';
|
|
|
|
import 'package:stackwallet/pages/wallets_view/sub_widgets/wallet_list_item.dart';
|
|
|
|
import 'package:stackwallet/providers/providers.dart';
|
2023-05-09 21:57:40 +00:00
|
|
|
import 'package:stackwallet/themes/stack_colors.dart';
|
2022-08-26 08:11:35 +00:00
|
|
|
import 'package:stackwallet/utilities/text_styles.dart';
|
|
|
|
import 'package:stackwallet/widgets/custom_buttons/blue_text_button.dart';
|
|
|
|
|
|
|
|
class AllWallets extends StatelessWidget {
|
|
|
|
const AllWallets({Key? key}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
debugPrint("BUILD: $runtimeType");
|
|
|
|
return Column(
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
"All wallets",
|
2022-09-22 22:17:21 +00:00
|
|
|
style: STextStyles.itemSubtitle(context).copyWith(
|
2023-02-10 20:17:40 +00:00
|
|
|
color: Theme.of(context).extension<StackColors>()!.textDark3,
|
2022-09-21 22:49:48 +00:00
|
|
|
),
|
2022-08-26 08:11:35 +00:00
|
|
|
),
|
2023-01-30 21:34:21 +00:00
|
|
|
CustomTextButton(
|
2022-08-26 08:11:35 +00:00
|
|
|
text: "Add new",
|
|
|
|
onTap: () {
|
|
|
|
Navigator.of(context).pushNamed(AddWalletView.routeName);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
const SizedBox(
|
|
|
|
height: 10,
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: Consumer(
|
|
|
|
builder: (_, ref, __) {
|
2023-11-03 19:46:55 +00:00
|
|
|
final walletsByCoin = ref.watch(pWallets).walletsByCoin;
|
2022-08-26 08:11:35 +00:00
|
|
|
|
|
|
|
return ListView.builder(
|
2023-11-03 19:46:55 +00:00
|
|
|
itemCount: walletsByCoin.length,
|
2022-08-26 08:11:35 +00:00
|
|
|
itemBuilder: (builderContext, index) {
|
2023-11-03 19:46:55 +00:00
|
|
|
final coin = walletsByCoin[index].coin;
|
|
|
|
final int walletCount = walletsByCoin[index].wallets.length;
|
2022-08-26 08:11:35 +00:00
|
|
|
return Padding(
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 4),
|
|
|
|
child: WalletListItem(
|
|
|
|
coin: coin,
|
|
|
|
walletCount: walletCount,
|
|
|
|
),
|
|
|
|
);
|
|
|
|
},
|
|
|
|
);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|