Skip to content

Commit

Permalink
feat(katana_router_annotation): Added NestedPage.
Browse files Browse the repository at this point in the history
  • Loading branch information
mathrunet committed Oct 18, 2022
1 parent 5928620 commit 8c14f68
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 1 deletion.
93 changes: 93 additions & 0 deletions packages/katana_router_annotation/lib/src/page_path.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,96 @@ class PagePath {
/// `RerouteQuery`とそれを継承したクラスのみがbuilderで利用されます。
final List<Object> redirect;
}

/// Pages for use in nested navigators rather than at the top level.
///
/// If used with this, it will not be accessible via deep linking.
///
/// When [redirect] is set, it is possible to write reroute settings that correspond only to that page.
///
/// トップレベルではなくネストされたナビゲーターで用いるためのページ。
///
/// これで使用した場合、ディープリンクでのアクセスができなくなります。
///
/// [redirect]を設定するとそのページのみに対応するリルート設定を記述することが可能です。
///
/// ```dart
/// @NestedPage()
/// class TestWidget extends StatelessWidget {
/// @override
/// Widget build(BuildContext context) {
/// return Scaffold(
/// appBar: AppBar(title: Text("Test")),
/// body: Center(child: Text("Body")),
/// );
/// }
/// }
/// ```
const nestedPage = NestedPage();

/// Pages for use in nested navigators rather than at the top level.
///
/// If used with this, it will not be accessible via deep linking.
///
/// When [redirect] is set, it is possible to write reroute settings that correspond only to that page.
///
/// トップレベルではなくネストされたナビゲーターで用いるためのページ。
///
/// これで使用した場合、ディープリンクでのアクセスができなくなります。
///
/// [redirect]を設定するとそのページのみに対応するリルート設定を記述することが可能です。
///
/// ```dart
/// @NestedPage()
/// class TestWidget extends StatelessWidget {
/// @override
/// Widget build(BuildContext context) {
/// return Scaffold(
/// appBar: AppBar(title: Text("Test")),
/// body: Center(child: Text("Body")),
/// );
/// }
/// }
/// ```
class NestedPage {
/// Pages for use in nested navigators rather than at the top level.
///
/// If used with this, it will not be accessible via deep linking.
///
/// When [redirect] is set, it is possible to write reroute settings that correspond only to that page.
///
/// トップレベルではなくネストされたナビゲーターで用いるためのページ。
///
/// これで使用した場合、ディープリンクでのアクセスができなくなります。
///
/// [redirect]を設定するとそのページのみに対応するリルート設定を記述することが可能です。
///
/// ```dart
/// @NestedPage()
/// class TestWidget extends StatelessWidget {
/// @override
/// Widget build(BuildContext context) {
/// return Scaffold(
/// appBar: AppBar(title: Text("Test")),
/// body: Center(child: Text("Body")),
/// );
/// }
/// }
/// ```
const NestedPage({
this.redirect = const [],
});

/// Reroute settings.
///
/// When [redirect] is set, it is possible to write reroute settings for only that page.
///
/// Only `RerouteQuery` and classes that extend it are used by the builder.
///
/// リルート設定。
///
/// [redirect]を設定するとそのページのみに対応するリルート設定を記述することが可能です。
///
/// `RerouteQuery`とそれを継承したクラスのみがbuilderで利用されます。
final List<Object> redirect;
}
2 changes: 1 addition & 1 deletion packages/katana_router_annotation/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ packages:
name: katana
url: "https://pub.dartlang.org"
source: hosted
version: "0.15.5+1"
version: "0.15.5+2"
logging:
dependency: transitive
description:
Expand Down

0 comments on commit 8c14f68

Please sign in to comment.