animatedBuilder method

  1. @override
Widget animatedBuilder(
  1. BuildContext context,
  2. Widget? child
)
override

Widget showing animated text, based on animation value(s).

Implementation

@override
Widget animatedBuilder(BuildContext context, Widget? child) {
  final fontSize =
      textStyle?.fontSize ?? DefaultTextStyle.of(context).style.fontSize;

  return SizedBox(
    height: transitionHeight ?? (fontSize! * 10 / 3),
    child: AlignTransition(
      alignment: _slideIn.value.y != 0.0 || !rotateOut ? _slideIn : _slideOut,
      child: Opacity(
        opacity: _fadeIn.value != 1.0 || !rotateOut
            ? _fadeIn.value
            : _fadeOut.value,
        child: textWidget(text),
      ),
    ),
  );
}