Skip to content

Commit

Permalink
Add useQueryParams usage example in README
Browse files Browse the repository at this point in the history
  • Loading branch information
mixinDennisBarzanoffMixin committed Feb 18, 2025
1 parent 44ba4aa commit 5987bbc
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions routable_builder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,26 @@ class ProductPage extends StatelessWidget {
Routes.product.push(context, Product(id: 'item_id'));
```

```dart
@Routable(path: '/search', useQueryParams: true)
class SearchPage extends StatelessWidget {
final Map<String, String>? queryParams;
SearchPage({this.queryParams});
...
}
// Generated GoRoute for SearchPage
GoRoute(
path: '/search',
pageBuilder: (context, state) => MaterialPage(
child: SearchPage(queryParams: state.uri.queryParameters),
),
),
```


## Contributing

Contributions are welcome! Please open an issue or submit a pull request.
Expand Down

0 comments on commit 5987bbc

Please sign in to comment.