HooksBuildExtension extension
Provides a suite of custom hooks via BuildContext to manage the lifecycle of common Flutter controllers and resource-heavy objects automatically.
- on
Methods
-
useAnimationController(
{double? value, Duration? duration, Duration? reverseDuration, String? debugLabel, double lowerBound = 0.0, double upperBound = 1.0, AnimationBehavior animationBehavior = AnimationBehavior.normal, required TickerProvider vsync}) → AnimationController -
Available on BuildContext, provided by the HooksBuildExtension extension
Creates and automatically disposes an AnimationController. -
useFocusNode(
{String? debugLabel, FocusOnKeyEventCallback? onKeyEvent, bool skipTraversal = false, bool canRequestFocus = true, bool descendantsAreFocusable = true, bool descendantsAreTraversable = true}) → FocusNode -
Available on BuildContext, provided by the HooksBuildExtension extension
Creates and automatically disposes a FocusNode. -
usePageController(
{int initialPage = 0, bool keepPage = true, double viewportFraction = 1.0, ScrollControllerCallback? onAttach, ScrollControllerCallback? onDetach}) → PageController -
Available on BuildContext, provided by the HooksBuildExtension extension
Creates and automatically disposes a PageController. -
useScrollController(
{double initialScrollOffset = 0.0, bool keepScrollOffset = true, String? debugLabel, ScrollControllerCallback? onAttach, ScrollControllerCallback? onDetach}) → ScrollController -
Available on BuildContext, provided by the HooksBuildExtension extension
Creates and automatically disposes a ScrollController. -
useStreamController<
T> ({void onListen()?, void onPause()?, void onResume()?, FutureOr< void> onCancel()?, bool sync = false}) → StreamController<T> -
Available on BuildContext, provided by the HooksBuildExtension extension
Creates and automatically disposes a StreamController. -
useStreamControllerBroadcast<
T> ({void onListen()?, void onCancel()?, bool sync = false}) → StreamController< T> -
Available on BuildContext, provided by the HooksBuildExtension extension
Creates and automatically disposes a StreamController.broadcast. -
useTabController(
{int initialIndex = 0, Duration? animationDuration, required int length, required TickerProvider vsync}) → TabController -
Available on BuildContext, provided by the HooksBuildExtension extension
Creates and automatically disposes a TabController. -
useTextEditingController(
{String? text}) → TextEditingController -
Available on BuildContext, provided by the HooksBuildExtension extension
Creates and automatically disposes a TextEditingController. -
useTickerProvider(
) → TickerProvider -
Available on BuildContext, provided by the HooksBuildExtension extension
Creates and automatically disposes a TickerProvider. -
useVsync(
) → TickerProvider -
Available on BuildContext, provided by the HooksBuildExtension extension
This is an alias for useTickerProvider.