Gate Flutter app behind Telegram
Some checks failed
Build and deploy Flutter Web / build (push) Failing after 3m19s
Some checks failed
Build and deploy Flutter Web / build (push) Failing after 3m19s
This commit is contained in:
2
lib/auth/telegram_launcher.dart
Normal file
2
lib/auth/telegram_launcher.dart
Normal file
@@ -0,0 +1,2 @@
|
||||
export 'telegram_launcher_stub.dart'
|
||||
if (dart.library.js_interop) 'telegram_launcher_web.dart';
|
||||
1
lib/auth/telegram_launcher_stub.dart
Normal file
1
lib/auth/telegram_launcher_stub.dart
Normal file
@@ -0,0 +1 @@
|
||||
void openTelegramUrl(String url) {}
|
||||
8
lib/auth/telegram_launcher_web.dart
Normal file
8
lib/auth/telegram_launcher_web.dart
Normal file
@@ -0,0 +1,8 @@
|
||||
import 'dart:js_interop';
|
||||
|
||||
@JS('window.open')
|
||||
external JSAny? _open(JSString url, JSString target, JSString features);
|
||||
|
||||
void openTelegramUrl(String url) {
|
||||
_open(url.toJS, '_blank'.toJS, 'noopener,noreferrer'.toJS);
|
||||
}
|
||||
Reference in New Issue
Block a user