방설정정보 아이폰 안뜨는 현상 수정완료
This commit is contained in:
parent
fc8466d5c3
commit
dcd246f589
@ -73,59 +73,8 @@ class _RoomSettingModalState extends State<RoomSettingModal> {
|
|||||||
runningTime = _toInt(data['running_time'], 1);
|
runningTime = _toInt(data['running_time'], 1);
|
||||||
numberOfPeople = _toInt(data['number_of_people'], 10);
|
numberOfPeople = _toInt(data['number_of_people'], 10);
|
||||||
scoreOpenRange = data['score_open_range']?.toString() ?? 'PRIVATE';
|
scoreOpenRange = data['score_open_range']?.toString() ?? 'PRIVATE';
|
||||||
|
|
||||||
// // (2) room type
|
|
||||||
// final roomTypeStr = (widget.roomInfo['room_type'] ?? 'private').toString().toLowerCase();
|
|
||||||
// // if "private" => isPrivateType=true, else => isPrivateType=false
|
|
||||||
// isPrivateType = (roomTypeStr == 'private');
|
|
||||||
|
|
||||||
// // (3) firebase ref
|
|
||||||
// final roomKey = 'korea-$roomSeq';
|
|
||||||
// _roomRef = FirebaseDatabase.instance.ref('rooms/$roomKey/roomInfo');
|
|
||||||
|
|
||||||
// (4) compare my_user_seq with master_user_seq + read roomInfo from FRD
|
|
||||||
// _checkMasterAndFetchData();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Load my_user_seq from local storage,
|
|
||||||
/// then read roomInfo from FRD and update state
|
|
||||||
/// (로컬스토리지에서 my_user_seq 불러오고 FRD에서 roomInfo 읽어서 state 업데이트)
|
|
||||||
// Future<void> _checkMasterAndFetchData() async {
|
|
||||||
// final prefs = await SharedPreferences.getInstance();
|
|
||||||
// final myUserSeq = prefs.getInt('my_user_seq') ?? 0;
|
|
||||||
|
|
||||||
// final snapshot = await _roomRef.get();
|
|
||||||
// if (!snapshot.exists) {
|
|
||||||
// // No room info (방 정보 없음)
|
|
||||||
// setState(() {
|
|
||||||
// _isLoading = false;
|
|
||||||
// isMaster = false;
|
|
||||||
// roomTitle = 'No room info';
|
|
||||||
// // '방 정보 없음'
|
|
||||||
// });
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// final data = snapshot.value as Map<dynamic, dynamic>? ?? {};
|
|
||||||
// // e.g. master_user_seq, open_yn, etc
|
|
||||||
// final masterSeq = data['master_user_seq'] ?? 0;
|
|
||||||
|
|
||||||
// setState(() {
|
|
||||||
// isMaster = (masterSeq.toString() == myUserSeq.toString());
|
|
||||||
|
|
||||||
// // fill fields (각 필드들)
|
|
||||||
// roomTitle = data['room_title']?.toString() ?? '';
|
|
||||||
// roomIntro = data['room_intro']?.toString() ?? '';
|
|
||||||
// openYn = data['open_yn']?.toString() ?? 'Y';
|
|
||||||
// roomPw = data['room_pw']?.toString() ?? '';
|
|
||||||
// runningTime = _toInt(data['running_time'], 1);
|
|
||||||
// numberOfPeople = _toInt(data['number_of_people'], 10);
|
|
||||||
// scoreOpenRange = data['score_open_range']?.toString() ?? 'PRIVATE';
|
|
||||||
|
|
||||||
// _isLoading = false;
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
/// simple int conversion (단순 int 변환 유틸)
|
/// simple int conversion (단순 int 변환 유틸)
|
||||||
int _toInt(dynamic val, int defaultVal) {
|
int _toInt(dynamic val, int defaultVal) {
|
||||||
if (val == null) return defaultVal;
|
if (val == null) return defaultVal;
|
||||||
|
Loading…
Reference in New Issue
Block a user