createDefault static method

dynamic createDefault({
  1. required String schemaType,
  2. required String title,
})

A simplified approach to creating a ContentDescriptor that follows the standard conventions. This eliminates the need to create a new <Item>ContentDescriptor.

schemaType is ContentItem's schemaType. title of the descriptor.

Returns a function that takes in a list of TypeDescriptor<LayoutConfiguration>. This is the function that will be used by consuming features to pass in new layouts for the ContentItem.

Implementation

static createDefault({required String schemaType, required String title}) {
  return ({List<TypeDescriptor<LayoutConfiguration>>? layouts}) =>
      _DefaultContentDescriptor(
        schemaType: schemaType,
        title: title,
        layouts: layouts,
      );
}