subGetGetter method

Substitution<V> subGetGetter(
  1. GetGetter<V> factory, {
  2. bool autoDispose = true,
})

Uses a callback (typically a constructor) to create a Substitution which can be passed into a GetScope.

This can be useful if, for example, a StatelessWidget builds a GetScope: passing a constructor tear-off such as Get.vsync is preferred to Get.vsync(), since the latter would create a new animation controller each time the widget is built.

Implementation

Substitution<V> subGetGetter(GetGetter<V> factory, {bool autoDispose = true}) {
  return _SubGetFactory(_get.hooked, factory, autoDispose: autoDispose);
}