final treewide fixes
This commit is contained in:
parent
78744135c9
commit
05682dd0de
48 changed files with 78 additions and 110 deletions
|
|
@ -102,7 +102,6 @@ class const App({super.key}) extends StatelessWidget {
|
||||||
builder: (context, ref, child) => MaterialApp(
|
builder: (context, ref, child) => MaterialApp(
|
||||||
navigatorKey: navigatorKey,
|
navigatorKey: navigatorKey,
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
// Use indigo to work around bugs in theme generation
|
|
||||||
theme:
|
theme:
|
||||||
(ref
|
(ref
|
||||||
.watch(SettingsController.provider)
|
.watch(SettingsController.provider)
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,12 @@ import "package:freezed_annotation/freezed_annotation.dart";
|
||||||
part "account_data.freezed.dart";
|
part "account_data.freezed.dart";
|
||||||
part "account_data.g.dart";
|
part "account_data.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const AccountData({
|
class const AccountData({
|
||||||
@JsonKey(name: AccountData.invitePermissionConfigKey)
|
@JsonKey(name: AccountData.invitePermissionConfigKey)
|
||||||
final InvitePermissionConfig invitePermissionConfig =
|
final InvitePermissionConfig invitePermissionConfig =
|
||||||
const _InvitePermissionConfig(),
|
const InvitePermissionConfig(),
|
||||||
|
|
||||||
@JsonKey(name: AccountData.directKey)
|
@JsonKey(name: AccountData.directKey)
|
||||||
final IMap<String, IList<String>> directMessages = const IMap.empty(),
|
final IMap<String, IList<String>> directMessages = const IMap.empty(),
|
||||||
|
|
@ -34,31 +34,28 @@ class const AccountData({
|
||||||
static const directKey = "m.direct";
|
static const directKey = "m.direct";
|
||||||
static const recentEmojiKey = "m.recent_emoji";
|
static const recentEmojiKey = "m.recent_emoji";
|
||||||
|
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$AccountDataToJson(this);
|
Map<String, Object?> toJson() => _$AccountDataToJson(this);
|
||||||
|
|
||||||
factory AccountData.fromJson(Map<String, Object?> json) =>
|
factory AccountData.fromJson(Map<String, Object?> json) =>
|
||||||
_$AccountDataFromJson(json);
|
_$AccountDataFromJson(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const InvitePermissionConfig({
|
class const InvitePermissionConfig({
|
||||||
@JsonKey(unknownEnumValue: DefaultInviteAction.allow)
|
@JsonKey(unknownEnumValue: DefaultInviteAction.allow)
|
||||||
final DefaultInviteAction defaultAction = DefaultInviteAction.allow,
|
final DefaultInviteAction defaultAction = DefaultInviteAction.allow,
|
||||||
}) with _$InvitePermissionConfig {
|
}) with _$InvitePermissionConfig {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$InvitePermissionConfigToJson(this);
|
Map<String, Object?> toJson() => _$InvitePermissionConfigToJson(this);
|
||||||
|
|
||||||
factory InvitePermissionConfig.fromJson(Map<String, Object?> json) =>
|
factory InvitePermissionConfig.fromJson(Map<String, Object?> json) =>
|
||||||
_$InvitePermissionConfigFromJson(json);
|
_$InvitePermissionConfigFromJson(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const RecentEmoji({required final String emoji, required final int total})
|
class const RecentEmoji({required final String emoji, required final int total})
|
||||||
with _$RecentEmoji {
|
with _$RecentEmoji {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$RecentEmojiToJson(this);
|
Map<String, Object?> toJson() => _$RecentEmojiToJson(this);
|
||||||
|
|
||||||
factory RecentEmoji.fromJson(Map<String, Object?> json) =>
|
factory RecentEmoji.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import "package:freezed_annotation/freezed_annotation.dart";
|
||||||
part "client_state.freezed.dart";
|
part "client_state.freezed.dart";
|
||||||
part "client_state.g.dart";
|
part "client_state.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const ClientState({
|
class const ClientState({
|
||||||
required final bool isInitialized,
|
required final bool isInitialized,
|
||||||
|
|
@ -12,7 +12,6 @@ class const ClientState({
|
||||||
required final String? userId,
|
required final String? userId,
|
||||||
required final String? homeserverUrl,
|
required final String? homeserverUrl,
|
||||||
}) with _$ClientState {
|
}) with _$ClientState {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$ClientStateToJson(this);
|
Map<String, Object?> toJson() => _$ClientStateToJson(this);
|
||||||
|
|
||||||
factory ClientState.fromJson(Map<String, Object?> json) =>
|
factory ClientState.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -4,13 +4,12 @@ import "package:nexus/models/membership_status.dart";
|
||||||
part "members_by_status.freezed.dart";
|
part "members_by_status.freezed.dart";
|
||||||
part "members_by_status.g.dart";
|
part "members_by_status.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const MembersByStatusConfig({
|
class const MembersByStatusConfig({
|
||||||
required final String roomId,
|
required final String roomId,
|
||||||
required final MembershipStatus status,
|
required final MembershipStatus status,
|
||||||
}) with _$MembersByStatusConfig {
|
}) with _$MembersByStatusConfig {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$MembersByStatusConfigToJson(this);
|
Map<String, Object?> toJson() => _$MembersByStatusConfigToJson(this);
|
||||||
|
|
||||||
factory MembersByStatusConfig.fromJson(Map<String, Object?> json) =>
|
factory MembersByStatusConfig.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,12 @@ import "package:freezed_annotation/freezed_annotation.dart";
|
||||||
part "reactions.freezed.dart";
|
part "reactions.freezed.dart";
|
||||||
part "reactions.g.dart";
|
part "reactions.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const ReactionsConfig({
|
class const ReactionsConfig({
|
||||||
required final String roomId,
|
required final String roomId,
|
||||||
required final int eventRowId,
|
required final int eventRowId,
|
||||||
}) with _$ReactionsConfig {
|
}) with _$ReactionsConfig {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$ReactionsConfigToJson(this);
|
Map<String, Object?> toJson() => _$ReactionsConfigToJson(this);
|
||||||
|
|
||||||
factory ReactionsConfig.fromJson(Map<String, Object?> json) =>
|
factory ReactionsConfig.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,10 @@ import "package:freezed_annotation/freezed_annotation.dart";
|
||||||
part "user.freezed.dart";
|
part "user.freezed.dart";
|
||||||
part "user.g.dart";
|
part "user.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const UserConfig({final String? roomId, required final String userId})
|
class const UserConfig({final String? roomId, required final String userId})
|
||||||
with _$UserConfig {
|
with _$UserConfig {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$UserConfigToJson(this);
|
Map<String, Object?> toJson() => _$UserConfigToJson(this);
|
||||||
|
|
||||||
factory UserConfig.fromJson(Map<String, Object?> json) =>
|
factory UserConfig.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -30,10 +30,9 @@ enum RoomType {
|
||||||
space,
|
space,
|
||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const PreviousRoom({required final String roomId}) with _$PreviousRoom {
|
class const PreviousRoom({required final String roomId}) with _$PreviousRoom {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$PreviousRoomToJson(this);
|
Map<String, Object?> toJson() => _$PreviousRoomToJson(this);
|
||||||
|
|
||||||
factory PreviousRoom.fromJson(Map<String, Object?> json) =>
|
factory PreviousRoom.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -17,13 +17,12 @@ sealed class JoinRulesContent extends Content with _$JoinRulesContent {
|
||||||
_$JoinRulesContentFromJson(json);
|
_$JoinRulesContentFromJson(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const AllowCondition({
|
class const AllowCondition({
|
||||||
final String? roomId,
|
final String? roomId,
|
||||||
required final AllowConditionType type,
|
required final AllowConditionType type,
|
||||||
}) with _$AllowCondition {
|
}) with _$AllowCondition {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$AllowConditionToJson(this);
|
Map<String, Object?> toJson() => _$AllowConditionToJson(this);
|
||||||
|
|
||||||
factory AllowCondition.fromJson(Map<String, Object?> json) =>
|
factory AllowCondition.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -24,13 +24,12 @@ sealed class PowerLevelsContent extends Content with _$PowerLevelsContent {
|
||||||
_$PowerLevelsContentFromJson(json);
|
_$PowerLevelsContentFromJson(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const Notifications({
|
class const Notifications({
|
||||||
final int room = 50,
|
final int room = 50,
|
||||||
final IMap<String, int> other = const IMap.empty(),
|
final IMap<String, int> other = const IMap.empty(),
|
||||||
}) with _$Notifications {
|
}) with _$Notifications {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$NotificationsToJson(this);
|
Map<String, Object?> toJson() => _$NotificationsToJson(this);
|
||||||
|
|
||||||
factory Notifications.fromJson(Map<String, Object?> json) =>
|
factory Notifications.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -17,25 +17,23 @@ sealed class TopicContent extends Content with _$TopicContent {
|
||||||
_$TopicContentFromJson(json);
|
_$TopicContentFromJson(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const TopicContentBlock({
|
class const TopicContentBlock({
|
||||||
final IList<TextualRepresentation> representations = const IList.empty(),
|
final IList<TextualRepresentation> representations = const IList.empty(),
|
||||||
}) with _$TopicContentBlock {
|
}) with _$TopicContentBlock {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$TopicContentBlockToJson(this);
|
Map<String, Object?> toJson() => _$TopicContentBlockToJson(this);
|
||||||
|
|
||||||
factory TopicContentBlock.fromJson(Map<String, Object?> json) =>
|
factory TopicContentBlock.fromJson(Map<String, Object?> json) =>
|
||||||
_$TopicContentBlockFromJson(json);
|
_$TopicContentBlockFromJson(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const TextualRepresentation({
|
class const TextualRepresentation({
|
||||||
required final String body,
|
required final String body,
|
||||||
final String mimetype = "text/plain",
|
final String mimetype = "text/plain",
|
||||||
}) with _$TextualRepresentation {
|
}) with _$TextualRepresentation {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$TextualRepresentationToJson(this);
|
Map<String, Object?> toJson() => _$TextualRepresentationToJson(this);
|
||||||
|
|
||||||
factory TextualRepresentation.fromJson(Map<String, Object?> json) =>
|
factory TextualRepresentation.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
18
lib/models/emoji.dart
Normal file
18
lib/models/emoji.dart
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
import "package:fast_immutable_collections/fast_immutable_collections.dart";
|
||||||
|
import "package:freezed_annotation/freezed_annotation.dart";
|
||||||
|
part "emoji.freezed.dart";
|
||||||
|
part "emoji.g.dart";
|
||||||
|
|
||||||
|
@Freezed(toJson: false, fromJson: false)
|
||||||
|
@JsonSerializable()
|
||||||
|
class Emoji({
|
||||||
|
required final String emoji,
|
||||||
|
required final String category,
|
||||||
|
required final IList<String> aliases,
|
||||||
|
required final String description,
|
||||||
|
required final IList<String> tags,
|
||||||
|
}) with _$Emoji {
|
||||||
|
Map<String, Object?> toJson() => _$EmojiToJson(this);
|
||||||
|
|
||||||
|
factory Emoji.fromJson(Map<String, Object?> json) => _$EmojiFromJson(json);
|
||||||
|
}
|
||||||
|
|
@ -7,7 +7,7 @@ import "package:nexus/models/profile_response.dart";
|
||||||
part "event.freezed.dart";
|
part "event.freezed.dart";
|
||||||
part "event.g.dart";
|
part "event.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const Event({
|
class const Event({
|
||||||
@JsonKey(name: "rowid") required final int rowId,
|
@JsonKey(name: "rowid") required final int rowId,
|
||||||
|
|
@ -34,7 +34,6 @@ class const Event({
|
||||||
required final Content content,
|
required final Content content,
|
||||||
required final Content? previousContent,
|
required final Content? previousContent,
|
||||||
}) with _$Event {
|
}) with _$Event {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$EventToJson(this);
|
Map<String, Object?> toJson() => _$EventToJson(this);
|
||||||
|
|
||||||
static String typeJsonFromJson(Map<dynamic, dynamic> json, _) =>
|
static String typeJsonFromJson(Map<dynamic, dynamic> json, _) =>
|
||||||
|
|
@ -75,7 +74,7 @@ class const Event({
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const LocalContent({
|
class const LocalContent({
|
||||||
final String? sanitizedHtml,
|
final String? sanitizedHtml,
|
||||||
|
|
@ -85,7 +84,6 @@ class const LocalContent({
|
||||||
final bool? hasMath,
|
final bool? hasMath,
|
||||||
final bool? replyFallbackRemoved,
|
final bool? replyFallbackRemoved,
|
||||||
}) with _$LocalContent {
|
}) with _$LocalContent {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$LocalContentToJson(this);
|
Map<String, Object?> toJson() => _$LocalContentToJson(this);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,13 @@ import "package:nexus/models/ms_duration.dart";
|
||||||
part "audio.freezed.dart";
|
part "audio.freezed.dart";
|
||||||
part "audio.g.dart";
|
part "audio.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const AudioInfo({
|
class const AudioInfo({
|
||||||
@MSDuration() final Duration? duration,
|
@MSDuration() final Duration? duration,
|
||||||
@JsonKey(name: "mimetype") final String? mimeType,
|
@JsonKey(name: "mimetype") final String? mimeType,
|
||||||
final int? size,
|
final int? size,
|
||||||
}) with _$AudioInfo {
|
}) with _$AudioInfo {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$AudioInfoToJson(this);
|
Map<String, Object?> toJson() => _$AudioInfoToJson(this);
|
||||||
|
|
||||||
factory AudioInfo.fromJson(Map<String, Object?> json) =>
|
factory AudioInfo.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,12 @@ import "package:freezed_annotation/freezed_annotation.dart";
|
||||||
part "file.freezed.dart";
|
part "file.freezed.dart";
|
||||||
part "file.g.dart";
|
part "file.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const FileInfo({
|
class const FileInfo({
|
||||||
@JsonKey(name: "mimetype") final String? mimeType,
|
@JsonKey(name: "mimetype") final String? mimeType,
|
||||||
final int? size,
|
final int? size,
|
||||||
}) with _$FileInfo {
|
}) with _$FileInfo {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$FileInfoToJson(this);
|
Map<String, Object?> toJson() => _$FileInfoToJson(this);
|
||||||
|
|
||||||
factory FileInfo.fromJson(Map<String, Object?> json) =>
|
factory FileInfo.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import "package:freezed_annotation/freezed_annotation.dart";
|
||||||
part "image.freezed.dart";
|
part "image.freezed.dart";
|
||||||
part "image.g.dart";
|
part "image.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const ImageInfo({
|
class const ImageInfo({
|
||||||
@JsonKey(name: "h") final double? height,
|
@JsonKey(name: "h") final double? height,
|
||||||
|
|
@ -12,7 +12,6 @@ class const ImageInfo({
|
||||||
@JsonKey(name: "xyz.amorgan.blurhash") final String? blurHash,
|
@JsonKey(name: "xyz.amorgan.blurhash") final String? blurHash,
|
||||||
final int? size,
|
final int? size,
|
||||||
}) with _$ImageInfo {
|
}) with _$ImageInfo {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$ImageInfoToJson(this);
|
Map<String, Object?> toJson() => _$ImageInfoToJson(this);
|
||||||
|
|
||||||
factory ImageInfo.fromJson(Map<String, Object?> json) =>
|
factory ImageInfo.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import "package:nexus/models/ms_duration.dart";
|
||||||
part "video.freezed.dart";
|
part "video.freezed.dart";
|
||||||
part "video.g.dart";
|
part "video.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const VideoInfo({
|
class const VideoInfo({
|
||||||
@JsonKey(name: "h") final int? height,
|
@JsonKey(name: "h") final int? height,
|
||||||
|
|
@ -13,7 +13,6 @@ class const VideoInfo({
|
||||||
@MSDuration() final Duration? duration,
|
@MSDuration() final Duration? duration,
|
||||||
final int? size,
|
final int? size,
|
||||||
}) with _$VideoInfo {
|
}) with _$VideoInfo {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$VideoInfoToJson(this);
|
Map<String, Object?> toJson() => _$VideoInfoToJson(this);
|
||||||
|
|
||||||
factory VideoInfo.fromJson(Map<String, Object?> json) =>
|
factory VideoInfo.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,13 @@ import "package:freezed_annotation/freezed_annotation.dart";
|
||||||
part "lazy_load_summary.freezed.dart";
|
part "lazy_load_summary.freezed.dart";
|
||||||
part "lazy_load_summary.g.dart";
|
part "lazy_load_summary.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const LazyLoadSummary({
|
class const LazyLoadSummary({
|
||||||
required final IList<String>? heroes,
|
required final IList<String>? heroes,
|
||||||
required final int? joinedMemberCount,
|
required final int? joinedMemberCount,
|
||||||
required final int? invitedMemberCount,
|
required final int? invitedMemberCount,
|
||||||
}) with _$LazyLoadSummary {
|
}) with _$LazyLoadSummary {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$LazyLoadSummaryToJson(this);
|
Map<String, Object?> toJson() => _$LazyLoadSummaryToJson(this);
|
||||||
|
|
||||||
factory LazyLoadSummary.fromJson(Map<String, Object?> json) =>
|
factory LazyLoadSummary.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,13 @@ import "package:freezed_annotation/freezed_annotation.dart";
|
||||||
part "oauth_auth_code_response.freezed.dart";
|
part "oauth_auth_code_response.freezed.dart";
|
||||||
part "oauth_auth_code_response.g.dart";
|
part "oauth_auth_code_response.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const OAuthAuthCodeResponse({
|
class const OAuthAuthCodeResponse({
|
||||||
required final String state,
|
required final String state,
|
||||||
required final String codeVerifier,
|
required final String codeVerifier,
|
||||||
required final Uri url,
|
required final Uri url,
|
||||||
}) with _$OAuthAuthCodeResponse {
|
}) with _$OAuthAuthCodeResponse {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$OAuthAuthCodeResponseToJson(this);
|
Map<String, Object?> toJson() => _$OAuthAuthCodeResponseToJson(this);
|
||||||
|
|
||||||
factory OAuthAuthCodeResponse.fromJson(Map<String, Object?> json) =>
|
factory OAuthAuthCodeResponse.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import "package:freezed_annotation/freezed_annotation.dart";
|
||||||
part "open_graph_data.freezed.dart";
|
part "open_graph_data.freezed.dart";
|
||||||
part "open_graph_data.g.dart";
|
part "open_graph_data.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const OpenGraphData({
|
class const OpenGraphData({
|
||||||
@JsonKey(name: "og:title") required final String? title,
|
@JsonKey(name: "og:title") required final String? title,
|
||||||
|
|
@ -12,7 +12,6 @@ class const OpenGraphData({
|
||||||
@JsonKey(name: "og:image:width") required final double? width,
|
@JsonKey(name: "og:image:width") required final double? width,
|
||||||
@JsonKey(name: "og:image:height") required final double? height,
|
@JsonKey(name: "og:image:height") required final double? height,
|
||||||
}) with _$OpenGraphData {
|
}) with _$OpenGraphData {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$OpenGraphDataToJson(this);
|
Map<String, Object?> toJson() => _$OpenGraphDataToJson(this);
|
||||||
|
|
||||||
factory OpenGraphData.fromJson(Map<String, dynamic> json) =>
|
factory OpenGraphData.fromJson(Map<String, dynamic> json) =>
|
||||||
|
|
|
||||||
|
|
@ -5,14 +5,13 @@ import "package:nexus/models/event.dart";
|
||||||
part "paginate.freezed.dart";
|
part "paginate.freezed.dart";
|
||||||
part "paginate.g.dart";
|
part "paginate.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const Paginate({
|
class const Paginate({
|
||||||
required final IList<Event> events,
|
required final IList<Event> events,
|
||||||
required final IList<Event> relatedEvents,
|
required final IList<Event> relatedEvents,
|
||||||
required final bool hasMore,
|
required final bool hasMore,
|
||||||
}) with _$Paginate {
|
}) with _$Paginate {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$PaginateToJson(this);
|
Map<String, Object?> toJson() => _$PaginateToJson(this);
|
||||||
|
|
||||||
factory Paginate.fromJson(Map<String, Object?> json) =>
|
factory Paginate.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -5,30 +5,28 @@ import "package:nexus/models/content/membership.dart";
|
||||||
part "profile_response.freezed.dart";
|
part "profile_response.freezed.dart";
|
||||||
part "profile_response.g.dart";
|
part "profile_response.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const ProfileResponse({
|
class const ProfileResponse({
|
||||||
@JsonKey(fromJson: Profile.fromJson) required final Profile profile,
|
@JsonKey(fromJson: Profile.fromJson) required final Profile profile,
|
||||||
required final Bio? bio,
|
required final Bio? bio,
|
||||||
}) with _$ProfileResponse {
|
}) with _$ProfileResponse {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$ProfileResponseToJson(this);
|
Map<String, Object?> toJson() => _$ProfileResponseToJson(this);
|
||||||
|
|
||||||
factory ProfileResponse.fromJson(Map<String, Object?> json) =>
|
factory ProfileResponse.fromJson(Map<String, Object?> json) =>
|
||||||
_$ProfileResponseFromJson(json);
|
_$ProfileResponseFromJson(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const Bio({required final String html, final String? editSource})
|
class const Bio({required final String html, final String? editSource})
|
||||||
with _$Bio {
|
with _$Bio {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$BioToJson(this);
|
Map<String, Object?> toJson() => _$BioToJson(this);
|
||||||
|
|
||||||
factory Bio.fromJson(Map<String, Object?> json) => _$BioFromJson(json);
|
factory Bio.fromJson(Map<String, Object?> json) => _$BioFromJson(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const Profile({
|
class const Profile({
|
||||||
final String? id,
|
final String? id,
|
||||||
|
|
@ -44,7 +42,6 @@ class const Profile({
|
||||||
@JsonKey(readValue: Profile.readPronouns, name: "m.pronouns")
|
@JsonKey(readValue: Profile.readPronouns, name: "m.pronouns")
|
||||||
final IList<Pronoun> pronouns = const IList.empty(),
|
final IList<Pronoun> pronouns = const IList.empty(),
|
||||||
}) with _$Profile {
|
}) with _$Profile {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$ProfileToJson(this);
|
Map<String, Object?> toJson() => _$ProfileToJson(this);
|
||||||
|
|
||||||
static Object? readPronouns(Map<dynamic, dynamic> map, String key) =>
|
static Object? readPronouns(Map<dynamic, dynamic> map, String key) =>
|
||||||
|
|
@ -65,13 +62,12 @@ class const Profile({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const Pronoun({
|
class const Pronoun({
|
||||||
required final String language,
|
required final String language,
|
||||||
required final String summary,
|
required final String summary,
|
||||||
}) with _$Pronoun {
|
}) with _$Pronoun {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$PronounToJson(this);
|
Map<String, Object?> toJson() => _$PronounToJson(this);
|
||||||
|
|
||||||
factory Pronoun.fromJson(Map<String, Object?> json) =>
|
factory Pronoun.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import "package:nexus/models/epoch_date_time_converter.dart";
|
||||||
part "read_receipt.freezed.dart";
|
part "read_receipt.freezed.dart";
|
||||||
part "read_receipt.g.dart";
|
part "read_receipt.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const ReadReceipt({
|
class const ReadReceipt({
|
||||||
final String? roomId,
|
final String? roomId,
|
||||||
|
|
@ -13,7 +13,6 @@ class const ReadReceipt({
|
||||||
required final String eventId,
|
required final String eventId,
|
||||||
@EpochDateTimeConverter() required final DateTime timestamp,
|
@EpochDateTimeConverter() required final DateTime timestamp,
|
||||||
}) with _$ReadReceipt {
|
}) with _$ReadReceipt {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$ReadReceiptToJson(this);
|
Map<String, Object?> toJson() => _$ReadReceiptToJson(this);
|
||||||
|
|
||||||
factory ReadReceipt.fromJson(Map<String, Object?> json) =>
|
factory ReadReceipt.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import "package:freezed_annotation/freezed_annotation.dart";
|
||||||
part "download_media.freezed.dart";
|
part "download_media.freezed.dart";
|
||||||
part "download_media.g.dart";
|
part "download_media.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const DownloadMediaRequest({
|
class const DownloadMediaRequest({
|
||||||
required final Uri mxc,
|
required final Uri mxc,
|
||||||
|
|
@ -11,7 +11,6 @@ class const DownloadMediaRequest({
|
||||||
final bool isAvatar = false,
|
final bool isAvatar = false,
|
||||||
final bool thumbnailAvatar = false,
|
final bool thumbnailAvatar = false,
|
||||||
}) with _$DownloadMediaRequest {
|
}) with _$DownloadMediaRequest {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$DownloadMediaRequestToJson(this);
|
Map<String, Object?> toJson() => _$DownloadMediaRequestToJson(this);
|
||||||
|
|
||||||
factory DownloadMediaRequest.fromJson(Map<String, Object?> json) =>
|
factory DownloadMediaRequest.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,13 @@ import "package:freezed_annotation/freezed_annotation.dart";
|
||||||
part "get_event.freezed.dart";
|
part "get_event.freezed.dart";
|
||||||
part "get_event.g.dart";
|
part "get_event.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const GetEventRequest({
|
class const GetEventRequest({
|
||||||
required final String roomId,
|
required final String roomId,
|
||||||
required final String eventId,
|
required final String eventId,
|
||||||
final bool unredact = false,
|
final bool unredact = false,
|
||||||
}) with _$GetEventRequest {
|
}) with _$GetEventRequest {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$GetEventRequestToJson(this);
|
Map<String, Object?> toJson() => _$GetEventRequestToJson(this);
|
||||||
|
|
||||||
factory GetEventRequest.fromJson(Map<String, Object?> json) =>
|
factory GetEventRequest.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,13 @@ import "package:freezed_annotation/freezed_annotation.dart";
|
||||||
part "get_related_events.freezed.dart";
|
part "get_related_events.freezed.dart";
|
||||||
part "get_related_events.g.dart";
|
part "get_related_events.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const GetRelatedEventsRequest({
|
class const GetRelatedEventsRequest({
|
||||||
required final String roomId,
|
required final String roomId,
|
||||||
required final String eventId,
|
required final String eventId,
|
||||||
required final String relationType,
|
required final String relationType,
|
||||||
}) with _$GetRelatedEventsRequest {
|
}) with _$GetRelatedEventsRequest {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$GetRelatedEventsRequestToJson(this);
|
Map<String, Object?> toJson() => _$GetRelatedEventsRequestToJson(this);
|
||||||
|
|
||||||
factory GetRelatedEventsRequest.fromJson(Map<String, Object?> json) =>
|
factory GetRelatedEventsRequest.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import "package:freezed_annotation/freezed_annotation.dart";
|
||||||
part "get_room_state.freezed.dart";
|
part "get_room_state.freezed.dart";
|
||||||
part "get_room_state.g.dart";
|
part "get_room_state.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const GetRoomStateRequest({
|
class const GetRoomStateRequest({
|
||||||
required final String roomId,
|
required final String roomId,
|
||||||
|
|
@ -11,7 +11,6 @@ class const GetRoomStateRequest({
|
||||||
final bool fetchMembers = false,
|
final bool fetchMembers = false,
|
||||||
final bool includeMembers = false,
|
final bool includeMembers = false,
|
||||||
}) with _$GetRoomStateRequest {
|
}) with _$GetRoomStateRequest {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$GetRoomStateRequestToJson(this);
|
Map<String, Object?> toJson() => _$GetRoomStateRequestToJson(this);
|
||||||
|
|
||||||
factory GetRoomStateRequest.fromJson(Map<String, Object?> json) =>
|
factory GetRoomStateRequest.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -4,13 +4,12 @@ import "package:freezed_annotation/freezed_annotation.dart";
|
||||||
part "join_room.freezed.dart";
|
part "join_room.freezed.dart";
|
||||||
part "join_room.g.dart";
|
part "join_room.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const JoinRoomRequest({
|
class const JoinRoomRequest({
|
||||||
required final String roomIdOrAlias,
|
required final String roomIdOrAlias,
|
||||||
final IList<String> via = const IList.empty(),
|
final IList<String> via = const IList.empty(),
|
||||||
}) with _$JoinRoomRequest {
|
}) with _$JoinRoomRequest {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$JoinRoomRequestToJson(this);
|
Map<String, Object?> toJson() => _$JoinRoomRequestToJson(this);
|
||||||
|
|
||||||
factory JoinRoomRequest.fromJson(Map<String, Object?> json) =>
|
factory JoinRoomRequest.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import "package:freezed_annotation/freezed_annotation.dart";
|
||||||
part "exchange_token.freezed.dart";
|
part "exchange_token.freezed.dart";
|
||||||
part "exchange_token.g.dart";
|
part "exchange_token.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const OAuthExchangeTokenRequest({
|
class const OAuthExchangeTokenRequest({
|
||||||
required final Uri homeserverUrl,
|
required final Uri homeserverUrl,
|
||||||
|
|
@ -12,7 +12,6 @@ class const OAuthExchangeTokenRequest({
|
||||||
required final String code,
|
required final String code,
|
||||||
required final String clientId,
|
required final String clientId,
|
||||||
}) with _$OAuthExchangeTokenRequest {
|
}) with _$OAuthExchangeTokenRequest {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$OAuthExchangeTokenRequestToJson(this);
|
Map<String, Object?> toJson() => _$OAuthExchangeTokenRequestToJson(this);
|
||||||
|
|
||||||
factory OAuthExchangeTokenRequest.fromJson(Map<String, Object?> json) =>
|
factory OAuthExchangeTokenRequest.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import "package:freezed_annotation/freezed_annotation.dart";
|
||||||
part "get_auth_url.freezed.dart";
|
part "get_auth_url.freezed.dart";
|
||||||
part "get_auth_url.g.dart";
|
part "get_auth_url.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const OAuthGetAuthUrl({
|
class const OAuthGetAuthUrl({
|
||||||
required final ResponseMode responseMode,
|
required final ResponseMode responseMode,
|
||||||
|
|
@ -16,7 +16,6 @@ class const OAuthGetAuthUrl({
|
||||||
required final String clientId,
|
required final String clientId,
|
||||||
final String? userIdHint,
|
final String? userIdHint,
|
||||||
}) with _$OAuthGetAuthUrl {
|
}) with _$OAuthGetAuthUrl {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$OAuthGetAuthUrlToJson(this);
|
Map<String, Object?> toJson() => _$OAuthGetAuthUrlToJson(this);
|
||||||
|
|
||||||
factory OAuthGetAuthUrl.fromJson(Map<String, Object?> json) =>
|
factory OAuthGetAuthUrl.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import "package:freezed_annotation/freezed_annotation.dart";
|
||||||
part "register_client.freezed.dart";
|
part "register_client.freezed.dart";
|
||||||
part "register_client.g.dart";
|
part "register_client.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const OAuthRegisterClientRequest({
|
class const OAuthRegisterClientRequest({
|
||||||
required final Uri homeserverUrl,
|
required final Uri homeserverUrl,
|
||||||
|
|
@ -21,7 +21,6 @@ class const OAuthRegisterClientRequest({
|
||||||
@JsonKey(name: "token_endpoint_auth_method")
|
@JsonKey(name: "token_endpoint_auth_method")
|
||||||
final AuthMethod? authMethod = AuthMethod.none,
|
final AuthMethod? authMethod = AuthMethod.none,
|
||||||
}) with _$OAuthRegisterClientRequest {
|
}) with _$OAuthRegisterClientRequest {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$OAuthRegisterClientRequestToJson(this);
|
Map<String, Object?> toJson() => _$OAuthRegisterClientRequestToJson(this);
|
||||||
|
|
||||||
factory OAuthRegisterClientRequest.fromJson(Map<String, Object?> json) =>
|
factory OAuthRegisterClientRequest.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,13 @@ import "package:freezed_annotation/freezed_annotation.dart";
|
||||||
part "paginate.freezed.dart";
|
part "paginate.freezed.dart";
|
||||||
part "paginate.g.dart";
|
part "paginate.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const PaginateRequest({
|
class const PaginateRequest({
|
||||||
required final String roomId,
|
required final String roomId,
|
||||||
required final int? maxTimelineId,
|
required final int? maxTimelineId,
|
||||||
final int limit = 20,
|
final int limit = 20,
|
||||||
}) with _$PaginateRequest {
|
}) with _$PaginateRequest {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$PaginateRequestToJson(this);
|
Map<String, Object?> toJson() => _$PaginateRequestToJson(this);
|
||||||
|
|
||||||
factory PaginateRequest.fromJson(Map<String, Object?> json) =>
|
factory PaginateRequest.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,13 @@ import "package:freezed_annotation/freezed_annotation.dart";
|
||||||
part "report.freezed.dart";
|
part "report.freezed.dart";
|
||||||
part "report.g.dart";
|
part "report.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const ReportRequest({
|
class const ReportRequest({
|
||||||
required final String roomId,
|
required final String roomId,
|
||||||
required final String eventId,
|
required final String eventId,
|
||||||
final String? reason,
|
final String? reason,
|
||||||
}) with _$ReportRequest {
|
}) with _$ReportRequest {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$ReportRequestToJson(this);
|
Map<String, Object?> toJson() => _$ReportRequestToJson(this);
|
||||||
|
|
||||||
factory ReportRequest.fromJson(Map<String, Object?> json) =>
|
factory ReportRequest.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import "package:nexus/models/content/content.dart";
|
||||||
part "send_event.freezed.dart";
|
part "send_event.freezed.dart";
|
||||||
part "send_event.g.dart";
|
part "send_event.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const SendEventRequest({
|
class const SendEventRequest({
|
||||||
required final String roomId,
|
required final String roomId,
|
||||||
|
|
@ -15,7 +15,6 @@ class const SendEventRequest({
|
||||||
final bool synchronous = false,
|
final bool synchronous = false,
|
||||||
final bool disableEncryption = false,
|
final bool disableEncryption = false,
|
||||||
}) with _$SendEventRequest {
|
}) with _$SendEventRequest {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$SendEventRequestToJson(this);
|
Map<String, Object?> toJson() => _$SendEventRequestToJson(this);
|
||||||
|
|
||||||
factory SendEventRequest.fromJson(Map<String, Object?> json) =>
|
factory SendEventRequest.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -6,29 +6,27 @@ import "package:nexus/models/relation_type.dart";
|
||||||
part "send_message.freezed.dart";
|
part "send_message.freezed.dart";
|
||||||
part "send_message.g.dart";
|
part "send_message.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const SendMessageRequest({
|
class const SendMessageRequest({
|
||||||
required final String roomId,
|
required final String roomId,
|
||||||
required final String text,
|
required final String text,
|
||||||
final Content? baseContent,
|
final Content? baseContent,
|
||||||
@JsonKey(name: "mentions") final Mentions mentions = const _Mentions(),
|
@JsonKey(name: "mentions") final Mentions mentions = const Mentions(),
|
||||||
@JsonKey(name: "relates_to") final Relation? relation,
|
@JsonKey(name: "relates_to") final Relation? relation,
|
||||||
}) with _$SendMessageRequest {
|
}) with _$SendMessageRequest {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$SendMessageRequestToJson(this);
|
Map<String, Object?> toJson() => _$SendMessageRequestToJson(this);
|
||||||
|
|
||||||
factory SendMessageRequest.fromJson(Map<String, Object?> json) =>
|
factory SendMessageRequest.fromJson(Map<String, Object?> json) =>
|
||||||
_$SendMessageRequestFromJson(json);
|
_$SendMessageRequestFromJson(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const Mentions({
|
class const Mentions({
|
||||||
final bool room = false,
|
final bool room = false,
|
||||||
final IList<String> userIds = const IList.empty(),
|
final IList<String> userIds = const IList.empty(),
|
||||||
}) with _$Mentions {
|
}) with _$Mentions {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$MentionsToJson(this);
|
Map<String, Object?> toJson() => _$MentionsToJson(this);
|
||||||
|
|
||||||
factory Mentions.fromJson(Map<String, Object?> json) =>
|
factory Mentions.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,13 @@ import "package:freezed_annotation/freezed_annotation.dart";
|
||||||
part "set_account_data.freezed.dart";
|
part "set_account_data.freezed.dart";
|
||||||
part "set_account_data.g.dart";
|
part "set_account_data.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const SetAccountDataRequest({
|
class const SetAccountDataRequest({
|
||||||
required final String type,
|
required final String type,
|
||||||
required final dynamic content,
|
required final dynamic content,
|
||||||
final String? roomId,
|
final String? roomId,
|
||||||
}) with _$SetAccountDataRequest {
|
}) with _$SetAccountDataRequest {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$SetAccountDataRequestToJson(this);
|
Map<String, Object?> toJson() => _$SetAccountDataRequestToJson(this);
|
||||||
|
|
||||||
factory SetAccountDataRequest.fromJson(Map<String, Object?> json) =>
|
factory SetAccountDataRequest.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import "package:nexus/models/membership_action.dart";
|
||||||
part "set_membership.freezed.dart";
|
part "set_membership.freezed.dart";
|
||||||
part "set_membership.g.dart";
|
part "set_membership.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const SetMembershipRequest({
|
class const SetMembershipRequest({
|
||||||
required final String userId,
|
required final String userId,
|
||||||
|
|
@ -13,7 +13,6 @@ class const SetMembershipRequest({
|
||||||
@JsonKey(name: "action") required final MembershipAction action,
|
@JsonKey(name: "action") required final MembershipAction action,
|
||||||
@JsonKey(name: "msc4293_redact_events") final bool redact = false,
|
@JsonKey(name: "msc4293_redact_events") final bool redact = false,
|
||||||
}) with _$SetMembershipRequest {
|
}) with _$SetMembershipRequest {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$SetMembershipRequestToJson(this);
|
Map<String, Object?> toJson() => _$SetMembershipRequestToJson(this);
|
||||||
|
|
||||||
factory SetMembershipRequest.fromJson(Map<String, Object?> json) =>
|
factory SetMembershipRequest.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import "package:nexus/models/ms_duration.dart";
|
||||||
part "set_state.freezed.dart";
|
part "set_state.freezed.dart";
|
||||||
part "set_state.g.dart";
|
part "set_state.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const SetStateRequest({
|
class const SetStateRequest({
|
||||||
required final String roomId,
|
required final String roomId,
|
||||||
|
|
@ -17,7 +17,6 @@ class const SetStateRequest({
|
||||||
@MSDuration()
|
@MSDuration()
|
||||||
final Duration? delay,
|
final Duration? delay,
|
||||||
}) with _$SetStateRequest {
|
}) with _$SetStateRequest {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$SetStateRequestToJson(this);
|
Map<String, Object?> toJson() => _$SetStateRequestToJson(this);
|
||||||
|
|
||||||
factory SetStateRequest.fromJson(Map<String, Object?> json) =>
|
factory SetStateRequest.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import "package:freezed_annotation/freezed_annotation.dart";
|
||||||
part "upload_media.freezed.dart";
|
part "upload_media.freezed.dart";
|
||||||
part "upload_media.g.dart";
|
part "upload_media.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const UploadMediaRequest({
|
class const UploadMediaRequest({
|
||||||
required final String path,
|
required final String path,
|
||||||
|
|
@ -20,7 +20,6 @@ class const UploadMediaRequest({
|
||||||
final int? resizePercent,
|
final int? resizePercent,
|
||||||
final int quality = 80,
|
final int quality = 80,
|
||||||
}) with _$UploadMediaRequest {
|
}) with _$UploadMediaRequest {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$UploadMediaRequestToJson(this);
|
Map<String, Object?> toJson() => _$UploadMediaRequestToJson(this);
|
||||||
|
|
||||||
factory UploadMediaRequest.fromJson(Map<String, Object?> json) =>
|
factory UploadMediaRequest.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import "package:nexus/models/room_metadata.dart";
|
||||||
part "room.freezed.dart";
|
part "room.freezed.dart";
|
||||||
part "room.g.dart";
|
part "room.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const Room({
|
class const Room({
|
||||||
@JsonKey(name: "meta") final RoomMetadata? metadata,
|
@JsonKey(name: "meta") final RoomMetadata? metadata,
|
||||||
|
|
@ -53,7 +53,6 @@ class const Room({
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$RoomToJson(this);
|
Map<String, Object?> toJson() => _$RoomToJson(this);
|
||||||
|
|
||||||
factory Room.fromJson(Map<String, Object?> json) => _$RoomFromJson(json);
|
factory Room.fromJson(Map<String, Object?> json) => _$RoomFromJson(json);
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import "package:nexus/models/lazy_load_summary.dart";
|
||||||
part "room_metadata.freezed.dart";
|
part "room_metadata.freezed.dart";
|
||||||
part "room_metadata.g.dart";
|
part "room_metadata.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const RoomMetadata({
|
class const RoomMetadata({
|
||||||
@JsonKey(name: "room_id") required final String id,
|
@JsonKey(name: "room_id") required final String id,
|
||||||
|
|
@ -25,7 +25,6 @@ class const RoomMetadata({
|
||||||
required final int unreadNotifications,
|
required final int unreadNotifications,
|
||||||
required final int unreadMessages,
|
required final int unreadMessages,
|
||||||
}) with _$RoomMetadata {
|
}) with _$RoomMetadata {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$RoomMetadataToJson(this);
|
Map<String, Object?> toJson() => _$RoomMetadataToJson(this);
|
||||||
|
|
||||||
factory RoomMetadata.fromJson(Map<String, Object?> json) =>
|
factory RoomMetadata.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import "package:nexus/models/join_rule.dart";
|
||||||
part "room_summary.freezed.dart";
|
part "room_summary.freezed.dart";
|
||||||
part "room_summary.g.dart";
|
part "room_summary.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const RoomSummary({
|
class const RoomSummary({
|
||||||
required final String roomId,
|
required final String roomId,
|
||||||
|
|
@ -18,7 +18,6 @@ class const RoomSummary({
|
||||||
final String? roomVersion,
|
final String? roomVersion,
|
||||||
@JsonKey(unknownEnumValue: RoomType.room) final RoomType? roomType,
|
@JsonKey(unknownEnumValue: RoomType.room) final RoomType? roomType,
|
||||||
}) with _$RoomSummary {
|
}) with _$RoomSummary {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$RoomSummaryToJson(this);
|
Map<String, Object?> toJson() => _$RoomSummaryToJson(this);
|
||||||
|
|
||||||
factory RoomSummary.fromJson(Map<String, Object?> json) =>
|
factory RoomSummary.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,13 @@ import "package:freezed_annotation/freezed_annotation.dart";
|
||||||
part "settings.freezed.dart";
|
part "settings.freezed.dart";
|
||||||
part "settings.g.dart";
|
part "settings.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const Settings({
|
class const Settings({
|
||||||
final ThemeMode theme = ThemeMode.system,
|
final ThemeMode theme = ThemeMode.system,
|
||||||
final bool useDynamicTheming = true,
|
final bool useDynamicTheming = true,
|
||||||
final bool linuxMobileMode = false,
|
final bool linuxMobileMode = false,
|
||||||
}) with _$Settings {
|
}) with _$Settings {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$SettingsToJson(this);
|
Map<String, Object?> toJson() => _$SettingsToJson(this);
|
||||||
|
|
||||||
factory Settings.fromJson(Map<String, Object?> json) =>
|
factory Settings.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,12 @@ import "package:freezed_annotation/freezed_annotation.dart";
|
||||||
part "space_edge.freezed.dart";
|
part "space_edge.freezed.dart";
|
||||||
part "space_edge.g.dart";
|
part "space_edge.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const SpaceEdge({
|
class const SpaceEdge({
|
||||||
required final String childId,
|
required final String childId,
|
||||||
final bool suggested = false,
|
final bool suggested = false,
|
||||||
}) with _$SpaceEdge {
|
}) with _$SpaceEdge {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$SpaceEdgeToJson(this);
|
Map<String, Object?> toJson() => _$SpaceEdgeToJson(this);
|
||||||
|
|
||||||
factory SpaceEdge.fromJson(Map<String, Object?> json) =>
|
factory SpaceEdge.fromJson(Map<String, Object?> json) =>
|
||||||
|
|
|
||||||
|
|
@ -4,20 +4,19 @@ import "package:freezed_annotation/freezed_annotation.dart";
|
||||||
part "spec_versions_response.freezed.dart";
|
part "spec_versions_response.freezed.dart";
|
||||||
part "spec_versions_response.g.dart";
|
part "spec_versions_response.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const SpecVersionsResponse({
|
class const SpecVersionsResponse({
|
||||||
required final IList<String> versions,
|
required final IList<String> versions,
|
||||||
required final UnstableFeatures unstableFeatures,
|
required final UnstableFeatures unstableFeatures,
|
||||||
}) with _$SpecVersionsResponse {
|
}) with _$SpecVersionsResponse {
|
||||||
@override
|
|
||||||
Map<String, Object?> toJson() => _$SpecVersionsResponseToJson(this);
|
Map<String, Object?> toJson() => _$SpecVersionsResponseToJson(this);
|
||||||
|
|
||||||
factory SpecVersionsResponse.fromJson(Map<String, Object?> json) =>
|
factory SpecVersionsResponse.fromJson(Map<String, Object?> json) =>
|
||||||
_$SpecVersionsResponseFromJson(json);
|
_$SpecVersionsResponseFromJson(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const UnstableFeatures({
|
class const UnstableFeatures({
|
||||||
@JsonKey(name: "uk.timedout.msc4494") final bool msc4494 = false,
|
@JsonKey(name: "uk.timedout.msc4494") final bool msc4494 = false,
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import "package:nexus/models/space_edge.dart";
|
||||||
part "sync_data.freezed.dart";
|
part "sync_data.freezed.dart";
|
||||||
part "sync_data.g.dart";
|
part "sync_data.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const SyncData({
|
class const SyncData({
|
||||||
final bool clearState = false,
|
final bool clearState = false,
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import "package:freezed_annotation/freezed_annotation.dart";
|
||||||
part "sync_status.freezed.dart";
|
part "sync_status.freezed.dart";
|
||||||
part "sync_status.g.dart";
|
part "sync_status.g.dart";
|
||||||
|
|
||||||
@freezed
|
@Freezed(toJson: false, fromJson: false)
|
||||||
@JsonSerializable()
|
@JsonSerializable()
|
||||||
class const SyncStatus({
|
class const SyncStatus({
|
||||||
required final SyncStatusType type,
|
required final SyncStatusType type,
|
||||||
|
|
|
||||||
|
|
@ -301,10 +301,10 @@ packages:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: dynamic_color
|
name: dynamic_color
|
||||||
sha256: "4aeb76de323e8eb660bab5557d826ad7ebbf1434a598f0c6aa8a11a9696a6757"
|
sha256: "869b3bce0100eb519768ecd71c0111f0b5ea679f5f62e1f59c49d80067e730c5"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.9.0"
|
version: "2.1.0"
|
||||||
dynamic_polls:
|
dynamic_polls:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|
@ -1004,7 +1004,7 @@ packages:
|
||||||
description:
|
description:
|
||||||
path: "packages/navigation_rail_m3e"
|
path: "packages/navigation_rail_m3e"
|
||||||
ref: HEAD
|
ref: HEAD
|
||||||
resolved-ref: "667b0bc8526fd53296778903b6ef3f22424f3aa4"
|
resolved-ref: c9edb0be7251e1a31e2336444f00557eb93ca09d
|
||||||
url: "https://github.com/Henry-Hiles/material_3_expressive"
|
url: "https://github.com/Henry-Hiles/material_3_expressive"
|
||||||
source: git
|
source: git
|
||||||
version: "0.3.5"
|
version: "0.3.5"
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ environment:
|
||||||
sdk: 3.13.0
|
sdk: 3.13.0
|
||||||
|
|
||||||
dependency_overrides:
|
dependency_overrides:
|
||||||
|
dynamic_color: 2.1.0
|
||||||
path_provider_android: 2.2.23 # Pinned to avoid JNI
|
path_provider_android: 2.2.23 # Pinned to avoid JNI
|
||||||
linkify:
|
linkify:
|
||||||
git:
|
git:
|
||||||
|
|
@ -38,7 +39,7 @@ dependencies:
|
||||||
freezed_annotation: 3.1.0
|
freezed_annotation: 3.1.0
|
||||||
image_picker: 1.2.3
|
image_picker: 1.2.3
|
||||||
path: 1.9.1
|
path: 1.9.1
|
||||||
dynamic_color: 1.9.0
|
dynamic_color: 2.1.0
|
||||||
collection: 1.19.1
|
collection: 1.19.1
|
||||||
window_manager: 0.5.2
|
window_manager: 0.5.2
|
||||||
color_hash: 1.0.1
|
color_hash: 1.0.1
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue