static int? getUiTypeValue(UiType? uiType) { switch (uiType) { case UiType.VIEWED: return 0; case UiType.IN_LIST: return 1; } return null; }