Skip to content

Commit

Permalink
docs(katana_router_annotation): Maintenance of Comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
mathrunet committed Oct 17, 2022
1 parent ffbd5be commit 09b8f51
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2022 mathru. All rights reserved.

/// Definition of annotation when used in masamune.
/// Define annotations to use the Katana router builder. Build with katana_router_builder using this annotation.
///
/// To use, import `package:katana_router_annotation/katana_router_annotation.dart`.
///
Expand Down
12 changes: 9 additions & 3 deletions packages/katana_router_annotation/lib/src/app_route.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
part of katana_router_annotation;

/// Automatically generates routing for the entire application.
/// アプリケーション全体のルーティングを自動生成します。
///
/// By adding this annotation to the global field as shown in the example below, all pages defined with @PagePath will be automatically defined and routable in the application.
///
/// アプリケーション全体のルーティングを自動生成します。
///
/// 下記の例のようにグローバルのフィールドにこのアノテーションを付与することでアプリケーション内で@PagePathを付与して定義されたすべてのページが自動的に定義されルーティングが可能になります。
///
/// ```dart
Expand All @@ -22,9 +24,11 @@ part of katana_router_annotation;
const appRoute = AppRoute();

/// Automatically generates routing for the entire application.
/// アプリケーション全体のルーティングを自動生成します。
///
/// By adding this annotation to the global field as shown in the example below, all pages defined with @PagePath will be automatically defined and routable in the application.
///
/// アプリケーション全体のルーティングを自動生成します。
///
/// 下記の例のようにグローバルのフィールドにこのアノテーションを付与することでアプリケーション内で@PagePathを付与して定義されたすべてのページが自動的に定義されルーティングが可能になります。
///
/// ```dart
Expand All @@ -42,9 +46,11 @@ const appRoute = AppRoute();
/// ```
class AppRoute {
/// Automatically generates routing for the entire application.
/// アプリケーション全体のルーティングを自動生成します。
///
/// By adding this annotation to the global field as shown in the example below, all pages defined with @PagePath will be automatically defined and routable in the application.
///
/// アプリケーション全体のルーティングを自動生成します。
///
/// 下記の例のようにグローバルのフィールドにこのアノテーションを付与することでアプリケーション内で@PagePathを付与して定義されたすべてのページが自動的に定義されルーティングが可能になります。
///
/// ```dart
Expand Down
19 changes: 14 additions & 5 deletions packages/katana_router_annotation/lib/src/page_param.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
part of katana_router_annotation;

/// Annotation to map each widget parameter to a variable in the page root.
/// 各ウィジェットのパラメーターとページのルートの変数を対応するためのアノテーション。
///
/// The name of the parameter itself, i.e. `userId`, is used.
///
/// 各ウィジェットのパラメーターとページのルートの変数を対応するためのアノテーション。
///
/// パラメーターの名前そのもの、つまり`userId`が利用されます。
///
/// ```dart
Expand All @@ -19,12 +21,15 @@ part of katana_router_annotation;
const pageParam = PageParam();

/// Annotation to map each widget parameter to a variable in the page root.
/// 各ウィジェットのパラメーターとページのルートの変数を対応するためのアノテーション。
///
/// Write `@ParaPathParam(\"user_id\")` as a parameter annotation to link the `user_id` in the path to the class argument `userId` as in the example below.
/// 下記の例のようにパス内の`user_id`をクラス引数の`userId`に紐付けるために`@ParaPathParam("user_id")`をパラメータのアノテーションとして記述します。
///
/// If [name] is set to [Null], the parameter name itself, i.e. `userId`, is used.
///
/// 各ウィジェットのパラメーターとページのルートの変数を対応するためのアノテーション。
///
/// 下記の例のようにパス内の`user_id`をクラス引数の`userId`に紐付けるために`@ParaPathParam("user_id")`をパラメータのアノテーションとして記述します。
///
/// [name][Null]にした場合はパラメーターの名前そのもの、つまり`userId`が利用されます。
///
/// ```dart
Expand All @@ -39,12 +44,15 @@ const pageParam = PageParam();
/// ```
class PageParam {
/// Annotation to map each widget parameter to a variable in the page root.
/// 各ウィジェットのパラメーターとページのルートの変数を対応するためのアノテーション。
///
/// Write `@ParaPathParam(\"user_id\")` as a parameter annotation to link the `user_id` in the path to the class argument `userId` as in the example below.
/// 下記の例のようにパス内の`user_id`をクラス引数の`userId`に紐付けるために`@ParaPathParam("user_id")`をパラメータのアノテーションとして記述します。
///
/// If [name] is set to [Null], the parameter name itself, i.e. `userId`, is used.
///
/// 各ウィジェットのパラメーターとページのルートの変数を対応するためのアノテーション。
///
/// 下記の例のようにパス内の`user_id`をクラス引数の`userId`に紐付けるために`@ParaPathParam("user_id")`をパラメータのアノテーションとして記述します。
///
/// [name][Null]にした場合はパラメーターの名前そのもの、つまり`userId`が利用されます。
///
/// ```dart
Expand All @@ -60,6 +68,7 @@ class PageParam {
const PageParam([this.name]);

/// Name of parameter.
///
/// パラメータの名前。
final String? name;
}
22 changes: 16 additions & 6 deletions packages/katana_router_annotation/lib/src/page_path.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
part of katana_router_annotation;

/// Annotation defining the page.
/// ページを定義するアノテーション。
///
/// Specify the path of the page in [path] as it is.
/// [path]にページのパスをそのまま指定します。
///
/// When [redirect] is set, it is possible to write reroute settings for only that page.
///
/// ページを定義するアノテーション。
///
/// [path]にページのパスをそのまま指定します。
///
/// [redirect]を設定するとそのページのみに対応するリルート設定を記述することが可能です。
///
/// ```dart
Expand All @@ -23,12 +26,15 @@ part of katana_router_annotation;
/// ```
class PagePath {
/// Annotation defining the page.
/// ページを定義するアノテーション。
///
/// Specify the path of the page in [path] as it is.
/// [path]にページのパスをそのまま指定します。
///
/// When [redirect] is set, it is possible to write reroute settings for only that page.
///
/// ページを定義するアノテーション。
///
/// [path]にページのパスをそのまま指定します。
///
/// [redirect]を設定するとそのページのみに対応するリルート設定を記述することが可能です。
///
/// ```dart
Expand All @@ -49,16 +55,20 @@ class PagePath {
});

/// Page path.
///
/// ページパス。
final String path;

/// Reroute settings.
/// リルート設定。
///
/// When [redirect] is set, it is possible to write reroute settings for only that page.
/// [redirect]を設定するとそのページのみに対応するリルート設定を記述することが可能です。
///
/// Only `RerouteQuery` and classes that extend it are used by the builder.
///
/// リルート設定。
///
/// [redirect]を設定するとそのページのみに対応するリルート設定を記述することが可能です。
///
/// `RerouteQuery`とそれを継承したクラスのみがbuilderで利用されます。
final List<Object> redirect;
}
21 changes: 15 additions & 6 deletions packages/katana_router_annotation/lib/src/page_query.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
part of katana_router_annotation;

/// Annotation to define the `RouteQuery` of the page.
/// ページの`RouteQuery`を定義するためのアノテーション。
///
/// Be sure to define it in the `static const` field.
/// 必ず`static const`のフィールドに定義してください。
///
/// By doing so, pages with annotations are defined in the routing object for all pages defined in [AppRoute].
///
/// ページの`RouteQuery`を定義するためのアノテーション。
///
/// 必ず`static const`のフィールドに定義してください。
///
/// こうすることにより[AppRoute]で定義した全ページのルーティングオブジェクトにアノテーションを付与したページが定義されます。
///
/// ```dart
Expand All @@ -26,12 +29,15 @@ part of katana_router_annotation;
const pageRouteQuery = PageRouteQuery();

/// Annotation to define the `RouteQuery` of the page.
/// ページの`RouteQuery`を定義するためのアノテーション。
///
/// Be sure to define it in the `static const` field.
/// 必ず`static const`のフィールドに定義してください。
///
/// By doing so, pages with annotations are defined in the routing object for all pages defined in [AppRoute].
///
/// ページの`RouteQuery`を定義するためのアノテーション。
///
/// 必ず`static const`のフィールドに定義してください。
///
/// こうすることにより[AppRoute]で定義した全ページのルーティングオブジェクトにアノテーションを付与したページが定義されます。
///
/// ```dart
Expand All @@ -50,12 +56,15 @@ const pageRouteQuery = PageRouteQuery();
/// ```
class PageRouteQuery {
/// Annotation to define the `RouteQuery` of the page.
/// ページの`RouteQuery`を定義するためのアノテーション。
///
/// Be sure to define it in the `static const` field.
/// 必ず`static const`のフィールドに定義してください。
///
/// By doing so, pages with annotations are defined in the routing object for all pages defined in [AppRoute].
///
/// ページの`RouteQuery`を定義するためのアノテーション。
///
/// 必ず`static const`のフィールドに定義してください。
///
/// こうすることにより[AppRoute]で定義した全ページのルーティングオブジェクトにアノテーションを付与したページが定義されます。
///
/// ```dart
Expand Down

0 comments on commit 09b8f51

Please sign in to comment.