Skip to content

Commit

Permalink
Fix: 딥링크 앱 미설치시 toast 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ybmin committed Sep 8, 2023
1 parent 372aefa commit 49c84ed
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions lib/views/taxiView.dart
Original file line number Diff line number Diff line change
Expand Up @@ -299,29 +299,19 @@ class TaxiView extends HookWidget {
"chrome",
"data",
"javascript",
"intent",
"about"
].contains(uri.scheme)) {
if (await canLaunchUrlString(url)) {
await launchUrlString(
url,
);
await launchUrlString(url,
mode: LaunchMode.externalApplication);
return NavigationActionPolicy.CANCEL;
}
}

var newHeaders = Map<String, String>.from(
navigationAction.request.headers ?? {});
if (!newHeaders.containsKey("Referer") &&
navigationAction.request.url.toString() !=
'about:blank') {
newHeaders['Referer'] =
navigationAction.request.url.toString();
newHeaders['Origin'] =
"https://taxi.sparcs.org/"; //TODO: remove hardcoding
var newRequest = navigationAction.request;
newRequest.headers = newHeaders;
await controller.loadUrl(urlRequest: newRequest);

Fluttertoast.showToast(
msg: "앱이 설치되어 있지 않아 실행에 실패했습니다",
toastLength: Toast.LENGTH_SHORT,
textColor: Colors.black,
backgroundColor: Colors.white);
return NavigationActionPolicy.CANCEL;
}

Expand Down

0 comments on commit 49c84ed

Please sign in to comment.