UserAgentMetadata.fromJson constructor

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

Implementation

factory UserAgentMetadata.fromJson(Map<String, dynamic> json) {
  return UserAgentMetadata(
    brands: json.containsKey('brands')
        ? (json['brands'] as List)
            .map((e) =>
                UserAgentBrandVersion.fromJson(e as Map<String, dynamic>))
            .toList()
        : null,
    fullVersionList: json.containsKey('fullVersionList')
        ? (json['fullVersionList'] as List)
            .map((e) =>
                UserAgentBrandVersion.fromJson(e as Map<String, dynamic>))
            .toList()
        : null,
    platform: json['platform'] as String,
    platformVersion: json['platformVersion'] as String,
    architecture: json['architecture'] as String,
    model: json['model'] as String,
    mobile: json['mobile'] as bool? ?? false,
    bitness: json.containsKey('bitness') ? json['bitness'] as String : null,
    wow64: json.containsKey('wow64') ? json['wow64'] as bool : null,
  );
}