본문 바로가기

Row18

Flutter 플러터: 수평 리스트 뷰에서의 최소 높이, Flutter: Minimum height on horizontal list view 질문 저는 Flutter에서 항목의 가로 스크롤링 목록을 만들려고 하고, 그 목록이 자식에 따라 필요한 높이만 차지하도록하고 싶습니다. 디자인상으로 “ListView는 교차 방향에서 사용 가능한 공간에 맞게 확장하려고합니다” (Flutter docs에서) 이것은 뷰포트의 전체 높이를 차지한다는 것을 알 수 있습니다. 그러나 이것을하지 않도록하는 방법이 있습니까? 아마도 이와 유사한 것이 이상적입니다 (물론 작동하지 않는 것): new ListView( scrollDirection: Axis.horizontal, crossAxisSize: CrossAxisSize.min, children: [ new ListItem(), new ListItem(), // ... ], ); 저는 ListView를 높이가 고.. 2023. 6. 14.
Flutter 컨테이너 위젯을 수직으로 부모 요소에 채우도록 만드세요., Make container widget fill parent vertically 질문 TL;DR Need the container to fill the vertical space so that it can act as a ontap listener. Have tried most solutions but nothing seems to work. So what I am trying to do is to make my container fill up the vertical space while still having a fixed width. Two first is what I have and third is what I want. The idea is to have the container transparent with a gesture ontap listener. If anyone h.. 2023. 6. 12.
Flutter에서 borderRadius가 있는 Container에 테두리 추가하기, Add border to a Container with borderRadius in Flutter 질문 Container( child: Text( 'This is a Container', textScaleFactor: 2, style: TextStyle(color: Colors.black), ), decoration: BoxDecoration( borderRadius: BorderRadius.circular(10), color: Colors.white, border: Border( left: BorderSide( color: Colors.green, width: 3, ), ), ), height: 50, ), 이것은 녹색 왼쪽 테두리가 있는 둥근 모서리 컨테이너와 "This is a Container"라는 자식 텍스트를 표시해야하지만, 둥근 모서리 컨테이너와 자식 및 왼쪽 테두리가 보이지 않습니다. .. 2023. 5. 31.
Flutter 플러터에서 여러 위젯을 렌더링하기 위해 리스트를 반복하는 방법은 무엇인가요?, Iterating through a list to render multiple widgets in Flutter? 질문 나는 다음과 같이 문자열 목록을 정의했다: var list = ["one", "two", "three", "four"]; 나는 텍스트 위젯을 사용하여 화면에 값들을 옆으로 렌더링하고 싶다. 이를 위해 다음 코드를 사용해 보았다: for (var name in list) { return new Text(name); } 그러나 이 코드를 실행할 때 for 루프는 한 번만 실행되고 목록의 첫 번째 항목인 one만 렌더링되는 텍스트 위젯이 하나만 생성된다. 또한, for 루프 내부에 로그 메시지를 추가하면 한 번만 트리거된다. 왜 내 for 루프는 목록의 길이에 따라 루프하지 않는 걸까? 그것은 한 번만 실행되고 종료되는 것 같다. 답변 기본적으로 함수에서 'return'을 누르면 함수가 중지되고 반복이 .. 2023. 5. 30.