You've already forked flutter-rp-example
added support for web ; bumped dart_core_sdk version to 1.13.2
This commit is contained in:
@@ -1,22 +1,30 @@
|
||||
|
||||
import 'dart:io' show Platform;
|
||||
|
||||
import 'package:flutter/foundation.dart' show kIsWeb;
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
|
||||
String getRedirectURI() {
|
||||
if (kIsWeb) {
|
||||
// Use the current page's origin so the redirect URI always matches
|
||||
// the host and port the app is actually served on.
|
||||
final base = Uri.base;
|
||||
final port = base.hasPort ? ':${base.port}' : '';
|
||||
return '/${base.host}$port/auth.html';
|
||||
}
|
||||
try {
|
||||
if (Platform.isAndroid) {
|
||||
return "";
|
||||
} else {
|
||||
return "/localhost:3000/auth.html";
|
||||
return "/localhost:8080/auth.html";
|
||||
}
|
||||
} catch (e) {
|
||||
// Must be web
|
||||
return "/localhost:3000/auth.html";
|
||||
return "/localhost:8080/auth.html";
|
||||
}
|
||||
}
|
||||
|
||||
Future<String> getCallbackUrlScheme() async {
|
||||
if (kIsWeb) return "http";
|
||||
try {
|
||||
if (Platform.isAndroid) {
|
||||
PackageInfo packageInfo = await PackageInfo.fromPlatform();
|
||||
@@ -25,7 +33,6 @@ Future<String> getCallbackUrlScheme() async {
|
||||
return "http";
|
||||
}
|
||||
} catch (e) {
|
||||
// Must be web
|
||||
return "http";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user