wip go 2
This commit is contained in:
parent
2996074838
commit
a012a2e762
12 changed files with 156 additions and 199 deletions
15
lib/models/client_state.dart
Normal file
15
lib/models/client_state.dart
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import "package:freezed_annotation/freezed_annotation.dart";
|
||||
part "client_state.freezed.dart";
|
||||
part "client_state.g.dart";
|
||||
|
||||
@freezed
|
||||
abstract class ClientState with _$ClientState {
|
||||
const factory ClientState({
|
||||
required bool isInitialized,
|
||||
required bool isLoggedIn,
|
||||
required bool isVerified,
|
||||
}) = _ClientState;
|
||||
|
||||
factory ClientState.fromJson(Map<String, Object?> json) =>
|
||||
_$ClientStateFromJson(json);
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
import "package:freezed_annotation/freezed_annotation.dart";
|
||||
import "package:matrix/matrix.dart";
|
||||
part "full_room.freezed.dart";
|
||||
|
||||
@freezed
|
||||
abstract class FullRoom with _$FullRoom {
|
||||
const FullRoom._();
|
||||
const factory FullRoom({
|
||||
required Room roomData,
|
||||
required String title,
|
||||
required Uri? avatar,
|
||||
}) = _FullRoom;
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
import "package:freezed_annotation/freezed_annotation.dart";
|
||||
part "homeserver.freezed.dart";
|
||||
|
||||
@freezed
|
||||
abstract class Homeserver with _$Homeserver {
|
||||
const factory Homeserver({
|
||||
required String name,
|
||||
required String description,
|
||||
required Uri url,
|
||||
required String iconUrl,
|
||||
}) = _Homeserver;
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
import "package:freezed_annotation/freezed_annotation.dart";
|
||||
part "image_data.freezed.dart";
|
||||
|
||||
@freezed
|
||||
abstract class ImageData with _$ImageData {
|
||||
const factory ImageData({
|
||||
required String uri,
|
||||
required int? height,
|
||||
required int? width,
|
||||
}) = _ImageData;
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
enum RelationType { edit, reply }
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
import "package:freezed_annotation/freezed_annotation.dart";
|
||||
part "session_backup.freezed.dart";
|
||||
part "session_backup.g.dart";
|
||||
|
||||
@freezed
|
||||
abstract class SessionBackup with _$SessionBackup {
|
||||
const factory SessionBackup({
|
||||
required String accessToken,
|
||||
required Uri homeserver,
|
||||
required String userID,
|
||||
required String deviceID,
|
||||
required String deviceName,
|
||||
}) = _SessionBackup;
|
||||
|
||||
factory SessionBackup.fromJson(Map<String, Object?> json) =>
|
||||
_$SessionBackupFromJson(json);
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
import "package:fast_immutable_collections/fast_immutable_collections.dart";
|
||||
import "package:flutter/widgets.dart";
|
||||
import "package:freezed_annotation/freezed_annotation.dart";
|
||||
import "package:matrix/matrix.dart";
|
||||
import "package:nexus/models/full_room.dart";
|
||||
part "space.freezed.dart";
|
||||
|
||||
@freezed
|
||||
abstract class Space with _$Space {
|
||||
const Space._();
|
||||
const factory Space({
|
||||
required String title,
|
||||
required String id,
|
||||
required IList<FullRoom> children,
|
||||
required Client client,
|
||||
Room? roomData,
|
||||
Uri? avatar,
|
||||
IconData? icon,
|
||||
}) = _Space;
|
||||
}
|
||||
18
lib/models/sync_status.dart
Normal file
18
lib/models/sync_status.dart
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import "package:freezed_annotation/freezed_annotation.dart";
|
||||
part "sync_status.freezed.dart";
|
||||
part "sync_status.g.dart";
|
||||
|
||||
@freezed
|
||||
abstract class SyncStatus with _$SyncStatus {
|
||||
const factory SyncStatus({
|
||||
required Type type,
|
||||
required int errorCount,
|
||||
required int lastSync,
|
||||
}) = _SyncStatus;
|
||||
|
||||
factory SyncStatus.fromJson(Map<String, Object?> json) =>
|
||||
_$SyncStatusFromJson(json);
|
||||
}
|
||||
|
||||
@JsonEnum(fieldRename: FieldRename.snake)
|
||||
enum Type { ok, waiting, erroring, permanentlyFailed }
|
||||
Loading…
Add table
Add a link
Reference in a new issue