본문 바로가기

code6.2

Flutter 플러터에서 드롭다운 버튼의 너비를 전체 너비로 조정하고 드롭다운 화살표 아이콘을 조정합니다., Full width DropdownButton with adjust dropdown arrow icon in Flutter 질문 Flutter에서는 전체 너비로 DropdownButton을 추가하고 드롭다운 화살표 아이콘도 조정해야 했습니다. 그러나 많은 시도를 해봤지만 너비가 전체로 확장되지 않았습니다. DropdownButton에 대한 코드는 다음과 같습니다: new Expanded( child: new Column( children: [ new DropdownButton( items: [ new DropdownMenuItem(child: new Text("Abc")), new DropdownMenuItem(child: new Text("Xyz")), ], hint: new Text("도시 선택"), onChanged: null ) ] ), flex: 1, ) 답변 Just adding isExpanded:true to .. 2023. 8. 12.
Flutter 플러터에서 ModalBottomSheet의 상태를 업데이트하는 방법은 무엇인가요?, How to update state of a ModalBottomSheet in Flutter? 질문 이 코드는 매우 간단합니다: 모달 바닥 시트를 보여주고 사용자가 버튼을 클릭하면 시트의 높이를 10만큼 증가시킵니다. 하지만 아무 일도 일어나지 않습니다. 실제로, 사용자가 바닥 시트를 "슬라이드"하여 크기를 업데이트합니다(스와이프가 시트의 내부 상태를 업데이트한다고 믿습니다). 제 질문은: 모달 바닥 시트의 상태 업데이트를 어떻게 호출할 수 있을까요? showModalBottomSheet( context: context, builder: (context) { return Container( height: heightOfModalBottomSheet, child: RaisedButton( onPressed: () { setState(() { heightOfModalBottomSheet += 10; .. 2023. 7. 19.