getWarningAndErrors method

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

Implementation

@override
EditorWarningAndErrorsEntity getWarningAndErrors(
  ID nodeID,
  BuildContext context,
) {
  final controller = context.getControllers[controllerID];
  if (controller == null) {
    return EditorWarningAndErrorsEntity(
      errors: [
        EditorErrorEntity(
          message: 'Controller not found',
          nodeID: nodeID,
        ),
      ],
    );
  }
  if (controller is! PageViewControllerVariable) {
    return EditorWarningAndErrorsEntity(
      errors: [
        EditorErrorEntity(
          message: 'Controller is not a page controller',
          nodeID: nodeID,
        ),
      ],
    );
  }
  return EditorWarningAndErrorsEntity.clear();
}