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
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2023-03-31 20:38:04 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
|
|
import 'package:stackwallet/providers/providers.dart';
|
2023-05-09 21:57:40 +00:00
|
|
|
import 'package:stackwallet/themes/stack_colors.dart';
|
2023-03-31 20:38:04 +00:00
|
|
|
import 'package:stackwallet/utilities/text_styles.dart';
|
2023-04-10 16:02:19 +00:00
|
|
|
import 'package:stackwallet/widgets/wallet_info_row/sub_widgets/wallet_info_row_balance.dart';
|
2023-03-31 20:38:04 +00:00
|
|
|
import 'package:stackwallet/widgets/wallet_info_row/sub_widgets/wallet_info_row_coin_icon.dart';
|
|
|
|
|
|
|
|
class EthWalletRadio extends ConsumerStatefulWidget {
|
|
|
|
const EthWalletRadio({
|
|
|
|
Key? key,
|
|
|
|
required this.walletId,
|
|
|
|
this.selectedWalletId,
|
|
|
|
}) : super(key: key);
|
|
|
|
|
|
|
|
final String walletId;
|
|
|
|
final String? selectedWalletId;
|
|
|
|
|
|
|
|
@override
|
|
|
|
ConsumerState<EthWalletRadio> createState() => _EthWalletRadioState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _EthWalletRadioState extends ConsumerState<EthWalletRadio> {
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2023-11-03 19:46:55 +00:00
|
|
|
final wallet =
|
|
|
|
ref.watch(pWallets.select((value) => value.getWallet(widget.walletId)));
|
2023-03-31 20:38:04 +00:00
|
|
|
|
|
|
|
return Padding(
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
child: Container(
|
|
|
|
color: Colors.transparent,
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
IgnorePointer(
|
|
|
|
child: Radio(
|
|
|
|
value: widget.walletId,
|
|
|
|
groupValue: widget.selectedWalletId,
|
|
|
|
onChanged: (_) {
|
|
|
|
// do nothing since changing updating the ui is already
|
|
|
|
// done elsewhere
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(
|
|
|
|
width: 12,
|
|
|
|
),
|
|
|
|
WalletInfoCoinIcon(
|
2023-11-03 19:46:55 +00:00
|
|
|
coin: wallet.info.coin,
|
2023-03-31 20:38:04 +00:00
|
|
|
size: 40,
|
|
|
|
),
|
|
|
|
const SizedBox(
|
|
|
|
width: 12,
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
|
|
children: [
|
|
|
|
Text(
|
2023-11-03 19:46:55 +00:00
|
|
|
wallet.info.name,
|
2023-03-31 20:38:04 +00:00
|
|
|
style: STextStyles.desktopTextExtraSmall(context).copyWith(
|
|
|
|
color:
|
|
|
|
Theme.of(context).extension<StackColors>()!.textDark,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
WalletInfoRowBalance(
|
|
|
|
walletId: widget.walletId,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|