static OS? fromString(String? str) { if (str == null) { return null; } try { return OS.values.firstWhere((e) => e.toString().split('.').last == str); } on Exception { return null; } }