ReturnValue.fromJson constructor

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

Implementation

factory ReturnValue.fromJson(Map<String, dynamic> json) {
  final error = json['error'];
  return ReturnValue(
    value: json['result'] as String?,
    error: error == null
        ? null
        : ReturnValueError.fromJson(Map<String, dynamic>.from(error)),
  );
}