set launchUrl mode to LaunchMode.externalApplication

This commit is contained in:
Serhii
2024-05-23 14:00:52 +03:00
parent dfba5be2cd
commit f401dafdca
13 changed files with 40 additions and 57 deletions
+6 -6
View File
@@ -19,7 +19,7 @@ class OrderDetailsViewModel = OrderDetailsViewModelBase
abstract class OrderDetailsViewModelBase with Store {
OrderDetailsViewModelBase({required WalletBase wallet, required Order orderForDetails})
: items = ObservableList<StandartListItem>(),
: items = ObservableList<StandartListItem>(),
order = orderForDetails {
if (order.provider != null) {
switch (order.provider) {
@@ -101,13 +101,13 @@ abstract class OrderDetailsViewModelBase with Store {
TrackTradeListItem(
title: S.current.track,
value: buildURL,
onTap: () {
onTap: () async {
try {
launch(buildURL);
final uri = Uri.parse(buildURL);
if (await canLaunchUrl(uri))
await launchUrl(uri, mode: LaunchMode.externalApplication);
} catch (e) {}
}
)
);
}));
}
}
+1 -1
View File
@@ -179,7 +179,7 @@ abstract class TradeDetailsViewModelBase with Store {
void _launchUrl(String url) {
final uri = Uri.parse(url);
try {
launchUrl(uri);
launchUrl(uri, mode: LaunchMode.externalApplication);
} catch (e) {}
}
}
@@ -99,9 +99,10 @@ abstract class TransactionDetailsViewModelBase with Store {
items.add(BlockExplorerListItem(
title: S.current.view_in_block_explorer,
value: _explorerDescription(type),
onTap: () {
onTap: () async {
try {
launch(_explorerUrl(type, tx.id));
final uri = Uri.parse(_explorerUrl(type, tx.id));
if (await canLaunchUrl(uri)) await launchUrl(uri, mode: LaunchMode.externalApplication);
} catch (e) {}
}));
@@ -56,7 +56,7 @@ abstract class UnspentCoinsDetailsViewModelBase with Store {
onTap: () {
try {
final url = Uri.parse(_explorerUrl(_type, unspentCoinsItem.hash));
return launchUrl(url);
return launchUrl(url, mode: LaunchMode.externalApplication);
} catch (e) {}
},
));