Closed rlee1990 closed 1 week ago
@JaspervanRiet is this supported?
I'm sorry, but I don't understand your question. DuckRouter does not use URLs, so path/query params are not relevant to it. I recommend reading the README.
@JaspervanRiet is there a way to pass data then? I read the readme but don't see any reference.
Ah I understand your confusion, the README needs some improvement there. I have made #37 to fix it.
The short answer is, like this:
class DetailScreen extends Location {
const DetailScreen({required this.id});
@override
String get path => 'detail/${id}';
final int id;
@override
LocationBuilder? get builder => (c) {
return DetailScreen(id: id);
};
}
This is one of DuckRouter's most powerful concepts. These are just classes, so you can use any type, as many parameters as you want.
Thanks @JaspervanRiet
I could not find any information on using path params or query params can you help on this?