page method
Declares a top-level page and returns a handle for navigation/shell use.
Implementation
PageHandle page(
String name, {
String? description,
required String route,
Map<String, DslType>? params,
Map<String, DslType>? state,
List<DslAction>? onLoad,
required DslWidget body,
bool isInitial = false,
}) {
_ensureUnique(_pageNames, name, 'page');
final declaration = PageDeclaration(
name: name,
description: description,
route: route,
params: params,
state: state,
onLoad: onLoad,
body: body,
isInitial: isInitial,
);
_pages.add(declaration);
return PageHandle(declaration);
}