buildError method

Widget buildError(
  1. BuildContext context
)
inherited

Builds just the error widget

Implementation

Widget buildError(BuildContext context) {
  final fieldError = getFieldError(context);
  if (fieldError == null || !showError) return const SizedBox.shrink();

  final theme = Theme.of(context);
  return Padding(
    padding: const EdgeInsets.only(left: 12),
    child: Text(fieldError, style: theme.textTheme.bodySmall?.copyWith(color: theme.colorScheme.error)),
  );
}