From c05c2e7c295d4838dae5f3c99b632582835dc61d Mon Sep 17 00:00:00 2001 From: Tanner Silva Date: Mon, 8 Feb 2021 18:31:47 -0600 Subject: [PATCH] optimized code --- lib/view_model/trade_details_view_model.dart | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/view_model/trade_details_view_model.dart b/lib/view_model/trade_details_view_model.dart index f65f8646e..ba03996ad 100644 --- a/lib/view_model/trade_details_view_model.dart +++ b/lib/view_model/trade_details_view_model.dart @@ -91,12 +91,14 @@ abstract class TradeDetailsViewModelBase with Store { value: trade.provider.toString())); } - if (trade.provider.title == "ChangeNOW") { + if (trade.provider is ChangeNowExchangeProvider) { + final buildURL = + 'https://changenow.io/exchange/txs/${trade.id.toString()}'; items.add(TrackTradeListItem( - title: "Track", - value: "https://changenow.io/exchange/txs/${trade.id.toString()}", + title: 'Track', + value: buildURL, onTap: () { - launch("https://changenow.io/exchange/txs/${trade.id.toString()}"); + launch(buildURL); })); }