useSubstitute<G extends GetAny> function
Creates a Substitution and automatically applies it to the nearest ancestor GetScope.
This can be called inside HookWidget.build to achieve the same result as GetScope.add.
The substitution is automatically removed when the widget's BuildContext is unmounted.
Implementation
G useSubstitute<G extends GetAny>(G get, Object replacer, {Object? key}) {
return use(_SubHook.new, data: (get, replacer), key: key, debugLabel: 'useSubstitute<$G>');
}