Skip to main content

ErrorState

An error state widget for showing failure feedback with an optional retry.

When to use it​

Use ErrorState to communicate a failed data load, network error, or other recoverable failure, with an optional "Retry" action. Internally it composes an EmptyState with danger-toned colouring. Use ErrorState.large for a more prominent full-page version.

Import​

import 'package:catalyst_ui/catalyst_ui.dart';

Usage​

ErrorState(
title: const Text('Something went wrong'),
description: const Text('Check your connection and try again.'),
onRetry: _reload,
)

Parameters​

ParameterTypeDefaultDescription
titleWidgetrequiredThe primary error heading.
iconIconData?nullThe icon inside the red circle. Falls back to Iconography.alertIcon.
descriptionWidget?nullAn optional supporting description.
onRetryVoidCallback?nullWhen non-null, a "Retry" button is shown.

ErrorState.large​

An alternate constructor with the same parameters, rendering an 88px icon circle (via EmptyState.large) instead of the default 64px.

Iconography​

The icon inside the danger-toned circle uses icon, falling back to context.iconography.alertIcon.