useFixedExtentScrollController function

FixedExtentScrollController useFixedExtentScrollController({
  1. int initialItem = 0,
  2. void onAttach(
    1. ScrollPosition
    )?,
  3. void onDetach(
    1. ScrollPosition
    )?,
  4. bool keepScrollOffset = true,
  5. String? debugLabel,
})

Creates a fixed extent scroll controller

The controller will be automatically disposed when the component is unmounted

Implementation

FixedExtentScrollController useFixedExtentScrollController({
  int initialItem = 0,
  void Function(ScrollPosition)? onAttach,
  void Function(ScrollPosition)? onDetach,
  bool keepScrollOffset = true,
  String? debugLabel,
}) {
  return useChangeNotifier(
    () => FixedExtentScrollController(
      initialItem: initialItem,
      onAttach: onAttach,
      onDetach: onDetach,
      keepScrollOffset: keepScrollOffset,
      debugLabel: debugLabel,
    ),
  );
}