buildEmptyState method
Implementation
Widget buildEmptyState(BuildContext context) {
if (emptyStateBuilder != null) return emptyStateBuilder!(context);
final colors = Theme.of(context).colorScheme;
return LayoutBuilder(builder: (_, constraints) {
return constraints.maxWidth > 250
? Center(
child: Padding(
padding: const EdgeInsets.all(32),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Icon(emptyStateIcon, size: 64, color: colors.onSurfaceVariant),
const SizedBox(height: 16),
Text('No data available', style: TextStyle(fontSize: 18, fontWeight: FontWeight.w500, color: colors.onSurface)),
const SizedBox(height: 8),
Text(emptyStateMessage, style: TextStyle(fontSize: 14, color: colors.onSurfaceVariant), textAlign: TextAlign.center),
],
),
),
)
: SizedBox.shrink();
});
}