플러터에서 enum 타입의 값을 SharedPreference에 저장하고 싶을 때가 있다. enum OrderByOptions { byCreatedAtDescending, byCreatedAtAscending, } 하지만 SharedPreferences는 Int 나 String 같은 기본형 타입만 저장이 가능하다. 이런 경우에는 enum 타입의 index를 이용해 Int 형식으로 저장해 사용하면 된다. 먼저, SharedPreferences에는 아래와 같이 저장할 수 있다. SharedPreferences prefs = await SharedPreferences.getInstance(); await prefs.setInt("orderBy", selectedOrderByOption.index..