pinOf static method
The Flutter version projectRoot pins — flutter in its just.json
— when it names one exactly (3.47.9); null when it pins none, or its
just.json can't be read (the command that reads it next says why).
Implementation
static String? pinOf(String projectRoot) {
final file = File('$projectRoot/just.json');
try {
if (!file.existsSync()) return null;
final pin = JustProjectFile.parse(file.readAsStringSync()).flutter;
return pin != null && isExactVersion(pin) ? pin : null;
} on JsonFormatException {
return null;
} on FileSystemException {
return null;
}
}