2021年4月2日星期五

Flutter - Object has two of every field

All of my objects in the app are doubling up the fields. I think it might be how I'm using @freezed.

enter image description here

I didn't even know a map entry could have two fields with the same name.

Any one see why the fields are doubling up?

Even just instantiating this causes it to have 2 of each field:

@freezed  abstract class UserDomainEntity implements _$UserDomainEntity {    const factory UserDomainEntity({      String id,      String emailAddress,      String nickName,    }) = _UserDomainEntity;      const UserDomainEntity._();      factory UserDomainEntity.fromJson(Map<String, dynamic> json) =>        _$UserDomainEntityFromJson(json);  }  

then:

var t = const UserDomainEntity();  

Causes:

enter image description here

https://stackoverflow.com/questions/66926695/flutter-object-has-two-of-every-field April 03, 2021 at 08:31AM

没有评论:

发表评论