getWarningAndErrors method

  1. @override
EditorWarningAndErrorsEntity getWarningAndErrors(
  1. ID nodeID,
  2. BuildContext context
)
override

Implementation

@override
EditorWarningAndErrorsEntity getWarningAndErrors(
    ID nodeID, BuildContext context) {
  if (context.inEditorPages.values.where((e) => e.page.name == name).length >
      1) {
    return EditorWarningAndErrorsEntity(
      errors: [
        EditorErrorEntity(
          message: 'Page name already exists',
          nodeID: nodeID,
        ),
      ],
    );
  }
  return EditorWarningAndErrorsEntity.clear();
}