useBuildContext function

BuildContext useBuildContext()

Retrieves a BuildContext from the current HookContext.

Shorthand for useProvided with BuildContext as the type parameter. This doesn't have to be available in every HookContext (e.g. when using raw HookProviderContainer). This BuildContext can be used to register dependencies on InheritedWidgets, rebuilding the hook after it changes.

Implementation

BuildContext useBuildContext() => useProvided<BuildContext>();