HiddenPage constructor

const HiddenPage({
  1. Object? key,
  2. String? name,
  3. Object? transition,
  4. List<Object> redirect = const [],
  5. Type? implementType,
})

Pages to be used in nested navigators instead of at the top level or to intentionally not set URLs.

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.

You can give a name to a page by specifying name, and you can bind an object (including enums, etc.) to a page by specifying key. All of these can be obtained from RouteQuery.

トップレベルではなくネストされたナビゲーターで用いたり、意図的にURLを設定しないためのページ。

これで使用した場合、ディープリンクでのアクセスができなくなります。

redirectを設定するとそのページのみに対応するリルート設定を記述することが可能です。

nameを指定することでページに名前をつけることができ、keyを指定することでページにオブジェクト(enumなども含む)を紐付けることが可能です。これらはすべてRouteQueryから取得することができます。

@HiddenPage()
class TestWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text("Test")),
      body: Center(child: Text("Body")),
    );
  }
}

Implementation

const HiddenPage({
  this.key,
  this.name,
  this.transition,
  this.redirect = const [],
  this.implementType,
});