flutter_declarative_popups 1.0.0
flutter_declarative_popups: ^1.0.0 copied to clipboard
Declarative popup routes for Navigator 2.0. Material, Cupertino, and custom popup pages with type-safe navigation and state restoration.
Changelog #
1.0.0 - 2026-05-20 #
First stable release. The Cupertino sheet implementation has been
rewritten on top of the new Flutter 3.44 CupertinoSheetRoute API, and
the public surface has been trimmed before semver locks it in.
Breaking changes #
- Raised the minimum SDK requirements to Flutter 3.44.0 and Dart 3.12.0.
CupertinoSheetPage.builderis now nullable becausescrollableBuildercan be supplied instead. At least one of the two must be non-null.CupertinoSheetPage.showDragHandleand the matching extension helper parameters are now non-nullable booleans that default tofalse.- Removed
CupertinoSheetPage.topGapRatio; usetopGapinstead. - Removed
CupertinoSheetPage.onWillPop. UsePage.canPopandPage.onPopInvokedfrom the superclass to gate sheet dismissal. - Removed
CupertinoSheetPageroute override parameterstransitionDuration,barrierColor,barrierDismissible, andbarrierLabel. Consumers that need them should wrapCupertinoSheetRoutedirectly. - Removed
CupertinoDialogOverlayandCupertinoModalPopupOverlaywidgets. Add the correspondingCupertinoDialogPage/CupertinoModalPopupPageto your navigator instead. CupertinoSheetPage.onBarrierTapnow replaces the default pop behavior (matchingCupertinoDialogPageandCupertinoModalPopupPage) instead of running alongside it. Callbacks that previously expected the sheet to also pop must now callNavigator.popexplicitly.CupertinoSheetPage._applyCustomizationsno longer wraps content inMaterial. Content is wrapped inDecoratedBox+ClipPathwhenbackgroundColororshapeis supplied. Callers relying on Material ink/elevation inside the sheet need to add their ownMaterialwidget.
Additions #
- Added
CupertinoSheetPage.scrollableBuilderand wired it to Flutter's nativeCupertinoSheetRoute.scrollableBuilderfor coordinated scroll-to-dismiss behavior. - Delegated Cupertino sheet
showDragHandleandtopGapbehavior to Flutter's nativeCupertinoSheetRoute. - Added
scrollableBuilder,topGap,key,name, andargumentspassthroughs toNavigatorState.showCupertinoSheet. - Added
scrollableBuilderandtopGappassthroughs toBuildContext.createCupertinoSheetPage.
Notes #
- Flutter 3.44's
Navigatorchange (flutter/flutter#182315) removes pages fromNavigator.pagesbefore the underlying route is disposed. Apps that mirror sheet state inonDidRemovePagewill see callbacks fire earlier than before, but no code change is needed for the README examples.
Migrating from 0.3.x #
| 0.3.x | 1.0.0 |
|---|---|
CupertinoSheetPage.topGapRatio: 0.2 |
CupertinoSheetPage.topGap: 0.2 |
CupertinoSheetPage(onWillPop: ...) |
CupertinoSheetPage(canPop: false, onPopInvoked: ...) |
CupertinoSheetPage(transitionDuration / barrierColor / barrierDismissible / barrierLabel: ...) |
Wrap CupertinoSheetRoute directly |
CupertinoDialogOverlay widget |
CupertinoDialogPage in Navigator.pages |
CupertinoModalPopupOverlay widget |
CupertinoModalPopupPage in Navigator.pages |
onBarrierTap: () => doX(); // sheet also pops |
onBarrierTap: () { doX(); Navigator.pop(context); } |
0.3.3 - 2026-02-17 #
- Fixed GitHub Actions publish flow to use the official pub.dev trusted publisher OIDC workflow.
- No public API changes.
0.3.2 - 2026-02-17 #
- Maintenance release to publish through the updated GitHub release pipeline.
- No public API changes.
0.3.1 - 2026-02-17 #
- Added compatibility updates for newer Flutter SDKs:
- Updated
CupertinoSheetPageinternals to align with latestCupertinoSheetRouteAPI changes. - Kept custom sheet top gap behavior wired through the SDK route API.
- Updated
- Added
Pagepop lifecycle passthrough support across popup pages via:canPoponPopInvoked
- Migrated Navigator 2 example and docs away from deprecated
onPopPagetoonDidRemovePage. - Improved popup result handling in the Navigator 2 example using
onPopInvokedplus route removal callbacks.
0.3.0 - 2025-08-16 #
- Enhanced CupertinoSheetPage documentation with important drag-to-dismiss behavior warnings for nested navigators.
- Updated example app to use go_router for modern declarative navigation patterns.
0.2.0 - 2025-06-04 #
- Added CupertinoDialogPage - Declarative alternative to
showCupertinoDialog- Full iOS-style dialog support with fade and scale animations
- Custom barrier tap handling with
onBarrierTapcallback - Semantic hints for accessibility with
barrierOnTapHint - Customizable transition duration and animations
- Complete integration with Navigator 2.0
0.1.0 - 2025-06-04 #
Initial Release #
-
Material Design Pages
DialogPage- Declarative alternative toshowDialogModalBottomSheetPage- Declarative alternative toshowModalBottomSheet
-
Cupertino (iOS) Pages
CupertinoModalPopupPage- Declarative alternative toshowCupertinoModalPopupCupertinoSheetPage- iOS-style sheet presentations
-
Custom/Raw Pages
RawDialogPage- Base implementation for custom popup routes
-
Features
- Full Navigator 2.0 support
- Type-safe with generics
- State restoration support
- Nested navigation support
- Custom animations and transitions
- Barrier customization
- go_router compatibility
-
Developer Experience
- Comprehensive documentation
- Extension methods for convenient navigation
- Rich example application
- Full API documentation