redo desktop enter wallet gui

This commit is contained in:
julian 2023-04-03 16:22:40 -06:00
parent 5e5b3100c4
commit c530aef112
4 changed files with 711 additions and 207 deletions

View file

@ -0,0 +1,347 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:flutter_svg/svg.dart';
import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/services/coins/ethereum/ethereum_wallet.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/animated_widgets/rotate_icon.dart';
import 'package:stackwallet/widgets/expandable.dart';
import 'package:stackwallet/widgets/icon_widgets/x_icon.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart';
import 'package:stackwallet/widgets/stack_text_field.dart';
import 'package:stackwallet/widgets/textfield_icon_button.dart';
import 'package:stackwallet/widgets/wallet_card.dart';
import 'package:stackwallet/widgets/wallet_info_row/sub_widgets/wallet_info_row_balance_future.dart';
import 'package:stackwallet/widgets/wallet_info_row/sub_widgets/wallet_info_row_coin_icon.dart';
class DesktopCoinWalletsDialog extends ConsumerStatefulWidget {
const DesktopCoinWalletsDialog({
Key? key,
required this.coin,
required this.navigatorState,
}) : super(key: key);
final Coin coin;
final NavigatorState navigatorState;
@override
ConsumerState<DesktopCoinWalletsDialog> createState() =>
_DesktopCoinWalletsDialogState();
}
class _DesktopCoinWalletsDialogState
extends ConsumerState<DesktopCoinWalletsDialog> {
final isDesktop = Util.isDesktop;
late final TextEditingController _searchController;
late final FocusNode searchFieldFocusNode;
String _searchString = "";
final List<String> walletIds = [];
@override
void initState() {
_searchController = TextEditingController();
searchFieldFocusNode = FocusNode();
final walletsData =
ref.read(walletsServiceChangeNotifierProvider).fetchWalletsData();
walletsData.removeWhere((key, value) => value.coin != widget.coin);
walletIds.clear();
walletIds.addAll(walletsData.values.map((e) => e.walletId));
super.initState();
}
@override
void dispose() {
_searchController.dispose();
searchFieldFocusNode.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Column(
children: [
ClipRRect(
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
),
child: TextField(
autocorrect: !isDesktop,
enableSuggestions: !isDesktop,
controller: _searchController,
focusNode: searchFieldFocusNode,
onChanged: (value) {
setState(() {
_searchString = value;
});
},
style: isDesktop
? STextStyles.desktopTextExtraSmall(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textFieldActiveText,
height: 1.8,
)
: STextStyles.field(context),
decoration: standardInputDecoration(
"Search...",
searchFieldFocusNode,
context,
desktopMed: isDesktop,
).copyWith(
prefixIcon: Padding(
padding: EdgeInsets.symmetric(
horizontal: isDesktop ? 12 : 10,
vertical: isDesktop ? 18 : 16,
),
child: SvgPicture.asset(
Assets.svg.search,
width: isDesktop ? 20 : 16,
height: isDesktop ? 20 : 16,
),
),
suffixIcon: _searchController.text.isNotEmpty
? Padding(
padding: const EdgeInsets.only(right: 0),
child: UnconstrainedBox(
child: Row(
children: [
TextFieldIconButton(
child: const XIcon(),
onTap: () async {
setState(() {
_searchController.text = "";
_searchString = "";
});
},
),
],
),
),
)
: null,
),
),
),
const SizedBox(
height: 16,
),
Expanded(
child: ListView.separated(
itemBuilder: (_, index) => widget.coin == Coin.ethereum
? _DesktopWalletCard(
walletId: walletIds[index],
navigatorState: widget.navigatorState,
)
: RoundedWhiteContainer(
padding: const EdgeInsets.symmetric(
vertical: 14,
horizontal: 20,
),
borderColor: Theme.of(context)
.extension<StackColors>()!
.backgroundAppBar,
child: WalletSheetCard(
walletId: walletIds[index],
popPrevious: true,
desktopNavigatorState: widget.navigatorState,
),
),
separatorBuilder: (_, __) => const SizedBox(
height: 10,
),
itemCount: walletIds.length,
),
),
],
);
}
}
class _DesktopWalletCard extends ConsumerStatefulWidget {
const _DesktopWalletCard({
Key? key,
required this.walletId,
required this.navigatorState,
}) : super(key: key);
final String walletId;
final NavigatorState navigatorState;
@override
ConsumerState<_DesktopWalletCard> createState() => _DesktopWalletCardState();
}
class _DesktopWalletCardState extends ConsumerState<_DesktopWalletCard> {
final expandableController = ExpandableController();
final rotateIconController = RotateIconController();
final List<String> tokenContractAddresses = [];
late final Coin coin;
@override
void initState() {
coin = ref
.read(walletsChangeNotifierProvider)
.getManager(widget.walletId)
.coin;
if (coin == Coin.ethereum) {
tokenContractAddresses.addAll(
(ref
.read(walletsChangeNotifierProvider)
.getManager(widget.walletId)
.wallet as EthereumWallet)
.getWalletTokenContractAddresses(),
);
}
super.initState();
}
@override
Widget build(BuildContext context) {
return RoundedWhiteContainer(
padding: EdgeInsets.zero,
borderColor: Theme.of(context).extension<StackColors>()!.backgroundAppBar,
child: Expandable(
controller: expandableController,
expandOverride: () {},
header: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 20,
vertical: 14,
),
child: Row(
children: [
Expanded(
child: Row(
children: [
Expanded(
flex: 2,
child: Row(
children: [
WalletInfoCoinIcon(
coin: coin,
),
const SizedBox(
width: 12,
),
Text(
ref.watch(
walletsChangeNotifierProvider.select(
(value) => value
.getManager(widget.walletId)
.walletName,
),
),
style: STextStyles.desktopTextExtraSmall(context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark,
),
),
],
),
),
Expanded(
flex: 4,
child: WalletInfoRowBalance(
walletId: widget.walletId,
),
),
],
),
),
MaterialButton(
padding: const EdgeInsets.all(5),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
minWidth: 32,
height: 32,
color: Theme.of(context)
.extension<StackColors>()!
.textFieldDefaultBG,
elevation: 0,
hoverElevation: 0,
disabledElevation: 0,
highlightElevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
),
),
onPressed: () {
if (expandableController.state == ExpandableState.collapsed) {
rotateIconController.forward?.call();
} else {
rotateIconController.reverse?.call();
}
expandableController.toggle?.call();
},
child: RotateIcon(
controller: rotateIconController,
icon: SvgPicture.asset(
Assets.svg.chevronDown,
width: 14,
),
curve: Curves.easeInOut,
),
),
],
),
),
body: ListView(
shrinkWrap: true,
primary: false,
children: [
Container(
width: double.infinity,
height: 1,
color:
Theme.of(context).extension<StackColors>()!.backgroundAppBar,
),
Padding(
padding: const EdgeInsets.only(
left: 32,
right: 14,
top: 14,
bottom: 14,
),
child: WalletSheetCard(
walletId: widget.walletId,
popPrevious: true,
desktopNavigatorState: widget.navigatorState,
),
),
...tokenContractAddresses.map(
(e) => Padding(
padding: const EdgeInsets.only(
left: 32,
right: 14,
top: 14,
bottom: 14,
),
child: WalletSheetCard(
walletId: widget.walletId,
contractAddress: e,
popPrevious: true,
desktopNavigatorState: widget.navigatorState,
),
),
),
],
),
),
);
}
}

View file

@ -1,18 +1,16 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:stackwallet/pages_desktop_specific/my_stack_view/coin_wallets_table.dart'; import 'package:stackwallet/pages_desktop_specific/my_stack_view/dialogs/desktop_coin_wallets_dialog.dart';
import 'package:stackwallet/pages_desktop_specific/my_stack_view/wallet_view/desktop_wallet_view.dart';
import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/format.dart'; import 'package:stackwallet/utilities/format.dart';
import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart'; import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/table_view/table_view.dart'; import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
import 'package:stackwallet/widgets/table_view/table_view_cell.dart'; import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart';
import 'package:stackwallet/widgets/table_view/table_view_row.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart';
class WalletSummaryTable extends ConsumerStatefulWidget { class WalletSummaryTable extends ConsumerStatefulWidget {
const WalletSummaryTable({Key? key}) : super(key: key); const WalletSummaryTable({Key? key}) : super(key: key);
@ -31,48 +29,60 @@ class _WalletTableState extends ConsumerState<WalletSummaryTable> {
), ),
); );
return TableView( return ListView.separated(
rows: [ itemBuilder: (_, index) {
for (int i = 0; i < providersByCoin.length; i++) final providers = providersByCoin[index].item2;
Builder( final coin = providersByCoin[index].item1;
key: Key("${providersByCoin[i].item1.name}_${runtimeType}_key"),
builder: (context) {
final providers = providersByCoin[i].item2;
VoidCallback? expandOverride; return RoundedWhiteContainer(
if (providers.length == 1) { padding: const EdgeInsets.all(20),
expandOverride = () async { onPressed: () {
final manager = ref.read(providers.first); showDialog<void>(
if (manager.coin == Coin.monero || context: context,
manager.coin == Coin.wownero) { builder: (_) => DesktopDialog(
await manager.initializeExisting(); maxHeight: 600,
} maxWidth: 700,
await Navigator.of(context).pushNamed( child: Column(
DesktopWalletView.routeName, children: [
arguments: manager.walletId, Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.only(left: 32),
child: Text(
"${coin.prettyName} (${coin.ticker}) wallets",
style: STextStyles.desktopH3(context),
),
),
const DesktopDialogCloseButton(),
],
),
Expanded(
child: Padding(
padding: const EdgeInsets.only(
left: 32,
right: 32,
bottom: 32,
),
child: DesktopCoinWalletsDialog(
coin: coin,
navigatorState: Navigator.of(context),
),
),
),
],
),
),
); );
}; },
} child: Row(
children: [
return TableViewRow( Expanded(
expandOverride: expandOverride,
padding: const EdgeInsets.symmetric(
horizontal: 20,
vertical: 16,
),
decoration: BoxDecoration(
color: Theme.of(context).extension<StackColors>()!.popupBG,
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
),
),
cells: [
TableViewCell(
flex: 4, flex: 4,
child: Row( child: Row(
children: [ children: [
SvgPicture.asset( SvgPicture.asset(
Assets.svg.iconFor(coin: providersByCoin[i].item1), Assets.svg.iconFor(coin: providersByCoin[index].item1),
width: 28, width: 28,
height: 28, height: 28,
), ),
@ -80,9 +90,9 @@ class _WalletTableState extends ConsumerState<WalletSummaryTable> {
width: 10, width: 10,
), ),
Text( Text(
providersByCoin[i].item1.prettyName, providersByCoin[index].item1.prettyName,
style: STextStyles.desktopTextExtraSmall(context) style:
.copyWith( STextStyles.desktopTextExtraSmall(context).copyWith(
color: Theme.of(context) color: Theme.of(context)
.extension<StackColors>()! .extension<StackColors>()!
.textDark, .textDark,
@ -91,37 +101,145 @@ class _WalletTableState extends ConsumerState<WalletSummaryTable> {
], ],
), ),
), ),
TableViewCell( Expanded(
flex: 4, flex: 4,
child: Text( child: Text(
providers.length == 1 providers.length == 1
? "${providers.length} wallet" ? "${providers.length} wallet"
: "${providers.length} wallets", : "${providers.length} wallets",
style: style: STextStyles.desktopTextExtraSmall(context).copyWith(
STextStyles.desktopTextExtraSmall(context).copyWith(
color: Theme.of(context) color: Theme.of(context)
.extension<StackColors>()! .extension<StackColors>()!
.textSubtitle1, .textSubtitle1,
), ),
), ),
), ),
TableViewCell( Expanded(
flex: 6, flex: 6,
child: TablePriceInfo( child: TablePriceInfo(
coin: providersByCoin[i].item1, coin: providersByCoin[index].item1,
), ),
), ),
], ],
expandingChild: CoinWalletsTable(
coin: providersByCoin[i].item1,
), ),
); );
}, },
separatorBuilder: (_, __) => const SizedBox(
height: 10,
), ),
], itemCount: providersByCoin.length,
); );
} }
} }
//
// class WalletSummaryTable extends ConsumerStatefulWidget {
// const WalletSummaryTable({Key? key}) : super(key: key);
//
// @override
// ConsumerState<WalletSummaryTable> createState() => _WalletTableState();
// }
//
// class _WalletTableState extends ConsumerState<WalletSummaryTable> {
// @override
// Widget build(BuildContext context) {
// debugPrint("BUILD: $runtimeType");
// final providersByCoin = ref.watch(
// walletsChangeNotifierProvider.select(
// (value) => value.getManagerProvidersByCoin(),
// ),
// );
//
// return TableView(
// rows: [
// for (int i = 0; i < providersByCoin.length; i++)
// Builder(
// key: Key("${providersByCoin[i].item1.name}_${runtimeType}_key"),
// builder: (context) {
// final providers = providersByCoin[i].item2;
//
// VoidCallback? expandOverride;
// if (providers.length == 1) {
// expandOverride = () async {
// final manager = ref.read(providers.first);
// if (manager.coin == Coin.monero ||
// manager.coin == Coin.wownero) {
// await manager.initializeExisting();
// }
// await Navigator.of(context).pushNamed(
// DesktopWalletView.routeName,
// arguments: manager.walletId,
// );
// };
// }
//
// return TableViewRow(
// expandOverride: expandOverride,
// padding: const EdgeInsets.symmetric(
// horizontal: 20,
// vertical: 16,
// ),
// decoration: BoxDecoration(
// color: Theme.of(context).extension<StackColors>()!.popupBG,
// borderRadius: BorderRadius.circular(
// Constants.size.circularBorderRadius,
// ),
// ),
// cells: [
// TableViewCell(
// flex: 4,
// child: Row(
// children: [
// SvgPicture.asset(
// Assets.svg.iconFor(coin: providersByCoin[i].item1),
// width: 28,
// height: 28,
// ),
// const SizedBox(
// width: 10,
// ),
// Text(
// providersByCoin[i].item1.prettyName,
// style: STextStyles.desktopTextExtraSmall(context)
// .copyWith(
// color: Theme.of(context)
// .extension<StackColors>()!
// .textDark,
// ),
// )
// ],
// ),
// ),
// TableViewCell(
// flex: 4,
// child: Text(
// providers.length == 1
// ? "${providers.length} wallet"
// : "${providers.length} wallets",
// style:
// STextStyles.desktopTextExtraSmall(context).copyWith(
// color: Theme.of(context)
// .extension<StackColors>()!
// .textSubtitle1,
// ),
// ),
// ),
// TableViewCell(
// flex: 6,
// child: TablePriceInfo(
// coin: providersByCoin[i].item1,
// ),
// ),
// ],
// expandingChild: CoinWalletsTable(
// coin: providersByCoin[i].item1,
// ),
// );
// },
// ),
// ],
// );
// }
// }
class TablePriceInfo extends ConsumerWidget { class TablePriceInfo extends ConsumerWidget {
const TablePriceInfo({Key? key, required this.coin}) : super(key: key); const TablePriceInfo({Key? key, required this.coin}) : super(key: key);

View file

@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:stackwallet/pages/token_view/token_view.dart'; import 'package:stackwallet/pages/token_view/token_view.dart';
import 'package:stackwallet/pages/wallet_view/wallet_view.dart'; import 'package:stackwallet/pages/wallet_view/wallet_view.dart';
import 'package:stackwallet/pages_desktop_specific/my_stack_view/wallet_view/desktop_wallet_view.dart';
import 'package:stackwallet/providers/db/main_db_provider.dart'; import 'package:stackwallet/providers/db/main_db_provider.dart';
import 'package:stackwallet/providers/global/secure_store_provider.dart'; import 'package:stackwallet/providers/global/secure_store_provider.dart';
import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/providers/providers.dart';
@ -13,6 +14,8 @@ import 'package:stackwallet/services/transaction_notification_tracker.dart';
import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/show_loading.dart'; import 'package:stackwallet/utilities/show_loading.dart';
import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/conditional_parent.dart';
import 'package:stackwallet/widgets/rounded_white_container.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart';
import 'package:stackwallet/widgets/wallet_info_row/wallet_info_row.dart'; import 'package:stackwallet/widgets/wallet_info_row/wallet_info_row.dart';
import 'package:tuple/tuple.dart'; import 'package:tuple/tuple.dart';
@ -23,27 +26,15 @@ class WalletSheetCard extends ConsumerWidget {
required this.walletId, required this.walletId,
this.contractAddress, this.contractAddress,
this.popPrevious = false, this.popPrevious = false,
this.desktopNavigatorState,
}) : super(key: key); }) : super(key: key);
final String walletId; final String walletId;
final String? contractAddress; final String? contractAddress;
final bool popPrevious; final bool popPrevious;
final NavigatorState? desktopNavigatorState;
@override void _openWallet(BuildContext context, WidgetRef ref) async {
Widget build(BuildContext context, WidgetRef ref) {
return RoundedWhiteContainer(
padding: const EdgeInsets.all(0),
child: MaterialButton(
// splashColor: Theme.of(context).extension<StackColors>()!.highlight,
key: Key("walletsSheetItemButtonKey_$walletId"),
padding: const EdgeInsets.all(5),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
),
),
onPressed: () async {
final nav = Navigator.of(context); final nav = Navigator.of(context);
final manager = final manager =
@ -53,6 +44,15 @@ class WalletSheetCard extends ConsumerWidget {
} }
if (context.mounted) { if (context.mounted) {
if (popPrevious) nav.pop(); if (popPrevious) nav.pop();
if (desktopNavigatorState != null) {
unawaited(
desktopNavigatorState!.pushNamed(
DesktopWalletView.routeName,
arguments: walletId,
),
);
} else {
unawaited( unawaited(
nav.pushNamed( nav.pushNamed(
WalletView.routeName, WalletView.routeName,
@ -60,14 +60,15 @@ class WalletSheetCard extends ConsumerWidget {
walletId, walletId,
ref ref
.read(walletsChangeNotifierProvider) .read(walletsChangeNotifierProvider)
.getManagerProvider(walletId)), .getManagerProvider(walletId),
),
), ),
); );
}
if (contractAddress != null) { if (contractAddress != null) {
final contract = ref final contract =
.read(mainDBProvider) ref.read(mainDBProvider).getEthContractSync(contractAddress!)!;
.getEthContractSync(contractAddress!)!;
ref.read(tokenServiceStateProvider.state).state = EthTokenWallet( ref.read(tokenServiceStateProvider.state).state = EthTokenWallet(
token: contract, token: contract,
secureStore: ref.read(secureStoreProvider), secureStore: ref.read(secureStoreProvider),
@ -87,19 +88,46 @@ class WalletSheetCard extends ConsumerWidget {
// pop loading // pop loading
nav.pop(); nav.pop();
// if (context.mounted) { if (desktopNavigatorState != null) {
// await desktopNavigatorState !.pushNamed(
// DesktopTokenView.routeName,
// arguments: walletId,
// );
} else {
await nav.pushNamed( await nav.pushNamed(
TokenView.routeName, TokenView.routeName,
arguments: walletId, arguments: walletId,
); );
// }
} }
} }
}, }
}
@override
Widget build(BuildContext context, WidgetRef ref) {
return ConditionalParent(
condition: !Util.isDesktop,
builder: (child) => RoundedWhiteContainer(
padding: const EdgeInsets.all(0),
child: MaterialButton(
// splashColor: Theme.of(context).extension<StackColors>()!.highlight,
key: Key("walletsSheetItemButtonKey_$walletId"),
padding: const EdgeInsets.all(5),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
),
),
onPressed: () => _openWallet(context, ref),
child: child,
),
),
child: WalletInfoRow( child: WalletInfoRow(
walletId: walletId, walletId: walletId,
contractAddress: contractAddress, contractAddress: contractAddress,
), onPressedDesktop:
Util.isDesktop ? () => _openWallet(context, ref) : null,
), ),
); );
} }

View file

@ -1,14 +1,13 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/svg.dart';
import 'package:stackwallet/models/isar/models/ethereum/eth_contract.dart'; import 'package:stackwallet/models/isar/models/ethereum/eth_contract.dart';
import 'package:stackwallet/pages/token_view/sub_widgets/token_summary.dart'; import 'package:stackwallet/pages/token_view/sub_widgets/token_summary.dart';
import 'package:stackwallet/providers/db/main_db_provider.dart'; import 'package:stackwallet/providers/db/main_db_provider.dart';
import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart'; import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/utilities/util.dart'; import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/custom_buttons/blue_text_button.dart';
import 'package:stackwallet/widgets/wallet_info_row/sub_widgets/wallet_info_row_balance_future.dart'; import 'package:stackwallet/widgets/wallet_info_row/sub_widgets/wallet_info_row_balance_future.dart';
import 'package:stackwallet/widgets/wallet_info_row/sub_widgets/wallet_info_row_coin_icon.dart'; import 'package:stackwallet/widgets/wallet_info_row/sub_widgets/wallet_info_row_coin_icon.dart';
@ -39,18 +38,14 @@ class WalletInfoRow extends ConsumerWidget {
} }
if (Util.isDesktop) { if (Util.isDesktop) {
return MouseRegion( return Padding(
cursor: SystemMouseCursors.click,
child: GestureDetector(
onTap: onPressedDesktop,
child: Padding(
padding: padding, padding: padding,
child: Container( child: Container(
color: Colors.transparent, color: Colors.transparent,
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
flex: 4, flex: 3,
child: Row( child: Row(
children: [ children: [
WalletInfoCoinIcon( WalletInfoCoinIcon(
@ -60,7 +55,28 @@ class WalletInfoRow extends ConsumerWidget {
const SizedBox( const SizedBox(
width: 12, width: 12,
), ),
contract != null
? Row(
children: [
Text( Text(
contract.name,
style:
STextStyles.desktopTextExtraSmall(context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark,
),
),
const SizedBox(
width: 4,
),
CoinTickerTag(
walletId: walletId,
),
],
)
: Text(
manager.walletName, manager.walletName,
style: STextStyles.desktopTextExtraSmall(context) style: STextStyles.desktopTextExtraSmall(context)
.copyWith( .copyWith(
@ -76,29 +92,24 @@ class WalletInfoRow extends ConsumerWidget {
flex: 4, flex: 4,
child: WalletInfoRowBalance( child: WalletInfoRowBalance(
walletId: walletId, walletId: walletId,
contractAddress: contractAddress,
), ),
), ),
Expanded( Expanded(
flex: 6, flex: 2,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
SvgPicture.asset( CustomTextButton(
Assets.svg.chevronRight, text: "Open wallet",
width: 20, onTap: onPressedDesktop,
height: 20, ),
color: Theme.of(context)
.extension<StackColors>()!
.textSubtitle1,
)
], ],
), ),
) )
], ],
), ),
), ),
),
),
); );
} else { } else {
return Row( return Row(