Indicator constructor

const Indicator({
  1. required double triggerOffset,
  2. required bool clamping,
  3. Duration processedDuration = const Duration(seconds: 1),
  4. bool safeArea = true,
  5. SpringDescription? spring,
  6. SpringDescription? horizontalSpring,
  7. SpringBuilder? readySpringBuilder,
  8. SpringBuilder? horizontalReadySpringBuilder,
  9. bool springRebound = true,
  10. FrictionFactor? frictionFactor,
  11. FrictionFactor? horizontalFrictionFactor,
  12. double? infiniteOffset,
  13. bool? hitOver,
  14. bool? infiniteHitOver,
  15. IndicatorPosition position = IndicatorPosition.above,
  16. double? secondaryTriggerOffset,
  17. bool hapticFeedback = false,
  18. double secondaryVelocity = kDefaultSecondaryVelocity,
  19. double? secondaryDimension,
  20. double secondaryCloseTriggerOffset = kDefaultSecondaryCloseTriggerOffset,
  21. bool notifyWhenInvisible = false,
  22. IndicatorStateListenable? listenable,
  23. bool triggerWhenReach = false,
  24. bool triggerWhenRelease = false,
  25. bool triggerWhenReleaseNoWait = false,
  26. double maxOverOffset = double.infinity,
})

Implementation

const Indicator({
  required this.triggerOffset,
  required this.clamping,
  this.processedDuration = const Duration(seconds: 1),
  this.safeArea = true,
  this.spring,
  this.horizontalSpring,
  this.readySpringBuilder,
  this.horizontalReadySpringBuilder,
  this.springRebound = true,
  this.frictionFactor,
  this.horizontalFrictionFactor,
  this.infiniteOffset,
  bool? hitOver,
  bool? infiniteHitOver,
  this.position = IndicatorPosition.above,
  this.secondaryTriggerOffset,
  this.hapticFeedback = false,
  this.secondaryVelocity = kDefaultSecondaryVelocity,
  this.secondaryDimension,
  this.secondaryCloseTriggerOffset = kDefaultSecondaryCloseTriggerOffset,
  this.notifyWhenInvisible = false,
  this.listenable,
  this.triggerWhenReach = false,
  this.triggerWhenRelease = false,
  this.triggerWhenReleaseNoWait = false,
  this.maxOverOffset = double.infinity,
})  : hitOver = hitOver ?? infiniteOffset != null,
      infiniteHitOver = infiniteHitOver ?? infiniteOffset == null,
      assert(infiniteOffset == null || infiniteOffset >= 0,
          'The infiniteOffset cannot be less than 0.'),
      assert(infiniteOffset == null || !clamping,
          'Cannot scroll indefinitely when clamping.'),
      assert(!(hitOver == false && infiniteOffset != null),
          'When hitOver is true, infinite scrolling cannot be used, please set infiniteHitOver.'),
      assert(
          secondaryTriggerOffset == null ||
              secondaryTriggerOffset > triggerOffset,
          'The secondaryTriggerOffset cannot be less than triggerOffset.'),
      assert(!(infiniteOffset != null && secondaryTriggerOffset != null),
          'Infinite scroll and secondary cannot be used together.'),
      assert(
          secondaryDimension == null ||
              secondaryDimension > (secondaryTriggerOffset ?? 0),
          'The secondaryDimension cannot be less than secondaryTriggerOffset.'),
      assert(maxOverOffset == double.infinity || maxOverOffset >= 0,
          'The maxOverOffset cannot be less than 0.');