BindingsBuilder<T>.put constructor
BindingsBuilder<T>.put (
- InstanceBuilderCallback<
T> builder, { - String? tag,
- bool permanent = false,
Shortcut to register 1 Controller with Get.put(), Prevents the issue of the fat arrow function with the constructor. BindingsBuilder(() => Get.put(HomeController())),
Sample:
GetPage(
name: '/',
page: () => Home(),
binding: BindingsBuilder.put(() => HomeController()),
),
Implementation
factory BindingsBuilder.put(InstanceBuilderCallback<T> builder,
{String? tag, bool permanent = false}) {
return BindingsBuilder(
() => GetInstance().put<T>(builder(), tag: tag, permanent: permanent));
}