New of T
#4333
Labels
feature
Proposed language feature that solves one or more problems
state-duplicate
This issue or pull request already exists
Uh oh!
There was an error while loading. Please reload this page.
Introduction
It would be nice if Dart could instantiate a generic type. For example:
This would likely need some sort of generic constraint to ensure
T
can be instantiated.Use case
Today, a Flutter
StatefulWidget
must implement thecreateState
method:This language feature would be a step towards removing the
createState
method:StatefulWidget
would accept a generic parameter and use that to provide a defaultcreateState
implementation:Previous discussions
The following issues appear relevant:
Type
objects #4200Feel free to close this if there is a better tracking issue already :)
The text was updated successfully, but these errors were encountered: