☠☠ Warning: This package is experimental and may be removed in a future version of Dart. ☠☠
This package is not intended for wide use. It provides a temporary API to solve the problem: "Given an object some generic type A, how do I construct an instance of generic type B with the same type argument(s)?"
This is necessary in a few rare places in order to migrate existing code to Dart 2's stronger type system. Eventually, the hope is to have direct language support for solving this problem but we don't have time to get that into 2.0, so this package is provided as a temporary workaround.
We will very likely remove support for this in a later version of Dart. Please avoid using this if you can. If you feel you do need to use it, please reach out to @munificent or @leafpetersen and let us know.
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies: dart_internal: ^0.1.9
2. Install it
You can install packages from the command line:
$ pub get
$ flutter pub get
Alternatively, your editor might support
pub get or
flutter pub get.
Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use:
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
We analyzed this package on May 13, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.8.1
- pana: 0.13.8-dev
Maintenance issues and suggestions
Support future stable Dart 2 SDKs in
pubspec.yaml. (-20 points)
The SDK constraint in
pubspec.yaml doesn't allow future stable Dart 2.x SDK releases.
Provide a file named
CHANGELOG.md. (-20 points)
Changelog entries help developers follow the progress of your package. See the example generated by
Homepage URL isn't helpful. (-10 points)
homepage field from
pubspec.yaml: link to a website about the package or use the source repository URL.
Maintain an example. (-10 points)
Create a short demo in the
example/ directory to show how to use this package.
Common filename patterns include
dart_internal.dart. Packages with multiple examples should provide
For more information see the pub package layout conventions.
The description is too long. (-10 points)
Search engines display only the first part of the description. Try to keep the value of the
description field in your package's
pubspec.yaml file between 60 and 180 characters.
|Dart SDK||>=2.0.0-dev.12.0 <2.9.0|