init<T> static method

T? init<T>({
  1. Type? key,
  2. dynamic args,
})

Returns new object of requested Type via initializer in ControlFactory. When args are not null and initialized object is Initializable then Initializable.init is called.

This function is also called when ControlFactory.get fails to find object in internal store and key is Type. In most of cases is preferred to use more powerful ControlFactory.get.

Initializers are passed to factory during init phase or later can be added via ControlFactory.add.

Control provides static call for this function via Control.init.

nullable

Implementation

static T? init<T>({Type? key, dynamic args}) =>
    factory.init(key: key, args: args);