setSection method

V2RayConfigBuilder setSection(
  1. String key,
  2. Object? value
)

Set any top-level Xray section without dropping unknown fields.

Implementation

V2RayConfigBuilder setSection(String key, Object? value) {
  if (key.trim().isEmpty) throw ArgumentError('Section key is empty');
  _config[key] = jsonDecode(jsonEncode(value));
  return this;
}