Invokes the named constructor and returns a mirror on the result.
Let c be the class reflected by this mirror, let a1, ..., an be the elements of positionalArguments
, let k1, ..., km be the identifiers denoted by the elements of namedArguments.keys
, and let v1, ..., vm be the elements of namedArguments.values
.
If constructorName
was created from the empty string, then this method will execute the instance creation expression new c(a1, ..., an, k1: v1, ..., km: vm) in a scope that has access to the private members of c.
Otherwise, let f be the simple name of the constructor denoted by constructorName
. Then this method will execute the instance creation expression new c.f(a1, ..., an, k1: v1, ..., km: vm) in a scope that has access to the private members of c.
In either case:
InstanceMirror newInstance(Symbol constructorName, List positionalArguments, [Map<Symbol, dynamic> namedArguments]);
© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.5.0/dart-mirrors/ClassMirror/newInstance.html