MountRecord.fromJson constructor
Decodes a record from JSON.
Implementation
factory MountRecord.fromJson(Map<String, dynamic> json) => MountRecord(
id: json['id'] as String,
nodeId: json['nodeId'] as String,
name: json['name'] as String,
kind: json['kind'] as String,
remotePath: json['remotePath'] as String,
localPath: json['localPath'] as String?,
gitUrl: json['gitUrl'] as String?,
gitBranch: json['gitBranch'] as String?,
currentBranch: json['currentBranch'] as String?,
readWrite: json['readWrite'] as bool? ?? false,
ephemeral: json['ephemeral'] as bool? ?? false,
driveId: json['driveId'] as String,
filter: json['filter'] == null
? PathFilter.empty
: PathFilter.fromJson((json['filter'] as Map).cast<String, dynamic>()),
mountedAt: DateTime.parse(json['mountedAt'] as String),
syncState: SyncState.fromJson(json['syncState'] as Map<String, dynamic>),
baselineManifest: json['baselineManifest'] == null
? null
: FileManifest.fromJson(
(json['baselineManifest'] as Map).cast<String, dynamic>(),
),
);