Skip to content

Commit fabd0dd

Browse files
authored
🐛 Remove null aware operators from not null widgets (#132)
WidgetsBinding is never null
1 parent 7711753 commit fabd0dd

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/flutter_web_auth.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ class FlutterWebAuth {
3030
/// [callbackUrlScheme] should be a string specifying the scheme of the url that the page will redirect to upon successful authentication.
3131
/// [preferEphemeral] if this is specified as `true`, an ephemeral web browser session will be used where possible (`FLAG_ACTIVITY_NO_HISTORY` on Android, `prefersEphemeralWebBrowserSession` on iOS/macOS)
3232
static Future<String> authenticate({required String url, required String callbackUrlScheme, bool? preferEphemeral}) async {
33-
WidgetsBinding.instance?.removeObserver(_resumedObserver); // safety measure so we never add this observer twice
34-
WidgetsBinding.instance?.addObserver(_resumedObserver);
33+
WidgetsBinding.instance.removeObserver(_resumedObserver); // safety measure so we never add this observer twice
34+
WidgetsBinding.instance.addObserver(_resumedObserver);
3535
return await _channel.invokeMethod('authenticate', <String, dynamic>{
3636
'url': url,
3737
'callbackUrlScheme': callbackUrlScheme,
@@ -44,6 +44,6 @@ class FlutterWebAuth {
4444
/// terminate all `authenticate` calls with an error.
4545
static Future<void> _cleanUpDanglingCalls() async {
4646
await _channel.invokeMethod('cleanUpDanglingCalls');
47-
WidgetsBinding.instance?.removeObserver(_resumedObserver);
47+
WidgetsBinding.instance.removeObserver(_resumedObserver);
4848
}
4949
}

0 commit comments

Comments
 (0)