mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-03 17:40:43 +00:00
Temporarily fetch unstoppable domains only on mobile
This commit is contained in:
parent
132033207e
commit
adfebe6940
1 changed files with 14 additions and 7 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
|
||||||
const channel = MethodChannel('com.cake_wallet/native_utils');
|
const channel = MethodChannel('com.cake_wallet/native_utils');
|
||||||
|
@ -6,13 +8,18 @@ Future<String> fetchUnstoppableDomainAddress(String domain, String ticker) async
|
||||||
var address = '';
|
var address = '';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
address = await channel.invokeMethod<String>(
|
if (Platform.isAndroid || Platform.isIOS) {
|
||||||
'getUnstoppableDomainAddress',
|
address = await channel.invokeMethod<String>(
|
||||||
<String, String> {
|
'getUnstoppableDomainAddress',
|
||||||
'domain' : domain,
|
<String, String> {
|
||||||
'ticker' : ticker
|
'domain' : domain,
|
||||||
}
|
'ticker' : ticker
|
||||||
) ?? '';
|
}
|
||||||
|
) ?? '';
|
||||||
|
} else {
|
||||||
|
// TODO: Integrate with Unstoppable domains resolution API
|
||||||
|
return address;
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Unstoppable domain error: ${e.toString()}');
|
print('Unstoppable domain error: ${e.toString()}');
|
||||||
address = '';
|
address = '';
|
||||||
|
|
Loading…
Reference in a new issue