ZenRouter File Annotation
Shared annotations and structure for zenrouter file-based routing.
This package contains the annotations (@ZenRoute, @ZenLayout, @ZenCoordinator) and helper classes used by the zenrouter_file_generator to generate type-safe routes.
Installation
This package is usually added automatically when using zenrouter_file_generator.
dependencies:
zenrouter_file_annotation: ^0.4.5
dev_dependencies:
zenrouter_file_generator: ^0.4.5
Usage
Use these annotations to define your routes and layouts:
import 'package:zenrouter_file_annotation/zenrouter_file_annotation.dart';
@ZenRoute()
class MyRoute extends _$MyRoute { ... }
@ZenLayout(type: LayoutType.stack)
class MyLayout extends _$MyLayout { ... }
// With query parameters
@ZenRoute(queries: ['search', 'page'])
class SearchRoute extends _$SearchRoute { ... }
See zenrouter_file_generator for complete documentation and usage examples.