V2RayConfigBuilder.fromJson constructor
V2RayConfigBuilder.fromJson(
- String config
Preserve all existing sections in a full Xray JSON configuration.
Implementation
factory V2RayConfigBuilder.fromJson(String config) {
final dynamic value;
try {
value = jsonDecode(config);
} on FormatException {
throw const FormatException('Xray configuration must be valid JSON');
}
if (value is! Map<String, dynamic>) {
throw const FormatException('Xray configuration must be a JSON object');
}
return V2RayConfigBuilder._(_cloneMap(value));
}