본문 바로가기

MaterialDesign3

Flutter 플러터에서 텍스트 줄 간격을 어떻게 설정하나요?, How do set text line height in flutter? 질문 So in Material Design Spec under Onboarding: 여기 그것은 다음과 같이 지정되어 있습니다: 32sp 라인 높이 이는 헤드라인 텍스트의 하단부터 서브헤드 텍스트의 기준선까지의 높이입니다. 제 질문은 플러터에서 이것을 정확히 어떻게 구현할 수 있는지입니다. 이 사양을 모방하기에 충분한 패딩이 있습니까? 아니면 더 정확한 방법이 있습니까? 답변 네, TextStyle에는 height 속성도 있으며, 이를 사용하여 줄의 높이를 수동으로 조절할 수 있습니다. 코드 스니펫 Text('Hey There', style: TextStyle(height: 5, fontSize: 10), ) 2023. 9. 22.
Flutter 플러터에서 어떻게 둥근 텍스트 필드를 만들 수 있나요?, How can I make rounded TextField in flutter? 질문 Material Design for iOS doesn't look good, especially the TextField. So is there any way to create your own ? Or Is ther any way to add some styling to TextField so it will look rounded ? 답변 당신은 TextField의 decoration 매개 변수 내에서 둥근 모서리를 추가할 수 있습니다. TextField( decoration: InputDecoration( border: OutlineInputBorder( borderRadius: BorderRadius.circular(10.0), ), filled: true, hintStyle: TextStyle.. 2023. 6. 14.
Flutter TextField 위젯에 Clear 버튼을 추가하는 방법, How to add clear button to TextField Widget 질문 TextField에 클리어 버튼을 추가하는 올바른 방법이 있나요? Material design 가이드라인에서 보는 것처럼: 찾아본 결과, InputDecoration의 suffixIcon에 클리어 IconButton을 설정하는 것이 맞는 방법인가요? 답변 출력: 변수를 만드세요 var _controller = TextEditingController(); 그리고 TextField를 추가하세요: TextField( controller: _controller, decoration: InputDecoration( hintText: '메시지를 입력하세요', suffixIcon: IconButton( onPressed: _controller.clear, icon: Icon(Icons.clear), ), ), ) 2023. 5. 18.