본문 바로가기

Sizedbox8

Flutter 텍스트 필드의 높이와 너비를 변경하는 방법은 무엇인가요?, How to change TextField's height and width? 질문 TextField의 width와 height를 어떻게 사용자 정의할 수 있나요? 답변 너비를 조정하려면 다음과 같이 TextField를 SizedBox 위젯으로 래핑 할 수 있습니다: const SizedBox( width: 100.0, child: TextField(), ) TextField의 높이에 대해 정확히 무엇을 원하는지 모르겠지만, TextStyle 위젯을 살펴볼 수 있습니다. 이 위젯을 사용하면 fontSize 및/또는 height를 조작할 수 있습니다. const SizedBox( width: 100.0, child: TextField( style: TextStyle(fontSize: 40.0, height: 2.0, color: Colors.black), ), ) TextStyle의.. 2023. 5. 15.
Flutter 플러터에서 행의 요소 간 간격 설정하기, Set the space between Elements in Row Flutter 질문 코드: new Container( alignment: FractionalOffset.center, child: new Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ new FlatButton( child: new Text('Don\'t have an account?', style: new TextStyle(color: Color(0xFF2E3233))), ), new FlatButton( child: new Text('Register.', style: new TextStyle(color: Color(0xFF84A2AF), fontWeight: FontWeight.bold),), onPressed: moveToRegister, .. 2023. 5. 15.
Flutter 버튼 너비를 부모와 일치시키는 방법은 무엇인가요?, How to make button width match parent? 질문 나는 match parent 레이아웃 너비에 너비를 설정하는 방법을 알고 싶습니다. new Container( width: 200.0, padding: const EdgeInsets.only(top: 16.0), child: new RaisedButton( child: new Text( "Submit", style: new TextStyle( color: Colors.white, ) ), colorBrightness: Brightness.dark, onPressed: () { _loginAttempt(context); }, color: Colors.blue, ), ), 나는 Expanded 위젯에 대해 약간 알고 있지만, Expanded는 양방향으로 뷰를 확장시키기 때문에 어떻게 해야할지 모릅니다... 2023. 5. 10.
flutter 플러터에서 Column의 자식들 사이의 간격, Space between Column's children in Flutter 질문 나는 두 개의 TextField 위젯을 자식으로 가진 Column 위젯이 있으며, 둘 사이에 일부 공간을 두고 싶습니다. 이미 mainAxisAlignment: MainAxisAlignment.spaceAround을 시도해 보았지만, 원하는 결과가 아니었습니다. 답변 Padding 위젯을 두 위젯 사이에 사용하거나, 이러한 위젯을 Padding 위젯으로 래핑할 수 있습니다. 업데이트 SizedBox 위젯은 두 위젯 사이에 공간을 추가하는 데 사용할 수 있으며, 패딩 위젯보다 코드를 더 읽기 쉽게 만듭니다. 예: Column( children: [ Widget1(), SizedBox(height: 10), Widget2(), ], ), 2023. 5. 9.