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';
|
2024-05-23 00:37:06 +00:00
|
|
|
import '../../add_wallet_views/add_wallet_view/add_wallet_view.dart';
|
|
|
|
import 'wallet_list_item.dart';
|
|
|
|
import '../../../themes/stack_colors.dart';
|
|
|
|
import '../../../utilities/text_styles.dart';
|
|
|
|
import '../../../wallets/isar/providers/all_wallets_info_provider.dart';
|
|
|
|
import '../../../widgets/custom_buttons/blue_text_button.dart';
|
2022-08-26 08:11:35 +00:00
|
|
|
|
|
|
|
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-15 16:59:03 +00:00
|
|
|
final walletsByCoin = ref.watch(pAllWalletsInfoByCoin);
|
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,
|
|
|
|
),
|
|
|
|
);
|
|
|
|
},
|
|
|
|
);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|