registerTyped<TProps> method

void registerTyped<TProps>(
  1. String name, {
  2. required TProps fromJson(
    1. Map<String, dynamic> json
    ),
  3. required FlintComponent builder(
    1. 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));
}