Showcase constructor

const Showcase({
  1. required GlobalKey<State<StatefulWidget>> key,
  2. required String? description,
  3. required Widget child,
  4. required Widget container,
  5. String? title,
  6. TextAlign titleAlignment = TextAlign.start,
  7. TextAlign descriptionAlignment = TextAlign.start,
  8. ShapeBorder targetShapeBorder = const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(8))),
  9. Color overlayColor = Colors.black45,
  10. double overlayOpacity = 0.75,
  11. TextStyle? titleTextStyle,
  12. TextStyle? descTextStyle,
  13. Color tooltipBackgroundColor = Colors.white,
  14. Color textColor = Colors.black,
  15. Widget scrollLoadingWidget = const CircularProgressIndicator(valueColor: AlwaysStoppedAnimation(Colors.white)),
  16. bool showArrow = true,
  17. VoidCallback? onTargetClick,
  18. bool? disposeOnTap,
  19. Duration movingAnimationDuration = const Duration(milliseconds: 2000),
  20. bool? disableMovingAnimation,
  21. bool? disableScaleAnimation,
  22. EdgeInsets tooltipPadding = const EdgeInsets.symmetric(vertical: 8, horizontal: 8),
  23. VoidCallback? onToolTipClick,
  24. EdgeInsets targetPadding = EdgeInsets.zero,
  25. double? blurValue,
  26. BorderRadius? targetBorderRadius,
  27. VoidCallback? onTargetLongPress,
  28. VoidCallback? onTargetDoubleTap,
  29. BorderRadius? tooltipBorderRadius,
  30. bool disableDefaultTargetGestures = false,
  31. Duration scaleAnimationDuration = const Duration(milliseconds: 300),
  32. Curve scaleAnimationCurve = Curves.easeIn,
  33. Alignment? scaleAnimationAlignment,
  34. TooltipPosition? tooltipPosition,
  35. EdgeInsets? titlePadding,
  36. EdgeInsets? descriptionPadding,
  37. TextDirection? titleTextDirection,
  38. TextDirection? descriptionTextDirection,
  39. VoidCallback? onBarrierClick,
})

Implementation

const Showcase({
  required this.key,
  required this.description,
  required this.child,
  required this.container,
  this.title,
  this.titleAlignment = TextAlign.start,
  this.descriptionAlignment = TextAlign.start,
  this.targetShapeBorder = const RoundedRectangleBorder(
    borderRadius: BorderRadius.all(Radius.circular(8)),
  ),
  this.overlayColor = Colors.black45,
  this.overlayOpacity = 0.75,
  this.titleTextStyle,
  this.descTextStyle,
  this.tooltipBackgroundColor = Colors.white,
  this.textColor = Colors.black,
  this.scrollLoadingWidget = const CircularProgressIndicator(
    valueColor: AlwaysStoppedAnimation(Colors.white),
  ),
  this.showArrow = true,
  this.onTargetClick,
  this.disposeOnTap,
  this.movingAnimationDuration = const Duration(milliseconds: 2000),
  this.disableMovingAnimation,
  this.disableScaleAnimation,
  this.tooltipPadding =
      const EdgeInsets.symmetric(vertical: 8, horizontal: 8),
  this.onToolTipClick,
  this.targetPadding = EdgeInsets.zero,
  this.blurValue,
  this.targetBorderRadius,
  this.onTargetLongPress,
  this.onTargetDoubleTap,
  this.tooltipBorderRadius,
  this.disableDefaultTargetGestures = false,
  this.scaleAnimationDuration = const Duration(milliseconds: 300),
  this.scaleAnimationCurve = Curves.easeIn,
  this.scaleAnimationAlignment,
  this.tooltipPosition,
  this.titlePadding,
  this.descriptionPadding,
  this.titleTextDirection,
  this.descriptionTextDirection,
  this.onBarrierClick,
})  : height = null,
      width = null,
      assert(overlayOpacity >= 0.0 && overlayOpacity <= 1.0,
          "overlay opacity must be between 0 and 1."),
      assert(onTargetClick == null || disposeOnTap != null,
          "disposeOnTap is required if you're using onTargetClick"),
      assert(disposeOnTap == null || onTargetClick != null,
          "onTargetClick is required if you're using disposeOnTap");