FadingEdgeScrollView.fromPageView constructor

FadingEdgeScrollView.fromPageView({
  1. Key? key,
  2. required PageView child,
  3. double gradientFractionOnStart = 0.1,
  4. double gradientFractionOnEnd = 0.1,
})

Constructor for creating FadingEdgeScrollView with PageView as child child must have PageView.controller set

Implementation

factory FadingEdgeScrollView.fromPageView({
  Key? key,
  required PageView child,
  double gradientFractionOnStart = 0.1,
  double gradientFractionOnEnd = 0.1,
}) {
  final controller = child.controller;
  //ignore: unnecessary_null_comparison
  if (controller == null) {
    throw Exception("Child must have controller set");
  }

  return FadingEdgeScrollView._internal(
    key: key,
    scrollController: controller,
    scrollDirection: child.scrollDirection,
    reverse: child.reverse,
    gradientFractionOnStart: gradientFractionOnStart,
    gradientFractionOnEnd: gradientFractionOnEnd,
    child: child,
  );
}