PageParam constructor
const
PageParam([
- String? name
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.
If name is set to Null, the parameter name itself, i.e. userId
, is used.
各ウィジェットのパラメーターとページのルートの変数を対応するためのアノテーション。
下記の例のようにパス内のuser_id
をクラス引数のuserId
に紐付けるために@ParaPathParam("user_id")
をパラメータのアノテーションとして記述します。
nameをNullにした場合はパラメーターの名前そのもの、つまりuserId
が利用されます。
@PagePath("/user/:user_id")
class Test extends StatelessWidget {
const Test({
@ParaParam("user_id") required String userId,
super.key
});
}
Implementation
const PageParam([this.name]);