Skip to content

Possibility to ignore late final fields? #315

@avbk

Description

@avbk

Hi @schultek,

first of all thanks for your efforts! I really enjoy using your library. While migrating from freezed to dart_mappable I noticed some interesting behavior.

I like to use some computed fields in my model files. I noticed that it will be included into the serializer if use late final double foo = bar * 2.0;, but it will be ignored if I use a getter like double get foo => bar * 2.0;.

I would argue that there shouldnt be a difference between a lazy initialized read-only field and a ready-only Getter and wonder if you have any plans to (maybe manually using something like @MappingField(ignore: true)) exclude such fields?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions