requireText method

void requireText(
  1. EntityDef entity,
  2. LevelScope scope,
  3. List<LevelIssue> out,
  4. String key,
)
inherited

Implementation

void requireText(
  EntityDef entity,
  LevelScope scope,
  List<LevelIssue> out,
  String key,
) {
  final value = entity.string(key);
  if (value != null && value.isNotEmpty) return;
  out.add(
    LevelIssue(
      LevelIssueSeverity.error,
      'has no "$key", so there would be nothing to show',
      where: scope.describe(entity),
    ),
  );
}