Skip to content

Commit

Permalink
version: v4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
medz committed Sep 8, 2024
1 parent 1fbcb5c commit 1f3df61
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 14 deletions.
20 changes: 18 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## v3.0.3
## v4.0.0

* **fix**: Index out of range: no indices are valid
[compare changes](https://github.com/medz/routingkit/compare/v3.0.3...v4.0.0)

### 🩹 Fixes

- Find all ([7d1e06b](https://github.com/medz/routingkit/commit/7d1e06b))

### 💅 Refactors

- Done ([245ff49](https://github.com/medz/routingkit/commit/245ff49))

### ✅ Tests

- - ([1fbcb5c](https://github.com/medz/routingkit/commit/1fbcb5c))

### ❤️ Contributors

- Seven Du <[email protected]>
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,35 +31,35 @@ flutter pub add routingkit
### Create a router instance and insert routes

```dart
import from "routingkit";
import "routingkit";
const router = createRouter();
router.add('get', '/path', 'Static path');
router.add('get', '/path/:name', 'Param route');
router.add('get', '/path/*', 'Unnamed param route');
router.add('get', '/path/**', 'Wildcard Route');
router.add('get', '/path/**:rset', 'Named wildcard route');
router.add('get', '/files/:dir/:filename.:format,v:version', 'Mixed Route');
addRoute(router, 'get', '/path', 'Static path');
addRoute(router, 'get', '/path/:name', 'Param route');
addRoute(router, 'get', '/path/*', 'Unnamed param route');
addRoute(router, 'get', '/path/**', 'Wildcard Route');
addRoute(router, 'get', '/path/**:rset', 'Named wildcard route');
addRoute(router, 'get', '/files/:dir/:filename.:format,v:version', 'Mixed Route');
```

### Match route to access matched data

```dart
// {data: Static path}
router.find('get', '/path')
findRoute(router, 'get', '/path')
// {data: Param route, params: {name: seven}}
router.find('get', '/path/seven')
findRoute(router, 'get', '/path/seven')
// {data: Wildcard Route, params: {_: foo/bar/baz}}
router.find('get', '/path/foo/bar/baz')
findRoute(router, 'get', '/path/foo/bar/baz')
// {data: Mixed Route, params: {dir: dart, filename: pubspec, format: yaml, version: 1}}
router.find('get', '/files/dart/pubspec.yaml,v1')
findRoute(router, 'get', '/files/dart/pubspec.yaml,v1')
// `null`, No match.
router.find('get', '/')
findRoute(router, 'get', '/')
```

## License
Expand Down

0 comments on commit 1f3df61

Please sign in to comment.