Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 |
Tags
- lifecycle
- firebase
- printf
- scss
- DART
- unity
- npm
- 단축키
- println
- ListView
- Flutter
- JS
- 앱심사
- UI/UX
- 자바 포맷 출력
- react
- JQ
- abap
- 자바스크립트
- Clean Architecture
- java 출력
- riverpod
- 엡
- develop
- 자바 출력 방식
- 배포
- java
- LLM
- nodejs
- java 콘솔 출력 차이
Archives
- Today
- Total
guricode
[flutter]자취의 정석 -4,bottomSheet에 TextFormField 입력시 hassized문제 본문
앱/Flutter&Dart
[flutter]자취의 정석 -4,bottomSheet에 TextFormField 입력시 hassized문제
agentrakugaki 2025. 9. 19. 11:44bottomsheet에 댓글입력창을 달려고하는데 hassize문제가 생긴다
분명 텍스트 폼 필드에 Expanded로 감쌋는데도 오류가 생겻다
bottomSheet: Padding(
// 키보드 올라오면 같이 올림
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).viewInsets.bottom,
),
child: Material(
elevation: 8,
color: Colors.white,
child: SafeArea(
top: false,
child: Padding(
padding: const EdgeInsets.all(25),
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
SizedBox(
height: 36,
width: 36,
child: Image.asset('assets/images/m_profile/m_black.png'),
),
SizedBox(width: 8),
Row(
children: [
Expanded(
// TextFormField 필수
child: SizedBox(
height: 40,
child: TextFormField(
controller: commentController,
minLines: 1,
maxLines: 6, // 자동 줄 증가
decoration: InputDecoration(
hintText: '댓글을 입력하세요',
isDense: true,
contentPadding: const EdgeInsets.symmetric(
horizontal: 12,
vertical: 10,
),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
),
),
),
),
),
SizedBox(
height: 36,
width: 64,
child: ElevatedButton(
onPressed: submit,
child: const Text('확인'),
),
),
],
),
],
),
),
),
),
),
그래서 ConstrainedBox 크기 제한을 시도해봤는데도 똑같았다
ConstrainedBox(
constraints: BoxConstraints(minHeight: 56, maxHeight: 180),
원인은 텍스트폼필드를 감싸고 있는 Row에 있었다
Row는 가로사이즈만 제약을 가지고있었다
그래서 TextFormField가 새로제약이 존재하지 않기때문에 hassize문제가 생긴 것이었다
'앱 > Flutter&Dart' 카테고리의 다른 글
| [flutter]자취의 정석 -6 댓글 꾹~ 눌렀을때 메뉴 펼치기(신고하기,차단하기 등등) (0) | 2025.09.22 |
|---|---|
| [flutter]자취의 정석 -5 NestedScrollView를 이용한 스크롤 화면 (0) | 2025.09.20 |
| [flutter]자취의 정석 -3 : TabBar를 사용한 카테고리 선택 구현 (0) | 2025.09.16 |
| 메모리 및 시점 비교 표 (Dart 기준)/final / const / static 비교 (0) | 2025.09.12 |
| [flutter]자취의 정석 -2 : Lottie JSON을 이용한 애니메이션 구현 (0) | 2025.09.11 |