empty_view 2.1.1 copy "empty_view: ^2.1.1" to clipboard
empty_view: ^2.1.1 copied to clipboard

A powerful Flutter package for displaying beautiful empty state views with animations, Lottie support, presets, shimmer loading, dark mode, and accessibility features.

Changelog #

All notable changes to this project will be documented in this file.

2.1.1 #

Added #

  • Added explicit platform support tags (Android, iOS, Linux, macOS, Web, Windows)

2.1.0 #

This release adds powerful new features while maintaining full backward compatibility with v2.0.

New Features #

Gradient Background Support

  • Added backgroundGradient property to EmptyViewStyle
  • Added backgroundColor property for solid backgrounds
  • Added backgroundBorderRadius for rounded background corners
  • Added backgroundShadow for drop shadows
  • Added EmptyViewStyle.gradient() factory constructor
  • Added hasBackground getter for checking background state

Builder Pattern

  • Added EmptyView.builder() factory constructor for custom layouts
  • Builder receives BuildContext and resolved EmptyViewStyle
  • Enables complex custom designs while keeping styling system

Animation Completion Callback

  • Added onAnimationComplete callback
  • Fires when entrance animation finishes
  • Useful for triggering post-animation actions

Custom Error Widget

  • Added errorWidget property
  • Replaces default error icon with custom widget
  • Supports complex error state designs

4 New Presets

  • permissionDenied - Permission required state (orange lock icon)
  • sessionExpired - Session expired state (red timer icon)
  • emptyTimeline - Empty activity feed state
  • noPaymentMethods - No payment methods state

Performance Improvements

  • Added RepaintBoundary wrapper for animations
  • Reduces unnecessary repaints during animations

Code Quality

  • Added @immutable annotation to EmptyViewStyle
  • Extracted all magic numbers to named constants:
    • EmptyView.defaultIconSize (80.0)
    • EmptyView.defaultErrorIconSize (60.0)
    • EmptyView.defaultAnimationDuration (600ms)
    • EmptyView.defaultRetryDelay (2 seconds)
    • EmptyView.defaultMaxRetries (3)
    • EmptyView.defaultSlideOffset (0.3)
    • EmptyView.defaultScaleFactor (0.8)
    • EmptyView.defaultBounceScaleFactor (0.5)
    • EmptyView.iconBackgroundMultiplier (1.5)
    • EmptyView.loadingIndicatorSize (24.0)
    • EmptyView.defaultButtonFontSize (16.0)
    • EmptyViewStyle.defaultImageWidthFactor (0.5)
    • EmptyViewStyle.defaultImageHeightFactor (0.3)
    • EmptyViewStyle.defaultHorizontalPadding (24.0)
    • EmptyViewStyle.defaultButtonHeight (50.0)
    • And more...

Documentation

  • Added comprehensive dartdoc comments
  • Updated README with v2.1 features
  • Added migration guide

Breaking Changes #

None - fully backward compatible with v2.0.x


2.0.0 #

This is a major release with many new features while maintaining backward compatibility with v1.x.

New Features #

Prebuilt Presets

  • Added EmptyViewPresets class with 12 ready-to-use empty state configurations:
    • noInternet - No internet connection state
    • emptyCart - Empty shopping cart state
    • noSearchResults - No search results state (with searchTerm support)
    • noNotifications - No notifications state
    • noMessages - No messages state
    • noFavorites - No favorites/bookmarks state
    • error - Error state with custom message
    • noData - No data available state
    • locationRequired - Location permission required state
    • maintenance - Under maintenance state
    • noOrders - No orders state
    • noFiles - No files state

Animations

  • Added entrance animations with enableAnimation parameter
  • Added EmptyViewAnimation enum with animation types:
    • none - No animation
    • fadeIn - Fade in effect
    • slideUp - Slide up with fade
    • slideDown - Slide down with fade
    • scale - Scale up with fade
    • bounce - Bounce effect with elastic curve
  • Added animationDuration parameter for custom timing
  • Added animationCurve parameter for custom animation curves

Lottie Animation Support

  • Added lottiePath parameter for Lottie animations
  • Supports both asset files and network URLs
  • Added lottieRepeat and lottieReverse parameters

Shimmer Skeleton Loading

  • Added showShimmer parameter for shimmer effect
  • Added EmptyView.skeleton() factory constructor
  • Added shimmerBaseColor and shimmerHighlightColor parameters
  • Automatic dark mode detection for shimmer colors

Icon Support

  • Added icon parameter for Material icons
  • Added iconColor and iconSize parameters
  • Added showIconBackground for circular background container
  • Added iconBackgroundColor parameter

Secondary Action Button

  • Added secondaryButtonText parameter
  • Added onSecondaryButtonTap callback
  • Added isSecondaryLoading parameter

Retry Logic

  • Added onRetry parameter for automatic retry handling
  • Added maxRetries parameter (default: 3)
  • Added retryDelay parameter (default: 2 seconds)

Platform Adaptive Styling

  • Added adaptive parameter for platform-specific styling
  • Automatic Cupertino buttons on iOS
  • Material buttons on Android

Accessibility

  • Added semanticLabel parameter for custom screen reader labels
  • Automatic semantic labels from title and description

Dark Mode

  • Automatic dark mode detection
  • Theme-aware default colors
  • Added EmptyViewStyle.dark() factory

EmptyViewStyle Enhancements #

New Properties

  • secondaryButtonColor - Secondary button color
  • secondaryButtonTextColor - Secondary button text color
  • darkModeBackgroundColor - Dark mode background
  • darkModeTitleColor - Dark mode title color
  • darkModeDescriptionColor - Dark mode description color
  • descriptionBottomSpacing - Spacing below description
  • buttonSpacing - Spacing between buttons
  • buttonBorderColor - Button border color
  • buttonBorderWidth - Button border width
  • buttonElevation - Button elevation
  • iconSizeFactor - Icon size multiplier
  • iconBackgroundColor - Icon container background
  • iconContainerPadding - Icon container padding

New Factory Constructors

  • EmptyViewStyle.dark() - Dark mode optimized style
  • EmptyViewStyle.minimal() - Minimal spacing style
  • EmptyViewStyle.compact() - Compact style for small spaces
  • EmptyViewStyle.spacious() - Spacious style with more padding
  • EmptyViewStyle.rounded() - Pill-shaped button style

Other Improvements

  • Added == operator and hashCode for equality comparison

Dependencies #

  • Added lottie: ^3.1.0 for Lottie animation support
  • Added shimmer: ^3.0.0 for shimmer skeleton loading

Breaking Changes #

None - fully backward compatible with v1.x


1.0.0 #

  • Initial release
  • Smart image source detection (network, file, SVG, asset)
  • Customizable styling via EmptyViewStyle
  • Action button with loading state support
  • Custom widget support for image and button
  • Responsive design adapts to screen sizes
  • Full documentation and example app
4
likes
160
points
110
downloads

Publisher

unverified uploader

Weekly Downloads

A powerful Flutter package for displaying beautiful empty state views with animations, Lottie support, presets, shimmer loading, dark mode, and accessibility features.

Repository (GitHub)
View/report issues

Topics

#widget #ui #empty-state #placeholder #animation

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_svg, lottie, shimmer

More

Packages that depend on empty_view