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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return GestureDetector(
color: Colors.transparent, onLongPress: () =>
padding: EdgeInsets.all(24), dashboardViewModel.balanceViewModel.isReversing =
child: GestureDetector( !dashboardViewModel.balanceViewModel.isReversing,
onLongPress: () => onLongPressUp: () =>
dashboardViewModel.balanceViewModel.isReversing = dashboardViewModel.balanceViewModel.isReversing =
!dashboardViewModel.balanceViewModel.isReversing, !dashboardViewModel.balanceViewModel.isReversing,
onLongPressUp: () => child: Container(
dashboardViewModel.balanceViewModel.isReversing = color: Colors.transparent,
!dashboardViewModel.balanceViewModel.isReversing, padding: EdgeInsets.all(24),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,

View file

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