728x90
일정 조건이 만족할 때 만 버튼이 동작하고, 그렇지 않을 경우에는 비활성화 하여 사용자가 클릭하지 못하게 해야 한다면
onPressed 이벤트에 null을 설정하면 된다.
CupertinoButton(
color: Colors.lightBlue,
borderRadius: circularBorderRadius,
child: Text("진행하기"),
onPressed: (조건1 == true && 조건2 == true )
? () {
....
print("do something");
}
: null),
728x90
'IT' 카테고리의 다른 글
[Flutter 앱 개발하기] CupertinoButton 높이 (크기) 조절하기 (1) | 2023.02.08 |
---|---|
[Flutter 앱 개발하기] ListTile 높이 변경하기 (1) | 2023.02.08 |
[Flutter 앱 개발하기] ffi wrong architecture 에러 해결하기 (1) | 2023.02.04 |
[Python] Can't compare naive and aware 에러 발생 시 (0) | 2023.01.26 |
온라인 검색 키워드 영향력 파악하기 - 네이버, 구글, 키워드마스터 (1) | 2023.01.24 |