Skip to content

Code generator for widget equality #4562

@DaveShuckerow

Description

@DaveShuckerow

It'd be really nice if we had a code generation for equality between widgets, like for example:

@equalableFields
class MyWidget extends StatefulWidget {
  final Foo myFoo;
  final Bar myBar;
  ...
}

would generate the following:

class MyWidget extends StatefulWidget {
  final Foo myFoo;
  final Bar myBar;
  ...
  bool hasEqualFields(MyWidget other) => myFoo == other.myFoo && myBar == other.myBar;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: new featureNothing broken; request for a new capabilityframeworkflutter/packages/flutter repository. See also f: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions