From 2f4a94dd91272a6c437512c098d4e9fb2c92d231 Mon Sep 17 00:00:00 2001 From: Shogo Hyodo Date: Fri, 2 Aug 2024 19:23:43 +0900 Subject: [PATCH] Support Mini Wallet browser --- .../lib/controller/authentication_service.dart | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/flutter_bird_app/lib/controller/authentication_service.dart b/flutter_bird_app/lib/controller/authentication_service.dart index 3a20452..25a2cde 100644 --- a/flutter_bird_app/lib/controller/authentication_service.dart +++ b/flutter_bird_app/lib/controller/authentication_service.dart @@ -2,6 +2,7 @@ import 'dart:convert'; import 'dart:developer'; import 'dart:io'; import 'dart:math' as math; +import 'dart:html' as html; import 'package:eth_sig_util/eth_sig_util.dart'; import 'package:flutter/foundation.dart'; @@ -323,6 +324,12 @@ class AuthenticationServiceImpl implements AuthenticationService { return; } + final isLine = Uri.parse(html.window.location.href).queryParameters['is_line'] != null; + if (wallet.name == 'Mini Wallet' && isLine) { + html.window.parent?.postMessage({'type': 'display_uri', 'data': uri}, "*", []); + return; + } + if (wallet.mobile.native != null) { await launchUrl( _convertToWcUri(appLink: wallet.mobile.native!, wcUri: uri),