dupe_modal_bottom_sheet 1.0.0
dupe_modal_bottom_sheet: ^1.0.0 copied to clipboard
A customizable bottom sheet with Hero animation support, implementing all features of showModalBottomSheet.
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 - 2026-02-11 #
🎉 Initial Release #
First stable release of dupe_modal_bottom_sheet - a Flutter package that brings Hero animation support to modal bottom sheets while maintaining 100% API compatibility with Flutter's standard showModalBottomSheet.
✨ Features #
Core Functionality
showDupeModalBottomSheetfunction - Drop-in replacement forshowModalBottomSheet- Complete API compatibility with all standard parameters
- Zero breaking changes for migration
- Works seamlessly with existing codebases
Hero Animation Support
- Native Hero animations in modal bottom sheets
- Smooth shared element transitions
- Proper positioning during Hero flight phase
- Works with complex animations including image galleries
- Custom
PageRouteimplementation for accurate target positioning
Styling & Customization
- Background color, elevation, and shape customization
- Material 3 surface tint color support
- Custom border shapes with clip behavior
- Additional size constraints via
BoxConstraints
User Interaction
- Drag to dismiss functionality
- Optional drag handle indicator
- Customizable barrier (color, dismissible, semantic labels)
- Full accessibility support with screen readers
Layout & Sizing
- Scroll-controlled mode for full-height expansion
- Configurable height ratio (default 9/16 screen height)
- Safe area awareness and padding support
- Display feature compatibility (foldable screens, hinges)
Animation System
- Custom animation styles (duration, curve)
- External animation controller support
- Smooth slide transitions with drag tracking
- Default animations: 250ms open, 200ms close
Developer Experience
- 100% test coverage - 11 comprehensive test cases
- Complete documentation - DartDoc comments on all APIs
- Example app - Interactive gallery showcasing all features
- Migration guide - Seamless transition from standard modal sheets
📝 Technical Details #
Implementation:
- Custom
DupeModalBottomSheetRoute<T>extendingPageRoute<T> - Content alignment during build phase (not transition phase)
- Optimized with
RepaintBoundaryfor better performance - Separate layout widget for clean separation of concerns
Compatibility:
- Flutter SDK:
>=3.0.0 - Dart SDK:
>=3.0.0 <4.0.0 - iOS & Android platforms
- Material 3 design system
🐛 Known Issues #
None at this time.
📚 Documentation #
- Complete README with usage examples
- API reference documentation
- Migration guide from
showModalBottomSheet - Example application in
/exampledirectory
💡 Why This Package? #
Flutter's built-in showModalBottomSheet uses ModalRoute, which doesn't properly support Hero animations due to timing issues in the animation system. This package solves that by using a custom PageRoute that aligns content during the buildPage phase, allowing the Hero system to correctly calculate widget positions and create smooth transitions.
Full Changelog: https://github.com/yourusername/dupe_modal_bottom_sheet/commits/v1.0.0