init static method
Implementation
static void init(BuildContext context) {
SimpleAuthFlutter.context = context;
simpleAuth.AuthStorage.shared = _shared;
simpleAuth.OAuthApi.sharedShowAuthenticator = showAuthenticator;
simpleAuth.BasicAuthApi.sharedShowAuthenticator = showBasicAuthenticator;
onUrlChanged!.listen((UrlChange change) {
var authenticator = authenticators[change.identifier!];
if (change.url == "canceled") {
authenticator!.cancel();
return;
} else if (change.url == "error") {
authenticator!.onError(change.description!);
return;
}
var uri = Uri.tryParse(change.url!)!;
if (authenticator!.checkUrl(uri)) {
_channel.invokeMethod("completed", {"identifier": change.identifier});
} else if (change.foreComplete) {
authenticator.onError("Unable to get an AuthToken from the server");
}
});
}