pageRouteQuery top-level constant

PageRouteQuery const pageRouteQuery

Annotation to define the RouteQuery of the page.

Be sure to define it in the static const field.

By doing so, pages with annotations are defined in the routing object for all pages defined in AppRoute.

ページのRouteQueryを定義するためのアノテーション。

必ずstatic constのフィールドに定義してください。

こうすることによりAppRouteで定義した全ページのルーティングオブジェクトにアノテーションを付与したページが定義されます。

@PagePath("/test")
class Test extends StatelessWidget {
  const Test();

  @pageRouteQuery
  static const query = _$Test;

  @override
  Widget build(BuildContext context){
    //~~~~
  }
}

Implementation

const pageRouteQuery = PageRouteQuery();