fromJson method
Responsible for converting the Map<String, dynamic>
representation
of the bloc state into a concrete instance of the bloc state.
Implementation
@override
IdentityState? fromJson(Map<String, dynamic> json) {
return const IdentityState().copyWith(
isLoggedIn: json['isLoggedIn'] ?? false,
user: json.containsKey('user') ? User.fromJson(json['user']) : null,
);
}