Red Glitter Pointer

 

☠️☠️ 스낵바가 설정되어있는 버튼을 여러 차례 누르면, 그 횟수만큼 계속해서 스낵바가 뜬다 ☠️☠️

 

 

해결 방법 !! 👇

if (Get.isSnackbarOpen) {

} else {
	Get.snackbar("저장 실패", "빈칸 없이 채워주세요",
		colorText: Mycolor().snackbarText,
		snackPosition: SnackPosition.TOP,
		backgroundColor: Mycolor().snackbarBg,
		icon: const Icon(Icons.warning_amber));
}

 

위 코드와 같이 if 문을 한 번 걸어서, 현재 snackbar가 떠있는 상황인지 확인 후 해당 기능을 수행하도록 변경해주면 됨!

 

 

+ Recent posts

loading