empty_view library
A powerful Flutter package for displaying beautiful empty state views with animations, Lottie support, presets, shimmer loading, dark mode, and accessibility features.
Features
- Smart image source detection (network, file, SVG, asset)
- Lottie animation support
- Entrance animations (fade, slide, scale, bounce)
- Shimmer skeleton loading state
- Dark mode auto-detection
- Accessibility support with semantic labels
- Icon support (alternative to images)
- Secondary action button
- Retry logic with configurable options
- Platform-adaptive styling (Material/Cupertino)
- Prebuilt presets for common scenarios
Quick Start
import 'package:empty_view/empty_view.dart';
// Basic usage
EmptyView(
title: 'No Items Found',
description: 'There are no items to display.',
buttonText: 'Refresh',
onButtonTap: () => refresh(),
)
// Using presets
EmptyViewPresets.noInternet(onRetry: () => checkConnection())
EmptyViewPresets.emptyCart(onShopNow: () => navigateToShop())
EmptyViewPresets.noSearchResults(searchTerm: 'shoes')
// With Lottie animation
EmptyView(
lottiePath: 'assets/animations/empty.json',
title: 'Nothing Here',
description: 'Check back later!',
)
// With shimmer skeleton
EmptyView.skeleton()
Classes
- EmptyView
- A widget that displays an empty state view with smart image detection, animations, Lottie support, and accessibility features.
- EmptyViewPresets
- Preset configurations for common empty state scenarios.
- EmptyViewStyle
- Style configuration for EmptyView widget.
Enums
- EmptyViewAnimation
- Animation type for the empty view entrance animation.