Skip to content

Document expected behavior for APIs that expect a return type of Type? #56500

@znjameswu

Description

@znjameswu

In Flutter 1.17.0, a breaking change was made to ParentDataWdiget. A new method debugTypicalAncestorWidgetClass requires users to override and return Type of its ancestor widget.

However, the ancestor could be a generic type, and Dart does not support generic type literals.

Since it is a relatively uncommon pattern in Flutter (AFAIK), and the solution is tricky to get around this Dart limitation, it could be confusing whether the user should return with or without generic type arguments. So mentioning this in documentation for relevant APIs can be helpful.

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listd: examplesSample code and demosframeworkflutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework teamwaiting for PR to land (fixed)A fix is in flight

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions