buildHelperText method

Widget buildHelperText(
  1. TInputContext ctx,
  2. String? helperText
)

Implementation

Widget buildHelperText(TInputContext ctx, String? helperText) {
  if (helperTextBuilder != null) {
    return helperTextBuilder!(ctx, helperText);
  }

  if (helperText == null) return const SizedBox.shrink();

  final resolvedHelperStyle = _resolve(helperTextStyle, ctx.states);

  return Padding(
    padding: const EdgeInsets.only(top: 4.0),
    child: Text(
      helperText,
      style: resolvedHelperStyle ??
          TextStyle(fontSize: 12.0, fontWeight: FontWeight.w300, color: ctx.colors.onSurfaceVariant.withAlpha(200)),
    ),
  );
}