Move to Flutter 3.47, use the improvements that come with this (#64)

Reviewed-on: #64
This commit is contained in:
Henry Hiles 2026-08-22 13:04:33 -04:00 committed by Henry Hiles
commit 077044ec19
157 changed files with 1366 additions and 1457 deletions

View file

@ -1,11 +1,12 @@
import "package:fast_immutable_collections/fast_immutable_collections.dart";
import "package:freezed_annotation/freezed_annotation.dart";
import "package:nexus/models/content/content.dart";
part "topic.freezed.dart";
part "topic.g.dart";
@freezed
abstract class TopicContent extends Content with _$TopicContent {
sealed class TopicContent extends Content with _$TopicContent {
TopicContent._();
factory TopicContent({
required String topic,
@ -16,24 +17,24 @@ abstract class TopicContent extends Content with _$TopicContent {
_$TopicContentFromJson(json);
}
@freezed
abstract class TopicContentBlock with _$TopicContentBlock {
factory TopicContentBlock({
@Default(IList.empty())
@JsonKey(name: "m.text")
IList<TextualRepresentation> representations,
}) = _TopicContentBlock;
@Freezed(toJson: false, fromJson: false)
@JsonSerializable()
class const TopicContentBlock({
final IList<TextualRepresentation> representations = const IList.empty(),
}) with _$TopicContentBlock {
Map<String, Object?> toJson() => _$TopicContentBlockToJson(this);
factory TopicContentBlock.fromJson(Map<String, Object?> json) =>
_$TopicContentBlockFromJson(json);
}
@freezed
abstract class TextualRepresentation with _$TextualRepresentation {
factory TextualRepresentation({
required String body,
@Default("text/plain") String mimetype,
}) = _TextualRepresentation;
@Freezed(toJson: false, fromJson: false)
@JsonSerializable()
class const TextualRepresentation({
required final String body,
final String mimetype = "text/plain",
}) with _$TextualRepresentation {
Map<String, Object?> toJson() => _$TextualRepresentationToJson(this);
factory TextualRepresentation.fromJson(Map<String, Object?> json) =>
_$TextualRepresentationFromJson(json);