errors method

List<String> errors()

Problems that would make the store refuse the app.

Implementation

List<String> errors() => [
  if (!_idPattern.hasMatch(id))
    'id "$id" must be letters, digits, ".", "_" or "-" (e.g. com.example.duka).',
  if (name.isEmpty) 'name is missing.',
  if (name.length > 40) 'name is longer than 40 characters.',
  if (!_versionPattern.hasMatch(version))
    'version "$version" must look like 1.0.0.',
  if (minBridgeVersion < 1) 'minBridgeVersion must be 1 or more.',
  for (final r in [...requires, ...optional])
    if (r.version < 1) 'feature "$r" has a bad version.',
  for (final id in requires.map((r) => r.id).toSet())
    if (optional.any((o) => o.id == id))
      '"$id" is in both requires and optional.',
];