tp_router 0.6.2
tp_router: ^0.6.2 copied to clipboard
A simplified Flutter router based on go_router with annotation support.
0.6.2 #
- Fix: Relaxed
getExtra<T>type checking to supportMap<String, dynamic>where the value matches typeT. - Fix: Re-added missing
go_routerdependency.
0.6.1 #
- Refactor: Internal overhaul of
TpRouteDatato useGoRouterStateDatadirectly, improving performance and reducing object creation. - Refactor: Split
createTpPageconfiguration intoTpPageConfigfor better maintainability. - Refactor: Standardized redirect logic to consistently use
GoRouterStateData. - Fix: Unified redirect handling across
TpRouteInfoandTpRouter.
0.6.0 #
- Breaking Change:
TpRouterconstructor now prioritizes theconfigobject if provided.redirectparameters must now beFutureOrcompatible. - Feature: Added
context.tpRouterextension for context-aware navigation and popping. - Feature:
TpStatefulNavigationShell.tp()now includes bounds checking for safer branch switching. - Fix: Resolved
TpRouteObservermemory leak by resetting state on Navigator changes. - Fix: Logic improvements for
popUntilandremoveWhere. - Docs: Comprehensive documentation update including new "Core Concepts" and "Little Red Book" style Chinese docs.
0.5.1 #
- Docs: Complete rewrite of
README.mdwith comprehensive TOC and advanced usage guide. - Docs: Rewrote
README_zh.mdin casual style with full feature coverage. - Docs: Added Page Configuration section covering
TpPageType, dialog/modal options, transparent pages, observers. - Docs: Added Reactive Routing section explaining
refreshListenablefor login/logout flows. - Docs: Fixed
@Pathand@Queryannotation examples (annotations go on final fields, not constructor params). - Fix: Added explicit version constraint
^0.5.0fortp_router_annotation. - Fix: Replaced deprecated
withOpacitywithwithValuesinSwipeBackWrapper.
0.5.0 #
- Breaking Change: Removed
goBranchmethod. Renamed totp(index)inTpStatefulNavigationShell. - Breaking Change:
TpRouter.tp()no longer acceptsnavigatorKeyorcontext. UseNavKeyfor route definition/linking only. - Feature: Added
pop()andcanPopmethods toTpNavKey(and subclasses) for convenient popping of specific navigators from anywhere. - Refactor: Simplified route definition by removing
branchIndexparameter (inferred automatically).
0.4.1 #
- Fix: Improved
didReplacelogic inTpRouteObserverto correctly handle route replacements and maintain proper synchronization with the internal route list. - Fix:
allRouteDatagetter now returns aMap<Route, TpRouteData>sorted by the route's position in the navigation stack (bottom to top). - Fix: Simplified
popandcanPopmethods to directly useNavigatorstate. - Fix: Refactored
removeRouteto handle edge cases when the route to be removed is the current route. - API: The
locationgetter now returns aTpRouteDataobject instead of a rawStringpath, providing structured route information viafullPath.
0.4.0 #
- Type-Safe NavKeys: Introduced
TpNavKeyclass for strong-typed navigator keys. Deprecated usage of raw Strings for navigator keys in favor ofTpNavKeysubclasses. - Security: Enhanced
TpRouter.tp()to enforce mutual exclusivity betweencontextandnavigatorKey.
0.3.0 #
- 🔄 Breaking Change: Class-based Callbacks
- Refactored
onExitandredirectin@TpRouteto use a class-based approach. Users now implementTpOnExit<T>andTpRedirect<T>interfaces. - Annotation parameters
onExitandredirectnow acceptType.
- Refactored
- 🛠️ Improvements: Type Safety & Reconstruction
- Added
static T fromData(TpRouteData)to generated route classes for safe reconstruction of strongly-typed route objects. - The generated
redirectandonExitcallbacks now automatically usefromDatato ensure provide a valid typed instance, even if navigated via raw path orfromPath.
- Added
- ** PREMIUM Experience: Swipe Back**
- Improved
TpPageType.swipeBackwith full-screen gesture support (by default). - Added smooth shadow animations and conflict detection (ignores swipe if child scrolls horizontal).
- Improved
- 🐚 Shell Route Cleanup
- Removed transition configuration from
@TpShellRoute. Shells now useTpNoTransitionby default to avoid redundant animations.
- Removed transition configuration from
- 📝 API Refinement
- Made
TpRouteData.routeNamenullable to better represent unnamed routes. - Updated
removeRoutelogic to gracefully handle unnamed routes.
- Made
0.2.0 #
- ✨ New Features: Smart Route Removal
- Added
context.tpRouter.removeRoute()andremoveWhere(). - Pinpoint Deletion: Remove routes from specific navigators using
navigatorKeyorcontextscope. - Pending Pop Strategy: Implemented "Smart Remove" to safely delete go_router pages (including background pages) without crashing, by auto-skipping them on back navigation.
- Robust handling of route updates and memory cleanup via enhanced
TpRouteObserver.
- Added
0.1.1 #
- Updated go_router dependency to ^17.0.1.
- Documentation improvements and bug fixes.
0.1.0 #
- Changed
TpRouteData.extratype fromMap<String, dynamic>todynamicfor flexibility. - Improved type handling for complex extra parameters.
0.0.2 #
- update doc
0.0.1 #
- Initial release.
- Core routing logic based on
go_router. - Support for
TpRouteDataand generated route classes. - Type-safe navigation API (
.tp()). - Support for parameter extraction from Path, Query, and Extra.
- Comprehensive route guard/redirect system using
TpRedirect. - Nested navigation support via
ShellRoute. - Support for global and per-route transition configuration.