unrouter 0.2.0 copy "unrouter: ^0.2.0" to clipboard
unrouter: ^0.2.0 copied to clipboard

A Flutter router that gives you routing flexibility: define routes centrally, scope them to widgets, or mix both - with browser-style history navigation.

0.2.0 #

Breaking Changes #

  • Navigation API refactored: History navigation methods (back(), forward(), go()) are now accessed through navigate property
    • Before: router.back()
    • After: router.navigate.back()
  • Internal reorganization: Removed router_delegate.dart file. The Navigate interface and router delegate logic have been consolidated into router.dart

Features #

  • Link widget: Added declarative navigation with the new Link widget (#5)
    • Simple usage: Link(to: Uri.parse('/about'), child: Text('About'))
    • Advanced usage: Link.builder for custom gesture handling
    • Supports replace and state parameters
    • Automatic mouse cursor (click) and accessibility semantics (link role)
    • Example: Build navigation links without imperative callbacks
  • BuildContext extensions: Added convenient extensions for navigation (#6)
    • Use context.navigate to access navigation methods from any widget
    • Use context.router to access the router instance
    • Example: context.navigate(.parse('/about'))
  • Better error messages: Navigate.of() now throws helpful FlutterError with clear messages when:
    • Called outside a Router scope
    • Router delegate doesn't implement Navigate

Improvements #

  • Changed matchRoutes parameter type from List<Inlet> to Iterable<Inlet> for better flexibility
  • Updated examples to demonstrate new BuildContext extension usage
  • Added comprehensive tests for context navigation features

Migration Guide #

Update your navigation code to use the new API:

// Before
router.back()
router.forward()
router.go(-1)

// After
router.navigate.back()
router.navigate.forward()
router.navigate.go(-1)

// Or use the new BuildContext extension
context.navigate.back()

0.1.1 #

  • Update package description and add pub topics
  • Remove routingkit dependency and format product card
  • Format Dart code with dart format
5
likes
0
points
499
downloads

Publisher

verified publishermedz.dev

Weekly Downloads

A Flutter router that gives you routing flexibility: define routes centrally, scope them to widgets, or mix both - with browser-style history navigation.

Repository (GitHub)
View/report issues

Topics

#router #routing #navigation

License

unknown (license)

Dependencies

flutter, meta, web

More

Packages that depend on unrouter