Map<String, dynamic> toJson() { return { 'file': file, 'errors': [ for (final error in errors) error, ], }; }