dvStudioComponent function

DVPageDocument dvStudioComponent(
  1. String name, {
  2. required DVPageNode root,
  3. List<DVStudioComponentProp> props = const <DVStudioComponentProp>[],
})

A component named name, drawn as root, taking props.

Implementation

DVPageDocument dvStudioComponent(
  String name, {
  required DVPageNode root,
  List<DVStudioComponentProp> props = const <DVStudioComponentProp>[],
}) {
  root.properties[_propsKey] = <Object?>[
    for (final DVStudioComponentProp prop in props) prop.toJson(),
  ];
  return DVPageDocument(
    route: dvStudioComponentRoute(name),
    title: name,
    root: root,
  );
}