Skip to content

error: The name 'onSet' is already defined #1184

Open

Description

@deadsoul44

I am not sure why this is happening but for only some generated classes, I get this error.

  ListBuilder<Event>? _events;
  ListBuilder<Event> get events => _$this._events ??= new ListBuilder<Event>();
  void Function() onSet = () {};

  set events(ListBuilder<Event>? events) {
    _$this._events = events;
    onSet();
  }

There are same onSet definitions for every field.

Activity

  1. deadsoul44 commented on Aug 23, 2022

    @deadsoul44
    Author

    This is happening when @BuiltValue(generateBuilderOnSetField: true).

  2. davidmorgan commented on Aug 24, 2022

    @davidmorgan
    Collaborator

    Have you defined something yourself in the class called onSet? That would be one possible explanation ;)

  3. self-assigned this
    on Aug 24, 2022
  4. deadsoul44 commented on Aug 24, 2022

    @deadsoul44
    Author

    No :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions