improved performance and battery usage on older devices
This commit is contained in:
@@ -59,6 +59,12 @@ class ChatBloc
|
||||
@override
|
||||
ChatState fromStorage(Map<String, dynamic> json) => ChatState.fromJson(json);
|
||||
|
||||
// Loading-older and reply-reference flips must not re-persist up to 500
|
||||
// messages; GetChatResponse has no `==`, so it compares by identity here.
|
||||
@override
|
||||
Object? persistenceKey(ChatState data) =>
|
||||
(data.currentToken, data.chatResponse, data.hasMoreOld);
|
||||
|
||||
@override
|
||||
Map<String, dynamic>? toStorage(ChatState state) {
|
||||
final response = state.chatResponse;
|
||||
|
||||
Reference in New Issue
Block a user