int? readInt(String key) { final value = getString(key); if (value == null) return null; int? num; try { num = jsonDecode(value); } catch (err) { debugPrint(err.toString()); } return num; }