ResponseError.fromJson constructor

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

Creates a ResponseError from json map

Implementation

factory ResponseError.fromJson(Map<String, dynamic> json) => ResponseError(
    code: ErrorCode.values.firstWhere(
        (e) => e.toString() == 'ErrorCode.${json['code'] as String}'),
    message: json['message'] as String,
    context: json['context'] as String,
    target: json['target'] as String);