build method

  1. @override
Widget build(
  1. BuildContext context
)
override

Implementation

@override
Widget build(BuildContext context) {
  return LayoutBuilder(
    builder: (context, constraints) {
      // Calculate the visible text scale factor.
      final textScaleFactor = widget.configuration.textScaleFactor ??
          MediaQuery.of(context).textScaleFactor *
              sqrt(
                ((constraints.maxWidth * constraints.maxHeight) /
                        (kTextScaleFactorReferenceWidth *
                            kTextScaleFactorReferenceHeight))
                    .clamp(0.0, 1.0),
              );
      return Material(
        color: Colors.transparent,
        child: AnimatedContainer(
          padding: padding,
          duration: duration,
          alignment: Alignment.bottomCenter,
          child: Text(
            [
              for (final line in subtitle)
                if (line.trim().isNotEmpty) line.trim(),
            ].join('\n'),
            style: style,
            textAlign: textAlign,
            textScaleFactor: textScaleFactor,
          ),
        ),
      );
    },
  );
}