Skip to content

Ability to add mixins to classesΒ #30

@TimWhiting

Description

@TimWhiting

I think there should be a way to add mixins / implements / extends clauses to classes. Freezed requires a mixin for creating switch like functions for union classes. But currently you have to annotate it like this.

@freezed
class Person with _$Person {
  factory Person({ String? name, int? age }) = _Person;
}

Ideally the macro could add the mixin application itself, but currently the API only allows adding members to a class.

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