From cb5f8fe87b24eba2d9da6fba6aeb54ae80d92012 Mon Sep 17 00:00:00 2001 From: "Joshua F. Mathews" Date: Thu, 28 Apr 2022 09:14:00 -0600 Subject: [PATCH] Fixes platform exception when running on web --- lib/flutter_auth0_client.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/flutter_auth0_client.dart b/lib/flutter_auth0_client.dart index e179c5b..6d25efe 100644 --- a/lib/flutter_auth0_client.dart +++ b/lib/flutter_auth0_client.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'dart:convert'; import 'dart:io'; +import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; class Auth0Credentials { @@ -44,7 +45,7 @@ class FlutterAuth0Client { }); Future login() async { - if (Platform.isAndroid && scheme == null) { + if (!kIsWeb && Platform.isAndroid && scheme == null) { throw Exception("Scheme is required on Android."); } final rawJson = await _channel.invokeMethod('login', {