big performance improvements!!
This commit is contained in:
parent
4acf624bff
commit
2d90a2adfe
8 changed files with 86 additions and 45 deletions
|
|
@ -27,7 +27,7 @@ abstract class Event with _$Event {
|
|||
String? decryptionError,
|
||||
String? sendError,
|
||||
@Default(IMap.empty()) IMap<String, int> reactions,
|
||||
int? lastEditRowId,
|
||||
@JsonKey(name: "last_edit_rowid") int? lastEditRowId,
|
||||
@UnreadTypeConverter() UnreadType? unreadType,
|
||||
}) = _Event;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import "package:freezed_annotation/freezed_annotation.dart";
|
||||
import "package:nexus/models/event.dart";
|
||||
import "package:nexus/models/room.dart";
|
||||
part "message_config.freezed.dart";
|
||||
part "message_config.g.dart";
|
||||
|
||||
|
|
@ -8,6 +9,7 @@ abstract class MessageConfig with _$MessageConfig {
|
|||
const factory MessageConfig({
|
||||
@Default(false) bool mustBeText,
|
||||
@Default(false) bool includeEdits,
|
||||
required Room room,
|
||||
required Event event,
|
||||
}) = _MessageConfig;
|
||||
|
||||
|
|
|
|||
17
lib/models/messages_config.dart
Normal file
17
lib/models/messages_config.dart
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import "package:fast_immutable_collections/fast_immutable_collections.dart";
|
||||
import "package:freezed_annotation/freezed_annotation.dart";
|
||||
import "package:nexus/models/event.dart";
|
||||
import "package:nexus/models/room.dart";
|
||||
part "messages_config.freezed.dart";
|
||||
part "messages_config.g.dart";
|
||||
|
||||
@freezed
|
||||
abstract class MessagesConfig with _$MessagesConfig {
|
||||
const factory MessagesConfig({
|
||||
required Room room,
|
||||
required IList<Event> events,
|
||||
}) = _MessagesConfig;
|
||||
|
||||
factory MessagesConfig.fromJson(Map<String, Object?> json) =>
|
||||
_$MessagesConfigFromJson(json);
|
||||
}
|
||||
|
|
@ -1,11 +1,12 @@
|
|||
import "package:freezed_annotation/freezed_annotation.dart";
|
||||
import "package:nexus/models/room.dart";
|
||||
part "get_event_request.freezed.dart";
|
||||
part "get_event_request.g.dart";
|
||||
|
||||
@freezed
|
||||
abstract class GetEventRequest with _$GetEventRequest {
|
||||
const factory GetEventRequest({
|
||||
required String roomId,
|
||||
required Room room,
|
||||
required String eventId,
|
||||
@Default(false) bool unredact,
|
||||
}) = _GetEventRequest;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue