Curtains.elevated constructor

const Curtains.elevated({
  1. Key? key,
  2. Axis scrollDirection = Axis.vertical,
  3. double? elevation = 9.0,
  4. Color? color,
  5. Sensitivity sensitivity = Sensitivity.none,
  6. bool startInitVisible = false,
  7. bool endInitVisible = true,
  8. AlignmentGeometry? alignment,
  9. TextDirection? textDirection,
  10. Clip clipBehavior = Clip.hardEdge,
  11. required Widget child,
  12. Duration? duration = _350ms,
  13. Curve? curve = Curves.easeOut,
})

Wraps a scrollable child with scrim shadows while
not at the start or end, alluding to unrevealed content.

Construct simple elevated 📜 Curtains that only require
a scrollable child. Instead of Decorations for each curtain,
supply double elevation that is shared by both.


Parameter scrollDirection defaults to Axis.vertical like ListView.

  • Initialize this property to match the child's scrollDirection.

Parameter textDirection defaults to Directionality.of(context),
but may be overridden.

With non-negative Sensitivity, the scrims of this 📜 Curtains
will change state before the scrollable reaches a min/max extent.

  • sensitivity.start defines startCurtain tolerance to min extent.
  • sensitivity.end defines endCurtain tolerance to max extent.

Parameter elevation defaults to 9.0 and color may be overridden


  • Before any scrolling occurs, end curtain initializes visible, even if this 📜 Curtains wraps a scrollable not long enough to scroll.

See class documentation for full examples: 📜 Curtains

animated gif showing elevated 📜 Curtains

Implementation

const Curtains.elevated({
  Key? key,
  this.scrollDirection = Axis.vertical,
  this.elevation = 9.0,
  this.color,
  this.sensitivity = Sensitivity.none,
  this.startInitVisible = false,
  this.endInitVisible = true,
  this.alignment,
  this.textDirection,
  this.clipBehavior = Clip.hardEdge,
  required this.child,
  this.duration = _350ms,
  this.curve = Curves.easeOut,
})  : _isDrawn = false,
      startCurtain = null,
      endCurtain = null,
      spread = 0.0,
      super(key: key);