IconButton5 Flutter 플러터에서 AlertDialog를 새로 고칠 방법은 무엇인가요?, How to refresh an AlertDialog in Flutter? 질문 현재, AlertDialog에 IconButton이 있습니다. 사용자는 IconButton을 클릭할 수 있으며, 클릭할 때마다 두 가지 색상이 있습니다. 문제는 AlertDialog를 닫고 다시 열어야 색상 아이콘의 상태 변경을 볼 수 있다는 것입니다. 사용자가 클릭할 때 즉시 IconButton 색상을 변경하려고 합니다. 다음은 코드입니다: bool pressphone = false; //.... new IconButton( icon: new Icon(Icons.phone), color: pressphone ? Colors.grey : Colors.green, onPressed: () => setState(() => pressphone = !pressphone), ), 답변 StatefulBuil.. 2023. 5. 18. 이전 1 2 다음