Create an Instance of a Class Whose Name Will Be Supplied at Runtime #15519
Labels
area-library
closed-not-planned
Closed as we don't intend to take action on the reported issue
library-mirrors
type-enhancement
A request for a change that isn't a bug
This issue was originally filed by jan.d...@gmail.com
Now to I can create dart instace dynamically this way:
ClassMirror mirror = reflectClass(Example);
var newInstance = mirror.newInstance(const Symbol(''), []).reflectee;
I would like to see something like this:
ClassMirror mirror = reflectClass("full.qualified.path.Example");
var newInstance = mirror.newInstance(const Symbol(''), []).reflectee;
I wan to use it for strongly typed IO operations.
Enclosing similar syntax from Java:
Class mirror = Class.forName("full.qualified.path.Example");
full.qualified.path.Example newInstance = (full.qualified.path.Example) mirror.newInstance();
The text was updated successfully, but these errors were encountered: