Skip to content
This repository was archived by the owner on Feb 8, 2022. It is now read-only.
This repository was archived by the owner on Feb 8, 2022. It is now read-only.

Naming convention of factory fromJson and toJson #3

Description

@Wouter12

Issue

I have a class
class xxxModel with xxxMixin, EquatableMixin { ... }.
when generating the factory and toJson method, the naming of the factory is
factory xxxModel with xxxMixin, EquatableMixin.fromJson(Map<String, dynamic> json) => _$xxxModel with xxxMixin, EquatableMixinFromJson(json);
Map<String, dynamic> toJson( instance) => _$xxxModel with xxxMixin, EquatableMixinToJson(this);

expected

factory xxxModel.fromJson(Map<String, dynamic> json) => _$xxxModelFromJson(json);
Map<String, dynamic> toJson( instance) => _$xxxModelToJson(this);

proposal

only take the class name for generating the factory, and not the extensions, mixins and implementations the class uses

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