import 'package:json_annotation/json_annotation.dart'; part 'rest_error.g.dart'; @JsonSerializable() class RestError { final String status; final String message; @JsonKey(name: "error_id") final String errorId; RestError({ required this.status, required this.message, required this.errorId, }); // JSON Init factory RestError.fromJson(Map json) => _$RestErrorFromJson(json); // JSON Export Map toJson() => _$RestErrorToJson(this); }