From 5cb2478370c5d6ca3b5e8617a881bb5303bec61a Mon Sep 17 00:00:00 2001 From: Serhii Date: Thu, 15 Feb 2024 16:30:51 +0200 Subject: [PATCH] minor fixes --- .../order_details/order_details_page.dart | 42 +++++++++---------- lib/view_model/buy/buy_view_model.dart | 3 +- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/lib/src/screens/order_details/order_details_page.dart b/lib/src/screens/order_details/order_details_page.dart index 10254eaef..5afa3735d 100644 --- a/lib/src/screens/order_details/order_details_page.dart +++ b/lib/src/screens/order_details/order_details_page.dart @@ -46,29 +46,27 @@ class OrderDetailsPageBodyState extends State { @override Widget build(BuildContext context) { - return Observer(builder: (_) { - return SectionStandardList( - sectionCount: 1, - itemCounter: (int _) => orderDetailsViewModel.items.length, - itemBuilder: (__, index) { - final item = orderDetailsViewModel.items[index]; + return SectionStandardList( + sectionCount: 1, + itemCounter: (int _) => orderDetailsViewModel.items.length, + itemBuilder: (__, index) { + final item = orderDetailsViewModel.items[index]; - if (item is TrackTradeListItem) { - return GestureDetector( - onTap: item.onTap, - child: ListRow( - title: '${item.title}', value: '${item.value}')); - } else { - return GestureDetector( - onTap: () { - Clipboard.setData(ClipboardData(text: '${item.value}')); - showBar(context, S.of(context).copied_to_clipboard); - }, - child: ListRow( - title: '${item.title}', value: '${item.value}')); - } - }); - }); + if (item is TrackTradeListItem) { + return GestureDetector( + onTap: item.onTap, + child: ListRow( + title: '${item.title}', value: '${item.value}')); + } else { + return GestureDetector( + onTap: () { + Clipboard.setData(ClipboardData(text: '${item.value}')); + showBar(context, S.of(context).copied_to_clipboard); + }, + child: ListRow( + title: '${item.title}', value: '${item.value}')); + } + }); } } \ No newline at end of file diff --git a/lib/view_model/buy/buy_view_model.dart b/lib/view_model/buy/buy_view_model.dart index 478db2bd6..ec5c3b834 100644 --- a/lib/view_model/buy/buy_view_model.dart +++ b/lib/view_model/buy/buy_view_model.dart @@ -46,7 +46,8 @@ abstract class BuyViewModelBase with Store { bool isBuyAction = this.isBuyAction ?? true; final formattedCryptoCurrency = - cryptoCurrency != null ? CryptoCurrency.fromString(cryptoCurrency) : null; + cryptoCurrency != null && cryptoCurrency.isNotEmpty + ? CryptoCurrency.fromString(cryptoCurrency) : null; final orderData = { 'id': orderId,