@MappableClass()
class MessageDto with MessageDtoMappable {
final TopicRefDto topic;
final String parentTopicName;
final String? subject;
final String body;
final List<MessageContactDto> contacts;
final DateTime timestamp;
final String? inResponseMessageToId;
MessageDto({
required this.topic,
required this.parentTopicName,
this.subject,
required this.body,
required this.contacts,
required this.timestamp,
this.inResponseMessageToId,
});
}
The getter 'copyWith' isn't defined for the type 'MessageContactDto'.
Try importing the library that defines 'copyWith', correcting the name to the name of an existing getter, or defining a getter or field named 'copyWith'.
MessageContactDtoCopyWith<MessageContactDto, MessageContactDto,
MessageContactDto>
get copyWith => _MessageContactDtoCopyWithImpl(
this as MessageContactDto, $identity, $identity);
Why is it throwing the error? It appears to be correct and should be doing a deep copy on the list?
I have the following:
part 'messagedto.mapper.dart';
Which generates this:
which throws an error:
MessageContactDto is defined like this:
Which generates (in part):
Why is it throwing the error? It appears to be correct and should be doing a deep copy on the list?