smart_state_handler 1.0.1 copy "smart_state_handler: ^1.0.1" to clipboard
smart_state_handler: ^1.0.1 copied to clipboard

A comprehensive Flutter widget for handling all UI states (loading, error, success, empty, offline) with animations, overlay mode, pagination, and extensive customization options.

Changelog #

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

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

1.0.1 - 2025-10-04 #

Added #

  • Initial release of SmartStateHandler
  • Support for 7 UI states: initial, loading, error, empty, offline, success, loadingMore
  • Extension methods for convenient state checking (.isLoading, .isError, etc.)
  • Smooth animations between state transitions with 9 animation types:
    • fade, slide, slideLeft, slideRight, scale, rotate, bounce, elastic, none
  • Overlay mode for forms and non-intrusive state changes
  • Custom animation configurations for both content and overlay transitions
  • Pull-to-refresh functionality
  • Automatic pagination support with debouncing
  • Custom icon support for all states
  • Text configuration object for easy customization
  • Widget configuration object for complete UI control
  • Debug mode with comprehensive logging
  • Custom builders for all states
  • Type-safe generic data handling
  • Comprehensive unit tests with 43+ test cases
  • Complete example application demonstrating all features

Features #

State Management

  • Single SmartState enum instead of multiple boolean flags
  • Type-safe generic support
  • Extension methods for readable state checking
  • Debug logging for development

UI Features

  • Initial state support for forms and user-triggered operations
  • Overlay mode with separate animation configurations
  • Multiple animation types with customizable curves and durations
  • Widget memoization for performance optimization
  • Custom icons for loading, error, empty, and offline states
  • Contextual loading messages
  • Pull-to-refresh integration
  • Auto-scroll pagination with configurable threshold
  • Debounced pagination to prevent double-triggers

Customization

  • SmartStateAnimationConfig for animation customization
  • SmartStateTextConfig for text content customization
  • SmartStateWidgetConfig for complete widget replacement
  • Custom builders for all states
  • Separate overlay builders for overlay mode
  • Container styling options (background color, padding, margin)
  • Custom transition builders

Developer Experience

  • Clean, readable API
  • Extensive documentation with examples
  • Comprehensive test coverage
  • Example app with both list and form demos
  • Proper error handling and fallbacks

Documentation #

  • Comprehensive README with installation instructions
  • Quick start guide
  • Multiple usage examples
  • Integration guides for GetX, Provider, BLoC
  • Animation showcase
  • Best practices section
  • Migration guide
1
likes
150
points
27
downloads

Publisher

unverified uploader

Weekly Downloads

A comprehensive Flutter widget for handling all UI states (loading, error, success, empty, offline) with animations, overlay mode, pagination, and extensive customization options.

Repository (GitHub)
View/report issues

Topics

#state-management #ui #widget #flutter-package #animations

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on smart_state_handler