riverpod_sugar 1.0.0
riverpod_sugar: ^1.0.0 copied to clipboard
Essential Flutter widgets and utilities for flutter_riverpod. Includes RxWidget, AsyncValue helpers, form validation, and debouncing tools to reduce boilerplate code.
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.0 - 2025-07-31 #
🎉 Initial Release #
Added
-
Core Widgets
RxWidget- Simplified ConsumerWidget with cleaner build methodRxStatefulWidget&RxState- Stateful equivalent of RxWidgetRxBuilder- Inline reactive widget builderRxShow- Conditional rendering based on provider state
-
AsyncValue Extensions
AsyncValueSugar.easyWhen()- Simplified async state handlingAsyncValueX.mapData()- Transform data while preserving async stateAsyncValueX.hasDataWhere()- Check conditions on async dataAsyncValueX.dataOrNull- Safe data access- Convenience getters:
hasData,isLoading,hasError,errorOrNull
-
Form Management
FormManager- StateNotifier for form validationFormState- Immutable form state with error trackingCommonValidators- Pre-built validation functions:required()minLength()/maxLength()email()pattern()range()matches()combine()- Combine multiple validators
-
Utilities
Debouncer- Simple input debouncingAdvancedDebouncer- Advanced debouncing with leading/trailing optionsProviderCombiners- Combine multiple providers:combine2(),combine3(),combine4()combineList()map(),where()
AsyncProviderCombiners- Combine AsyncValue providers intelligently
-
Extensions
- Provider extension methods for fluent API
- AsyncValue utility extensions
Documentation
- Comprehensive README with examples
- API documentation for all public members
- Complete example app demonstrating all features
- Migration guide from standard Riverpod
Testing
- Full test coverage for all components
- Example tests for common use cases
Technical Details #
- Dart SDK:
>=3.0.0 <4.0.0 - Flutter:
>=3.10.0 - Dependencies:
flutter_riverpod ^2.4.9 - Null Safety: ✅ Complete null safety support
- Platforms: All Flutter platforms supported
Future Releases #
1.1.0 Planned Features #
RxListView- Reactive list widget with loading statesRxAnimatedSwitcher- Animated transitions between provider states- Navigation helpers for provider-aware routing
- Performance optimization widgets
- Additional common validators
1.2.0 Advanced Features #
- DevTools integration for better debugging
- Code generation macros for providers
- Testing utilities and mock helpers
- Advanced caching strategies
- Background task management
Migration Notes #
From flutter_riverpod to riverpod_sugar #
This package is designed to be a drop-in enhancement to flutter_riverpod:
- No Breaking Changes: All existing riverpod code continues to work
- Gradual Adoption: Migrate widgets one at a time
- Zero Runtime Overhead: Sugar syntax compiles to standard riverpod calls
- Full Interoperability: Mix and match with existing ConsumerWidget code
Version Compatibility #
| riverpod_sugar | flutter_riverpod | Flutter | Dart |
|---|---|---|---|
| 1.0.0 | ^2.4.9 | >=3.10.0 | >=3.0.0 |
Contributing #
We welcome contributions! Please see our Contributing Guide for details.