flutter_navkit 0.0.6
flutter_navkit: ^0.0.6 copied to clipboard
A powerful navigation toolkit for Flutter with type-safe routing, automatic route generation, and comprehensive navigation observability.
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.
0.0.6 #
🎉 Initial Release #
✨ Features
- NavkitApp Widget - Drop-in replacement for MaterialApp with built-in navigation observer
- Automatic Route Generation - Use
@NavkitRoute()annotation to auto-generate type-safe route constants - NavkitObserver - Comprehensive navigation tracking with:
- Route stack visualization in debug mode
- Beautiful console logging with emojis (➡️ Push, ⬅️ Pop, 🔄 Remove, 🔀 Replace)
hasRoute()method to check if routes exist in the stack- Optional stack printing control via
observeWithStackparameter
🚀 Navigation Extensions
Normal Navigation (Widget-Based):
context.push()- Push a new screencontext.pushReplacementTo()- Replace current screencontext.pushAndRemoveAll()- Clear stack and pushcontext.pop()- Pop current screencontext.popToFirst()- Pop to initial routecontext.maybePop()- Safely attempt to popcontext.canPop- Check if can pop
Named Navigation (Route-Based):
context.pushRoute()- Push named routecontext.pushReplacementRoute()- Replace with named routecontext.popAndPushRoute()- Pop and push in one actioncontext.pushAndRemoveAllRoute()- Clear stack and push named routecontext.popTo()- Pop to specific named routecontext.tryPushRoute()- Safe push with route existence checkcontext.tryPopTo()- Safe pop with route existence check
🔧 Code Generation
- @NavkitRoute Annotation - Mark widgets for automatic route generation
- Custom Route Names - Override default naming with
routeNameparameter - NavkitRoutes Class - Auto-generated static constants for all routes
- Build Runner Integration - Seamless integration with Flutter's build system
📦 Package Structure
NavkitApp- Main app widget with automatic observer injectionNavkitObserver- Navigation observer for tracking and debugging@NavkitRoute- Annotation for route generation- Extension methods on
BuildContextfor clean navigation API
🎯 Developer Experience
- Type-safe navigation with IDE autocomplete
- Zero boilerplate route management
- Intuitive API matching Flutter conventions
- Comprehensive debug logging
- Full Flutter navigation system compatibility
📚 Documentation
- Complete README with quick start guide
- API reference documentation
- Working example application
- Usage examples for all features