registerTyped<TProps> method
void
registerTyped<TProps>(
- String name, {
- required TProps fromJson(),
- required FlintComponent builder(
- TProps props
Registers a strongly-typed page builder for name with automatic JSON
deserialization via fromJson.
Implementation
void registerTyped<TProps>(
String name, {
required TProps Function(Map<String, dynamic> json) fromJson,
required FlintComponent Function(TProps props) builder,
}) {
_pages[name] = (rawProps) => builder(fromJson(rawProps));
}