본문 바로가기

분류 전체보기980

Flutter 다트 다중 생성자, Dart Multiple Constructors 질문 다트에서 클래스에 여러 생성자를 만들 수 없는 것이 사실인가요? 내 Player 클래스에서 이 생성자가 있다면 Player(String name, int color) { this._color = color; this._name = name; } 그런 다음이 생성자를 추가하려고하면: Player(Player another) { this._color = another.getColor(); this._name = another.getName(); } 다음 오류가 발생합니다. 기본 생성자가 이미 정의되어 있습니다. 나는 필수가 아닌 인수를 가진 하나의 생성자를 만들어 우회하는 해결책을 찾고 있지 않습니다. 이를 해결하는 좋은 방법이 있나요? 답변 하나의 이름 없는 생성자만 가질 수 있지만, 추가 이름 있는.. 2023. 5. 28.
Flutter에서 다음 TextField로 포커스를 이동하는 방법은 무엇인가요?, How to shift focus to the next TextField in Flutter? 질문 저는 플러터를 처음 사용합니다. Form, TextFormField 위젯을 사용하여 여러 텍스트 입력란이있는 양식을 작성하고 있습니다. 나타나는 키보드에서는 "다음" (다음 필드로 포커스를 이동해야 함) 필드 작업이 아니라 "완료" 작업 (키보드를 숨기는 작업)이 표시되지 않습니다. 공식 문서에서 힌트를 찾아보았지만 직접적으로 할 수있는 것은 없었습니다. 나는 FocusNode (cookbook, api doc)에 도달했습니다. 이것은 앱에서 버튼이나 기타 작업을 사용하여 포커스를 이동시키는 메커니즘을 제공하지만 키보드에서 작동하도록하고 싶습니다. 답변 Screenshot: Just use: textInputAction: TextInputAction.next: To move the cursor to.. 2023. 5. 28.
Flutter 플러터에서 드롭다운 리스트를 구현하는 방법은 무엇인가요?, How to implement drop down list in flutter? 질문 나는 Flutter에서 드롭다운 목록으로 구현하고자하는 위치 목록이 있습니다. 나는 이 언어에 대해 매우 새롭습니다. 내가 한 것은 다음과 같습니다. new DropdownButton( value: _selectedLocation, onChanged: (String newValue) { setState(() { _selectedLocation = newValue; }); }, items: _locations.map((String location) { return new DropdownMenuItem( child: new Text(location), ); }).toList(), 이것은 내 항목 목록입니다: List _locations = ['A', 'B', 'C', 'D']; 그리고 나는 다음 오류를.. 2023. 5. 28.
Flutter 커스텀 카드 모양 플러터 SDK, Custom Card Shape Flutter SDK 질문 I have developed an app with GridView on Flutter. GridView items are Card and the default card shape is Rectangle with a radius of 4. I know there is shape property for Card Widget and it takes ShapeBorder class but I am unable to find how to use ShapeBorder class and customize my cards in GridView. How do I go about this? 답변 이렇게 사용할 수 있습니다. Card( shape: RoundedRectangleBorder( borderRadius: .. 2023. 5. 28.