setDefaultLayout method

bool setDefaultLayout({
  1. required String schemaType,
  2. required LayoutConfiguration<ContentItem> layout,
  3. required FromJsonConverter<LayoutConfiguration<ContentItem>> fromJson,
})

Sets the default layout for the schemaType of the ContentItem. Returns true if the layout was set, false otherwise.

Implementation

bool setDefaultLayout({
  required String schemaType,
  required LayoutConfiguration layout,
  required FromJsonConverter<LayoutConfiguration> fromJson,
}) {
  final builder = contentBuilder(schemaType);

  if (builder == null) {
    return false;
  }

  builder.setDefaultLayout(layout, fromJson: fromJson);

  return true;
}