toJson method
Packages in id order, so the same packages always write the same bytes.
Implementation
Map<String, Object?> toJson() => {
'lock_version': 1,
'configuration_sha256': configurationSha256,
'packages': {
for (final id
in packages.keys.toList()
..sort((left, right) => left.value.compareTo(right.value)))
id.value: packages[id]!.toJson(),
},
};