newInstance<T> abstract method
T
newInstance<T>(])
Creates a new instance of type T using the specified constructor name.
For the default unnamed constructor, use an empty string '' for name.
name: The name of the constructor (e.g., 'named', or '' for default).returnType: The expected return type of the constructor.args: Positional arguments for the constructor.namedArgs: Named arguments for the constructor.
Throws an UnImplementedResolverException if the constructor cannot be resolved.
Implementation
T newInstance<T>(String name, [Type? returnType, List<Object?> args = const [], Map<String, Object?> namedArgs = const {}]);