DiagnosticGetServerPortResult.fromJson constructor
DiagnosticGetServerPortResult.fromJson(
- JsonDecoder jsonDecoder,
- String jsonPath,
- Object? json
)
Implementation
factory DiagnosticGetServerPortResult.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
int port;
if (json.containsKey('port')) {
port = jsonDecoder.decodeInt('$jsonPath.port', json['port']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'port');
}
return DiagnosticGetServerPortResult(port);
} else {
throw jsonDecoder.mismatch(
jsonPath, 'diagnostic.getServerPort result', json);
}
}