adding packages

This commit is contained in:
2026-01-15 14:38:46 -08:00
parent ef86e3ab6a
commit 6869cf47e5
5253 changed files with 726695 additions and 34 deletions
@@ -0,0 +1,14 @@
import 'package:dart_mappable/dart_mappable.dart';
part 'message.mapper.dart';
@MappableClass()
class Message with MessageMappable {
final String id;
final String message;
final String author;
Message({required this.id, required this.message, required this.author});
static const fromJson = MessageMapper.fromJson;
}
@@ -0,0 +1,134 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// dart format off
// ignore_for_file: type=lint
// ignore_for_file: unused_element, unnecessary_cast, override_on_non_overriding_member
// ignore_for_file: strict_raw_type, inference_failure_on_untyped_parameter
part of 'message.dart';
class MessageMapper extends ClassMapperBase<Message> {
MessageMapper._();
static MessageMapper? _instance;
static MessageMapper ensureInitialized() {
if (_instance == null) {
MapperContainer.globals.use(_instance = MessageMapper._());
}
return _instance!;
}
@override
final String id = 'Message';
static String _$id(Message v) => v.id;
static const Field<Message, String> _f$id = Field('id', _$id);
static String _$message(Message v) => v.message;
static const Field<Message, String> _f$message = Field('message', _$message);
static String _$author(Message v) => v.author;
static const Field<Message, String> _f$author = Field('author', _$author);
@override
final MappableFields<Message> fields = const {
#id: _f$id,
#message: _f$message,
#author: _f$author,
};
static Message _instantiate(DecodingData data) {
return Message(
id: data.dec(_f$id),
message: data.dec(_f$message),
author: data.dec(_f$author),
);
}
@override
final Function instantiate = _instantiate;
static Message fromMap(Map<String, dynamic> map) {
return ensureInitialized().decodeMap<Message>(map);
}
static Message fromJson(String json) {
return ensureInitialized().decodeJson<Message>(json);
}
}
mixin MessageMappable {
String toJson() {
return MessageMapper.ensureInitialized().encodeJson<Message>(
this as Message,
);
}
Map<String, dynamic> toMap() {
return MessageMapper.ensureInitialized().encodeMap<Message>(
this as Message,
);
}
MessageCopyWith<Message, Message, Message> get copyWith =>
_MessageCopyWithImpl<Message, Message>(
this as Message,
$identity,
$identity,
);
@override
String toString() {
return MessageMapper.ensureInitialized().stringifyValue(this as Message);
}
@override
bool operator ==(Object other) {
return MessageMapper.ensureInitialized().equalsValue(
this as Message,
other,
);
}
@override
int get hashCode {
return MessageMapper.ensureInitialized().hashValue(this as Message);
}
}
extension MessageValueCopy<$R, $Out> on ObjectCopyWith<$R, Message, $Out> {
MessageCopyWith<$R, Message, $Out> get $asMessage =>
$base.as((v, t, t2) => _MessageCopyWithImpl<$R, $Out>(v, t, t2));
}
abstract class MessageCopyWith<$R, $In extends Message, $Out>
implements ClassCopyWith<$R, $In, $Out> {
$R call({String? id, String? message, String? author});
MessageCopyWith<$R2, $In, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t);
}
class _MessageCopyWithImpl<$R, $Out>
extends ClassCopyWithBase<$R, Message, $Out>
implements MessageCopyWith<$R, Message, $Out> {
_MessageCopyWithImpl(super.value, super.then, super.then2);
@override
late final ClassMapperBase<Message> $mapper =
MessageMapper.ensureInitialized();
@override
$R call({String? id, String? message, String? author}) => $apply(
FieldCopyWithData({
if (id != null) #id: id,
if (message != null) #message: message,
if (author != null) #author: author,
}),
);
@override
Message $make(CopyWithData data) => Message(
id: data.get(#id, or: $value.id),
message: data.get(#message, or: $value.message),
author: data.get(#author, or: $value.author),
);
@override
MessageCopyWith<$R2, Message, $Out2> $chain<$R2, $Out2>(Then<$Out2, $R2> t) =>
_MessageCopyWithImpl<$R2, $Out2>($value, $cast, t);
}