fromMap static method
Implementation
static ProxyRule? fromMap(
Map<String, dynamic>? map, {
EnumMethod? enumMethod,
}) {
if (map == null) {
return null;
}
final instance = ProxyRule(
allowFailover: map['allowFailover'],
excludedDomains: map['excludedDomains'] != null
? List<String>.from(map['excludedDomains']!.cast<String>())
: null,
matchDomains: map['matchDomains'] != null
? List<String>.from(map['matchDomains']!.cast<String>())
: null,
password: map['password'],
schemeFilter: switch (enumMethod ?? EnumMethod.nativeValue) {
EnumMethod.nativeValue => ProxySchemeFilter.fromNativeValue(
map['schemeFilter'],
),
EnumMethod.value => ProxySchemeFilter.fromValue(map['schemeFilter']),
EnumMethod.name => ProxySchemeFilter.byName(map['schemeFilter']),
},
url: map['url'],
username: map['username'],
);
return instance;
}