Add MouseRegion to Expandable widget and clean up duplications

This commit is contained in:
julian 2022-11-15 16:44:23 -06:00
parent b4488fceed
commit 07cf1f3f92
4 changed files with 59 additions and 55 deletions

View file

@ -53,10 +53,7 @@ class _MyWalletsState extends ConsumerState<MyWallets> {
height: 20, height: 20,
), ),
const Expanded( const Expanded(
child: MouseRegion( child: WalletSummaryTable(),
cursor: SystemMouseCursors.click,
child: WalletSummaryTable(),
),
), ),
], ],
), ),

View file

@ -89,11 +89,14 @@ class _ExpandableState extends State<Expandable> with TickerProviderStateMixin {
return Column( return Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
GestureDetector( MouseRegion(
onTap: toggle, cursor: SystemMouseCursors.click,
child: Container( child: GestureDetector(
color: Colors.transparent, onTap: toggle,
child: widget.header, child: Container(
color: Colors.transparent,
child: widget.header,
),
), ),
), ),
SizeTransition( SizeTransition(

View file

@ -1,5 +1,4 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:stackwallet/widgets/table_view/table_view_row.dart';
class TableView extends StatefulWidget { class TableView extends StatefulWidget {
const TableView({ const TableView({
@ -9,7 +8,7 @@ class TableView extends StatefulWidget {
this.shrinkWrap = false, this.shrinkWrap = false,
}) : super(key: key); }) : super(key: key);
final List<TableViewRow> rows; final List<Widget> rows;
final double rowSpacing; final double rowSpacing;
final bool shrinkWrap; final bool shrinkWrap;

View file

@ -26,53 +26,58 @@ class WalletInfoRow extends ConsumerWidget {
.getManagerProvider(walletId)); .getManagerProvider(walletId));
if (Util.isDesktop) { if (Util.isDesktop) {
return GestureDetector( return MouseRegion(
onTap: onPressed, cursor: SystemMouseCursors.click,
child: Container( child: GestureDetector(
color: Colors.transparent, onTap: onPressed,
child: Row( child: Container(
children: [ color: Colors.transparent,
Expanded( child: Row(
flex: 4, children: [
child: Row( Expanded(
children: [ flex: 4,
WalletInfoCoinIcon(coin: manager.coin), child: Row(
const SizedBox( children: [
width: 12, WalletInfoCoinIcon(coin: manager.coin),
), const SizedBox(
Text( width: 12,
manager.walletName,
style: STextStyles.desktopTextExtraSmall(context).copyWith(
color:
Theme.of(context).extension<StackColors>()!.textDark,
), ),
), Text(
], manager.walletName,
style:
STextStyles.desktopTextExtraSmall(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark,
),
),
],
),
), ),
), Expanded(
Expanded( flex: 4,
flex: 4, child: WalletInfoRowBalanceFuture(
child: WalletInfoRowBalanceFuture( walletId: walletId,
walletId: walletId, ),
), ),
), Expanded(
Expanded( flex: 6,
flex: 6, child: Row(
child: Row( mainAxisAlignment: MainAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end, children: [
children: [ SvgPicture.asset(
SvgPicture.asset( Assets.svg.chevronRight,
Assets.svg.chevronRight, width: 20,
width: 20, height: 20,
height: 20, color: Theme.of(context)
color: Theme.of(context) .extension<StackColors>()!
.extension<StackColors>()! .textSubtitle1,
.textSubtitle1, )
) ],
], ),
), )
) ],
], ),
), ),
), ),
); );