Skip to content

Custom constructors require all fields to be specified #1

Description

@pauldemarco

Custom constructors require all fields to be specified:

@data
class $Person {
  String name = 'Paul';

  @nullable
  double weight;

  int age;

  /// Generated code will complain that final field `weight` is not initialized
  $Person.genius()
  : name = 'Albert',
    age = 140;
}

Activity

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

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