ServerException.fromJson constructor Null safety

ServerException.fromJson(
  1. Map<String, dynamic> json
)

Implementation

ServerException.fromJson(Map<String, dynamic> json) {
  result = json['result'] ?? 'error';
  errors = <Error>[];
  if (json['errors'] != null) {
    json['errors'].forEach((e) {
      errors.add(Error.fromJson(e));
    });
  }
}