FadingEdgeScrollView.fromSingleChildScrollView constructor

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

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

Implementation

factory FadingEdgeScrollView.fromSingleChildScrollView({
  Key? key,
  required SingleChildScrollView child,
  double gradientFractionOnStart = 0.1,
  double gradientFractionOnEnd = 0.1,
}) {
  final controller = child.controller;
  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,
  );
}