readGlobalStore static method

Map<String, dynamic>? readGlobalStore()

Reads the machine-wide store, or null when it is absent or unreadable.

Implementation

static Map<String, dynamic>? readGlobalStore() {
  final file = globalStore;
  if (!file.existsSync()) return null;
  try {
    final decoded = jsonDecode(file.readAsStringSync());
    return decoded is Map ? Map<String, dynamic>.from(decoded) : null;
  } on FormatException {
    return null;
  } on FileSystemException {
    return null;
  }
}