minor: add examples for address resolver scheme [skip ci]

This commit is contained in:
OmarHatem 2024-12-18 19:55:48 +02:00
parent 3473cfe0a0
commit 301cb3b7e0

View file

@ -134,6 +134,7 @@ class AddressResolver {
Future<ParsedAddress> resolve(BuildContext context, String text, CryptoCurrency currency) async { Future<ParsedAddress> resolve(BuildContext context, String text, CryptoCurrency currency) async {
final ticker = currency.title; final ticker = currency.title;
try { try {
// twitter handle example: @username
if (text.startsWith('@') && !text.substring(1).contains('@')) { if (text.startsWith('@') && !text.substring(1).contains('@')) {
if (settingsStore.lookupsTwitter) { if (settingsStore.lookupsTwitter) {
final formattedName = text.substring(1); final formattedName = text.substring(1);
@ -165,6 +166,7 @@ class AddressResolver {
} }
} }
// Mastodon example: @username@hostname.xxx
if (text.startsWith('@') && text.contains('@', 1) && text.contains('.', 1)) { if (text.startsWith('@') && text.contains('@', 1) && text.contains('.', 1)) {
if (settingsStore.lookupsMastodon) { if (settingsStore.lookupsMastodon) {
final subText = text.substring(1); final subText = text.substring(1);