final treewide fixes

This commit is contained in:
Henry Hiles 2026-08-22 13:03:36 -04:00
commit 05682dd0de
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
48 changed files with 78 additions and 110 deletions

View file

@ -102,7 +102,6 @@ class const App({super.key}) extends StatelessWidget {
builder: (context, ref, child) => MaterialApp(
navigatorKey: navigatorKey,
debugShowCheckedModeBanner: false,
// Use indigo to work around bugs in theme generation
theme:
(ref
.watch(SettingsController.provider)

View file

@ -4,12 +4,12 @@ import "package:freezed_annotation/freezed_annotation.dart";
part "account_data.freezed.dart";
part "account_data.g.dart";
@freezed
@Freezed(toJson: false, fromJson: false)
@JsonSerializable()
class const AccountData({
@JsonKey(name: AccountData.invitePermissionConfigKey)
final InvitePermissionConfig invitePermissionConfig =
const _InvitePermissionConfig(),
const InvitePermissionConfig(),
@JsonKey(name: AccountData.directKey)
final IMap<String, IList<String>> directMessages = const IMap.empty(),
@ -34,31 +34,28 @@ class const AccountData({
static const directKey = "m.direct";
static const recentEmojiKey = "m.recent_emoji";
@override
Map<String, Object?> toJson() => _$AccountDataToJson(this);
factory AccountData.fromJson(Map<String, Object?> json) =>
_$AccountDataFromJson(json);
}
@freezed
@Freezed(toJson: false, fromJson: false)
@JsonSerializable()
class const InvitePermissionConfig({
@JsonKey(unknownEnumValue: DefaultInviteAction.allow)
final DefaultInviteAction defaultAction = DefaultInviteAction.allow,
}) with _$InvitePermissionConfig {
@override
Map<String, Object?> toJson() => _$InvitePermissionConfigToJson(this);
factory InvitePermissionConfig.fromJson(Map<String, Object?> json) =>
_$InvitePermissionConfigFromJson(json);
}
@freezed
@Freezed(toJson: false, fromJson: false)
@JsonSerializable()
class const RecentEmoji({required final String emoji, required final int total})
with _$RecentEmoji {
@override
Map<String, Object?> toJson() => _$RecentEmojiToJson(this);
factory RecentEmoji.fromJson(Map<String, Object?> json) =>

View file

@ -3,7 +3,7 @@ import "package:freezed_annotation/freezed_annotation.dart";
part "client_state.freezed.dart";
part "client_state.g.dart";
@freezed
@Freezed(toJson: false, fromJson: false)
@JsonSerializable()
class const ClientState({
required final bool isInitialized,
@ -12,7 +12,6 @@ class const ClientState({
required final String? userId,
required final String? homeserverUrl,
}) with _$ClientState {
@override
Map<String, Object?> toJson() => _$ClientStateToJson(this);
factory ClientState.fromJson(Map<String, Object?> json) =>

View file

@ -4,13 +4,12 @@ import "package:nexus/models/membership_status.dart";
part "members_by_status.freezed.dart";
part "members_by_status.g.dart";
@freezed
@Freezed(toJson: false, fromJson: false)
@JsonSerializable()
class const MembersByStatusConfig({
required final String roomId,
required final MembershipStatus status,
}) with _$MembersByStatusConfig {
@override
Map<String, Object?> toJson() => _$MembersByStatusConfigToJson(this);
factory MembersByStatusConfig.fromJson(Map<String, Object?> json) =>

View file

@ -3,13 +3,12 @@ import "package:freezed_annotation/freezed_annotation.dart";
part "reactions.freezed.dart";
part "reactions.g.dart";
@freezed
@Freezed(toJson: false, fromJson: false)
@JsonSerializable()
class const ReactionsConfig({
required final String roomId,
required final int eventRowId,
}) with _$ReactionsConfig {
@override
Map<String, Object?> toJson() => _$ReactionsConfigToJson(this);
factory ReactionsConfig.fromJson(Map<String, Object?> json) =>

View file

@ -3,11 +3,10 @@ import "package:freezed_annotation/freezed_annotation.dart";
part "user.freezed.dart";
part "user.g.dart";
@freezed
@Freezed(toJson: false, fromJson: false)
@JsonSerializable()
class const UserConfig({final String? roomId, required final String userId})
with _$UserConfig {
@override
Map<String, Object?> toJson() => _$UserConfigToJson(this);
factory UserConfig.fromJson(Map<String, Object?> json) =>

View file

@ -30,10 +30,9 @@ enum RoomType {
space,
}
@freezed
@Freezed(toJson: false, fromJson: false)
@JsonSerializable()
class const PreviousRoom({required final String roomId}) with _$PreviousRoom {
@override
Map<String, Object?> toJson() => _$PreviousRoomToJson(this);
factory PreviousRoom.fromJson(Map<String, Object?> json) =>

View file

@ -17,13 +17,12 @@ sealed class JoinRulesContent extends Content with _$JoinRulesContent {
_$JoinRulesContentFromJson(json);
}
@freezed
@Freezed(toJson: false, fromJson: false)
@JsonSerializable()
class const AllowCondition({
final String? roomId,
required final AllowConditionType type,
}) with _$AllowCondition {
@override
Map<String, Object?> toJson() => _$AllowConditionToJson(this);
factory AllowCondition.fromJson(Map<String, Object?> json) =>

View file

@ -24,13 +24,12 @@ sealed class PowerLevelsContent extends Content with _$PowerLevelsContent {
_$PowerLevelsContentFromJson(json);
}
@freezed
@Freezed(toJson: false, fromJson: false)
@JsonSerializable()
class const Notifications({
final int room = 50,
final IMap<String, int> other = const IMap.empty(),
}) with _$Notifications {
@override
Map<String, Object?> toJson() => _$NotificationsToJson(this);
factory Notifications.fromJson(Map<String, Object?> json) =>

View file

@ -17,25 +17,23 @@ sealed class TopicContent extends Content with _$TopicContent {
_$TopicContentFromJson(json);
}
@freezed
@Freezed(toJson: false, fromJson: false)
@JsonSerializable()
class const TopicContentBlock({
final IList<TextualRepresentation> representations = const IList.empty(),
}) with _$TopicContentBlock {
@override
Map<String, Object?> toJson() => _$TopicContentBlockToJson(this);
factory TopicContentBlock.fromJson(Map<String, Object?> json) =>
_$TopicContentBlockFromJson(json);
}
@freezed
@Freezed(toJson: false, fromJson: false)
@JsonSerializable()
class const TextualRepresentation({
required final String body,
final String mimetype = "text/plain",
}) with _$TextualRepresentation {
@override
Map<String, Object?> toJson() => _$TextualRepresentationToJson(this);
factory TextualRepresentation.fromJson(Map<String, Object?> json) =>

18
lib/models/emoji.dart Normal file
View 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);
}

View file

@ -7,7 +7,7 @@ import "package:nexus/models/profile_response.dart";
part "event.freezed.dart";
part "event.g.dart";
@freezed
@Freezed(toJson: false, fromJson: false)
@JsonSerializable()
class const Event({
@JsonKey(name: "rowid") required final int rowId,
@ -34,7 +34,6 @@ class const Event({
required final Content content,
required final Content? previousContent,
}) with _$Event {
@override
Map<String, Object?> toJson() => _$EventToJson(this);
static String typeJsonFromJson(Map<dynamic, dynamic> json, _) =>
@ -75,7 +74,7 @@ class const Event({
);
}
@freezed
@Freezed(toJson: false, fromJson: false)
@JsonSerializable()
class const LocalContent({
final String? sanitizedHtml,
@ -85,7 +84,6 @@ class const LocalContent({
final bool? hasMath,
final bool? replyFallbackRemoved,
}) with _$LocalContent {
@override
Map<String, Object?> toJson() => _$LocalContentToJson(this);
@override

View file

@ -4,14 +4,13 @@ import "package:nexus/models/ms_duration.dart";
part "audio.freezed.dart";
part "audio.g.dart";
@freezed
@Freezed(toJson: false, fromJson: false)
@JsonSerializable()
class const AudioInfo({
@MSDuration() final Duration? duration,
@JsonKey(name: "mimetype") final String? mimeType,
final int? size,
}) with _$AudioInfo {
@override
Map<String, Object?> toJson() => _$AudioInfoToJson(this);
factory AudioInfo.fromJson(Map<String, Object?> json) =>

View file

@ -3,13 +3,12 @@ import "package:freezed_annotation/freezed_annotation.dart";
part "file.freezed.dart";
part "file.g.dart";
@freezed
@Freezed(toJson: false, fromJson: false)
@JsonSerializable()
class const FileInfo({
@JsonKey(name: "mimetype") final String? mimeType,
final int? size,
}) with _$FileInfo {
@override
Map<String, Object?> toJson() => _$FileInfoToJson(this);
factory FileInfo.fromJson(Map<String, Object?> json) =>

View file

@ -3,7 +3,7 @@ import "package:freezed_annotation/freezed_annotation.dart";
part "image.freezed.dart";
part "image.g.dart";
@freezed
@Freezed(toJson: false, fromJson: false)
@JsonSerializable()
class const ImageInfo({
@JsonKey(name: "h") final double? height,
@ -12,7 +12,6 @@ class const ImageInfo({
@JsonKey(name: "xyz.amorgan.blurhash") final String? blurHash,
final int? size,
}) with _$ImageInfo {
@override
Map<String, Object?> toJson() => _$ImageInfoToJson(this);
factory ImageInfo.fromJson(Map<String, Object?> json) =>

View file

@ -4,7 +4,7 @@ import "package:nexus/models/ms_duration.dart";
part "video.freezed.dart";
part "video.g.dart";
@freezed
@Freezed(toJson: false, fromJson: false)
@JsonSerializable()
class const VideoInfo({
@JsonKey(name: "h") final int? height,
@ -13,7 +13,6 @@ class const VideoInfo({
@MSDuration() final Duration? duration,
final int? size,
}) with _$VideoInfo {
@override
Map<String, Object?> toJson() => _$VideoInfoToJson(this);
factory VideoInfo.fromJson(Map<String, Object?> json) =>

View file

@ -4,14 +4,13 @@ import "package:freezed_annotation/freezed_annotation.dart";
part "lazy_load_summary.freezed.dart";
part "lazy_load_summary.g.dart";
@freezed
@Freezed(toJson: false, fromJson: false)
@JsonSerializable()
class const LazyLoadSummary({
required final IList<String>? heroes,
required final int? joinedMemberCount,
required final int? invitedMemberCount,
}) with _$LazyLoadSummary {
@override
Map<String, Object?> toJson() => _$LazyLoadSummaryToJson(this);
factory LazyLoadSummary.fromJson(Map<String, Object?> json) =>

View file

@ -3,14 +3,13 @@ import "package:freezed_annotation/freezed_annotation.dart";
part "oauth_auth_code_response.freezed.dart";
part "oauth_auth_code_response.g.dart";
@freezed
@Freezed(toJson: false, fromJson: false)
@JsonSerializable()
class const OAuthAuthCodeResponse({
required final String state,
required final String codeVerifier,
required final Uri url,
}) with _$OAuthAuthCodeResponse {
@override
Map<String, Object?> toJson() => _$OAuthAuthCodeResponseToJson(this);
factory OAuthAuthCodeResponse.fromJson(Map<String, Object?> json) =>

View file

@ -3,7 +3,7 @@ import "package:freezed_annotation/freezed_annotation.dart";
part "open_graph_data.freezed.dart";
part "open_graph_data.g.dart";
@freezed
@Freezed(toJson: false, fromJson: false)
@JsonSerializable()
class const OpenGraphData({
@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:height") required final double? height,
}) with _$OpenGraphData {
@override
Map<String, Object?> toJson() => _$OpenGraphDataToJson(this);
factory OpenGraphData.fromJson(Map<String, dynamic> json) =>

View file

@ -5,14 +5,13 @@ import "package:nexus/models/event.dart";
part "paginate.freezed.dart";
part "paginate.g.dart";
@freezed
@Freezed(toJson: false, fromJson: false)
@JsonSerializable()
class const Paginate({
required final IList<Event> events,
required final IList<Event> relatedEvents,
required final bool hasMore,
}) with _$Paginate {
@override
Map<String, Object?> toJson() => _$PaginateToJson(this);
factory Paginate.fromJson(Map<String, Object?> json) =>

Some files were not shown because too many files have changed in this diff Show more