mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-26 05:19:22 +00:00
74 lines
2.4 KiB
Dart
74 lines
2.4 KiB
Dart
/*
|
|
* 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
|
|
*
|
|
*/
|
|
|
|
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';
|
|
import 'package:stackwallet/themes/stack_colors.dart';
|
|
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",
|
|
style: STextStyles.itemSubtitle(context).copyWith(
|
|
color: Theme.of(context).extension<StackColors>()!.textDark3,
|
|
),
|
|
),
|
|
CustomTextButton(
|
|
text: "Add new",
|
|
onTap: () {
|
|
Navigator.of(context).pushNamed(AddWalletView.routeName);
|
|
},
|
|
),
|
|
],
|
|
),
|
|
const SizedBox(
|
|
height: 10,
|
|
),
|
|
Expanded(
|
|
child: Consumer(
|
|
builder: (_, ref, __) {
|
|
final providersByCoin = ref.watch(walletsChangeNotifierProvider
|
|
.select((value) => value.getManagerProvidersByCoin()));
|
|
|
|
return ListView.builder(
|
|
itemCount: providersByCoin.length,
|
|
itemBuilder: (builderContext, index) {
|
|
final coin = providersByCoin[index].item1;
|
|
final int walletCount = providersByCoin[index].item2.length;
|
|
return Padding(
|
|
padding: const EdgeInsets.symmetric(vertical: 4),
|
|
child: WalletListItem(
|
|
coin: coin,
|
|
walletCount: walletCount,
|
|
),
|
|
);
|
|
},
|
|
);
|
|
},
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|