CAKE-288 | increased area of pressing on hidden balance; wrapped TradeRow and OrderRow by Observer

This commit is contained in:
OleksandrSobol 2021-03-31 20:22:41 +03:00
parent 3da9eb38aa
commit 5db97b6f02
2 changed files with 14 additions and 14 deletions

View file

@ -10,16 +10,16 @@ class BalancePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
color: Colors.transparent,
padding: EdgeInsets.all(24),
child: GestureDetector(
onLongPress: () =>
dashboardViewModel.balanceViewModel.isReversing =
!dashboardViewModel.balanceViewModel.isReversing,
onLongPressUp: () =>
dashboardViewModel.balanceViewModel.isReversing =
!dashboardViewModel.balanceViewModel.isReversing,
return GestureDetector(
onLongPress: () =>
dashboardViewModel.balanceViewModel.isReversing =
!dashboardViewModel.balanceViewModel.isReversing,
onLongPressUp: () =>
dashboardViewModel.balanceViewModel.isReversing =
!dashboardViewModel.balanceViewModel.isReversing,
child: Container(
color: Colors.transparent,
padding: EdgeInsets.all(24),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,

View file

@ -64,7 +64,7 @@ class TransactionsPage extends StatelessWidget {
if (item is TradeListItem) {
final trade = item.trade;
return TradeRow(
return Observer(builder: (_) => TradeRow(
onTap: () => Navigator.of(context).pushNamed(
Routes.tradeDetails,
arguments: trade),
@ -74,13 +74,13 @@ class TransactionsPage extends StatelessWidget {
createdAtFormattedDate:
DateFormat('HH:mm').format(trade.createdAt),
formattedAmount: item.tradeFormattedAmount
);
));
}
if (item is OrderListItem) {
final order = item.order;
return OrderRow(
return Observer(builder: (_) => OrderRow(
onTap: () => Navigator.of(context).pushNamed(
Routes.orderDetails,
arguments: order),
@ -89,7 +89,7 @@ class TransactionsPage extends StatelessWidget {
createdAtFormattedDate:
DateFormat('HH:mm').format(order.createdAt),
formattedAmount: item.orderFormattedAmount,
);
));
}
return Container(