createInstanceByType method Null safety

dynamic createInstanceByType(
  1. Type? type,
  2. List? args
)

Creates an instance of an object type.

  • type an object type (factory function) to create.
  • args arguments for the object constructor. Returns the created object instance.