buildErrorState static method

Widget buildErrorState(
  1. ColorScheme colors, {
  2. IconData icon = Icons.error_outline,
  3. required String title,
  4. required String message,
})

Builds a default error state widget.

Implementation

static Widget buildErrorState(
  ColorScheme colors, {
  IconData icon = Icons.error_outline,
  required String title,
  required String message,
}) {
  return Center(
    child: Padding(
      padding: const EdgeInsets.all(32),
      child: Column(
        mainAxisSize: MainAxisSize.min,
        children: [
          Icon(icon, size: 64, color: colors.error),
          const SizedBox(height: 16),
          Text(title, style: TextStyle(fontSize: 18, fontWeight: FontWeight.w500, color: colors.onSurface)),
          const SizedBox(height: 8),
          Text(message, style: TextStyle(fontSize: 14, color: colors.onSurfaceVariant), textAlign: TextAlign.center),
        ],
      ),
    ),
  );
}