forked from Nexus/nexus
parent
dbf30c3706
commit
d37ec2878b
21 changed files with 561 additions and 147 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import "package:fast_immutable_collections/fast_immutable_collections.dart";
|
||||
import "package:freezed_annotation/freezed_annotation.dart";
|
||||
import "package:nexus/models/invited_room.dart";
|
||||
import "package:nexus/models/room.dart";
|
||||
import "package:nexus/models/space_edge.dart";
|
||||
|
||||
|
|
@ -7,17 +8,16 @@ part "sync_data.freezed.dart";
|
|||
part "sync_data.g.dart";
|
||||
|
||||
@Freezed(toJson: false, fromJson: false)
|
||||
@JsonSerializable()
|
||||
@JsonSerializable(createToJson: false)
|
||||
class const SyncData({
|
||||
final bool clearState = false,
|
||||
final IMap<String, IMap<String, dynamic>> accountData = const IMap.empty(),
|
||||
final IMap<String, Room> rooms = const IMap.empty(),
|
||||
final ISet<String> leftRooms = const ISet.empty(),
|
||||
final IList<InvitedRoom> invitedRooms = const IList.empty(),
|
||||
final IMap<String, IList<SpaceEdge>>? spaceEdges,
|
||||
final IList<String>? topLevelSpaces,
|
||||
}) with _$SyncData {
|
||||
Map<String, Object?> toJson() => _$SyncDataToJson(this);
|
||||
|
||||
factory SyncData.fromJson(Map<String, Object?> json) =>
|
||||
_$SyncDataFromJson(json);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue