diff --git a/packages/patrol/example/lib/cubit/auth_cubit.dart b/packages/patrol/example/lib/cubit/auth_cubit.dart index 2123c0ae1..3b32dbacb 100644 --- a/packages/patrol/example/lib/cubit/auth_cubit.dart +++ b/packages/patrol/example/lib/cubit/auth_cubit.dart @@ -10,7 +10,7 @@ class AuthCubit extends Cubit { final FirebaseAuth? _firebaseAuth; final GoogleSignIn? _googleSignIn; - late final StreamSubscription _authStateChangesSubscription; + StreamSubscription? _authStateChangesSubscription; void init() { if (_firebaseAuth == null || _googleSignIn == null) { @@ -67,7 +67,7 @@ class AuthCubit extends Cubit { @override Future close() { - _authStateChangesSubscription.cancel(); + _authStateChangesSubscription?.cancel(); return super.close(); } }