TAnimationLoader constructor

const TAnimationLoader({
  1. Key? key,
  2. Widget? message,
  3. String? animation,
  4. bool showAction = false,
  5. String? actionText,
  6. VoidCallback? onActionPressed,
  7. double height = 200,
  8. double width = 200,
  9. TextStyle? style,
  10. Widget? actionChild,
  11. bool isLottieAnimation = false,
})

Creates a TAnimationLoader.

  • message is the message displayed below the animation.
  • animation is the path to the animation asset (e.g., Lottie or image).
  • isLottieAnimation Weather this is a Lottie or simple gif/image.
  • showAction controls the visibility of the action button.
  • actionChild Optional Child widget for the actions at the bottom of animation.
  • actionText is the label for the action button (optional, required if showAction is true).
  • onActionPressed is the callback executed when the action button is pressed.
  • height and width set the size of the animation (default: 400x400).
  • style customizes the text style for the message.

Implementation

const TAnimationLoader({
  super.key,
  this.message,
  this.animation,
  this.showAction = false,
  this.actionText,
  this.onActionPressed,
  this.height = 200,
  this.width = 200,
  this.style,
  this.actionChild,
  this.isLottieAnimation = false,
}) : assert(
        !showAction || (showAction && actionText != null),
        'actionText must be provided when showAction is true, in TAnimationLoader.',
      );