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,11 +53,8 @@ class _MyWalletsState extends ConsumerState<MyWallets> {
height: 20, height: 20,
), ),
const Expanded( const Expanded(
child: MouseRegion(
cursor: SystemMouseCursors.click,
child: WalletSummaryTable(), child: WalletSummaryTable(),
), ),
),
], ],
), ),
); );

View file

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

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,7 +26,9 @@ class WalletInfoRow extends ConsumerWidget {
.getManagerProvider(walletId)); .getManagerProvider(walletId));
if (Util.isDesktop) { if (Util.isDesktop) {
return GestureDetector( return MouseRegion(
cursor: SystemMouseCursors.click,
child: GestureDetector(
onTap: onPressed, onTap: onPressed,
child: Container( child: Container(
color: Colors.transparent, color: Colors.transparent,
@ -42,9 +44,11 @@ class WalletInfoRow extends ConsumerWidget {
), ),
Text( Text(
manager.walletName, manager.walletName,
style: STextStyles.desktopTextExtraSmall(context).copyWith( style:
color: STextStyles.desktopTextExtraSmall(context).copyWith(
Theme.of(context).extension<StackColors>()!.textDark, color: Theme.of(context)
.extension<StackColors>()!
.textDark,
), ),
), ),
], ],
@ -75,6 +79,7 @@ class WalletInfoRow extends ConsumerWidget {
], ],
), ),
), ),
),
); );
} else { } else {
return Row( return Row(