utills 2.0.2
utills: ^2.0.2 copied to clipboard
A comprehensive Flutter utility package providing layout gaps, form validators, a generic API handler, and a scroll-ready paginator.
2.0.2 #
✨ Added #
KeepAliveWrapper
- Added
KeepAliveWrapperfor preserving widget state insidePageView,TabBarView, andIndexedStackchildren.
SlideInAnimation
- Added
SlideInAnimationwith configurableduration,offset,direction, andcurvefor easy entrance animations.
🔧 Updated #
- Exported
src/keep_alive.dartandsrc/slide_animation.dartfromlib/utills.dart. - Updated documentation and examples for the new widget helpers.
- Added optional
String? tagsupport tomapStatusCodeToFailure()for improved contextual logs and easier failure tracing.
2.0.1 #
✨ Updated #
CustomToast
- Reworked toast display to use a Navigator overlay instead of ScaffoldMessenger snack bars.
- Added animated toast presentation with fade, slide, and size transitions.
- Added
ToastPositionsupport for top and bottom placement. - Added close action, automatic removal, and stacked toast handling.
- Updated initialization to use
GlobalKey<NavigatorState>throughCustomToast.init(). - Updated public usage to
CustomToast.show().
Navigator
- Added
NavDirectionfor directional slide transitions. - Updated
Navigate.push()with optionaldirectionanddurationparameters. - Kept existing helpers for
pushReplacement,pushAndRemoveUntil, andpop.
Documentation
- Updated README examples for the new toast and navigation APIs.
- Added a pub.dev example file so the Example tab can show package usage.
2.0.0 #
🚀 Initial Release #
Utills - A comprehensive Flutter utility package designed to accelerate development with battle-tested, reusable components.
✨ Features
1. Gaps (UI Spacing Utilities)
- Pre-defined spacing constants for consistent UI layouts
- Easy-to-use gap widgets for vertical and horizontal spacing
- Follows Flutter Material Design spacing guidelines
2. Validators (Form Validation)
- Email validation
- Password validation with strength requirements
- Phone number validation
- Text field validators for common use cases
- Custom validation messages for user feedback
3. API Handler & Failure Handling
- Structured failure types using sealed classes
- Type-safe API response handling
- Built-in error mapping and categorization
- Support for network, server, and client errors
4. Paginator
- Efficient pagination management
- Handles page offset and limit calculations
- Supports infinite scroll patterns
- Zero external dependencies
5. Log
- Developer-friendly, colorized console output for debugging
- Automatic no-op behavior in release builds for production safety
- Structured log levels: success, error, info, warn, and trace
- Direct support for object and data structure inspection
- Streamlined replacement for standard print() or debugPrint()
6. CustomToast
- Decoupled architecture requiring no BuildContext
- Support for success, error, and warning states
- Configurable global theme for colors, styling, and duration
- Automatic management of multiple active toast messages
- Clean, drop-in replacement for standard SnackBar implementation
7. Navigator
- Simplified routing via push, pushReplacement, and pushAndRemoveUntil
- Decoupled, context-aware navigation management
- Generic support for typed route results
- Elimination of MaterialPageRoute boilerplate code
- Streamlined stack management for common app flows like Login/Logout
🎯 Key Benefits
- ✅ Type-safe with null safety
- ✅ Zero external dependencies (Flutter only)
- ✅ Fully documented API
- ✅ Lightweight and performant
- ✅ Production-ready code
📝 Notes
- Requires Flutter 3.0.0 or higher
- Requires Dart SDK 3.10.0 or higher
- Compatible with both Android, iOS, Web, and other Flutter platforms