TailscalePrefs.fromJson constructor
Parses the JSON shape returned by the native LocalAPI wrapper.
Implementation
factory TailscalePrefs.fromJson(Map<String, dynamic> json) => TailscalePrefs(
advertisedRoutes: List<String>.unmodifiable(
(json['advertisedRoutes'] as List?)?.cast<String>() ?? const [],
),
acceptRoutes: json['acceptRoutes'] as bool? ?? false,
shieldsUp: json['shieldsUp'] as bool? ?? false,
advertisedTags: List<String>.unmodifiable(
(json['advertisedTags'] as List?)?.cast<String>() ?? const [],
),
wantRunning: json['wantRunning'] as bool? ?? false,
autoUpdate: json['autoUpdate'] as bool? ?? false,
hostname: json['hostname'] as String? ?? '',
autoExitNode: json['autoExitNode'] as bool? ?? false,
exitNodeId: json['exitNodeId'] as String?,
);