toJson method

  1. @override
Map<String, dynamic>? toJson(
  1. IdentityState state
)

Responsible for converting a concrete instance of the bloc state into the the Map<String, dynamic> representation.

If toJson returns null, then no state changes will be persisted.

Implementation

@override
Map<String, dynamic>? toJson(IdentityState state) {
  return {
    'isLoggedIn': state.isLoggedIn,
    'user': state.user.toJson(),
  };
}