Aidra Connect
10.0.2+16
Aidra Connect Mobile Application
Loading...
Searching...
No Matches
auth_notifier.dart
Go to the documentation of this file.
1
import
'dart:async';
2
import
'/features/authentication/presentation/logic/authentication_bloc/authentication_bloc.dart';
3
import
'package:flutter/material.dart';
4
5
class
AuthNotifier
extends
ChangeNotifier
{
6
final
AuthenticationBloc
_authBloc
;
7
late
final
StreamSubscription<AuthenticationState>
_subscription
;
8
9
AuthNotifier
(this._authBloc) {
10
_subscription
=
_authBloc
.stream.listen((state) {
11
notifyListeners();
12
});
13
}
14
15
bool
get
isAuthenticated
=>
_authBloc
.state is AuthenticatedState;
16
17
@
override
18
void
dispose
() {
19
_subscription
.cancel();
20
super.dispose();
21
}
22
}
ChangeNotifier
Definition
auth_notifier.dart:5
ChangeNotifier::_authBloc
final AuthenticationBloc _authBloc
Definition
auth_notifier.dart:6
ChangeNotifier::dispose
override void dispose()
Definition
auth_notifier.dart:18
ChangeNotifier::isAuthenticated
bool get isAuthenticated
Definition
auth_notifier.dart:15
ChangeNotifier::_subscription
late final StreamSubscription< AuthenticationState > _subscription
Definition
auth_notifier.dart:7
ChangeNotifier::AuthNotifier
AuthNotifier(this._authBloc)
Definition
auth_notifier.dart:9
lib
core
router
auth_notifier.dart
Generated by
1.16.1