CustomShowcase constructor

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

Implementation

const CustomShowcase({
  required this.key,
  required this.child,
  required this.currentWidgetId,
  required this.buttonWidget,
  this.isLast = false,
  this.title,
  this.buttonStyle,
  this.titleAlignment = TextAlign.start,
  required this.description,
  this.totalWidgetsID = 5,
  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.indctorStyle,
  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.indctorPadding,
  this.titlePadding,
  this.descriptionPadding,
})  : height = null,
      width = null,
      container = null,
      assert(overlayOpacity >= 0.0 && overlayOpacity <= 1.0,
          "overlay opacity must be between 0 and 1."),
      assert(
          onTargetClick == null
              ? true
              : (disposeOnTap == null ? false : true),
          "disposeOnTap is required if you're using onTargetClick"),
      assert(
          disposeOnTap == null
              ? true
              : (onTargetClick == null ? false : true),
          "onTargetClick is required if you're using disposeOnTap");