errorState static method
Widget
errorState({
- required VoidCallback onRetry,
- required SplashTheme theme,
- String message = 'Something went wrong.\nPlease check your connection.',
- String retryLabel = 'Retry',
An error state widget with icon, message, and retry button.
Implementation
static Widget errorState({
required VoidCallback onRetry,
required SplashTheme theme,
String message = 'Something went wrong.\nPlease check your connection.',
String retryLabel = 'Retry',
}) {
return Center(
child: Padding(
padding: const EdgeInsets.all(32),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.wifi_off_rounded, size: 48, color: theme.textColor.withAlpha(160)),
const SizedBox(height: 16),
Text(
message,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 15,
color: theme.textColor.withAlpha(200),
height: 1.5,
),
),
const SizedBox(height: 28),
retryButton(
onRetry: onRetry,
theme: theme,
label: retryLabel,
),
],
),
),
);
}