[Flutter] 키보드가 텍스트 입력칸을 가릴 때

MSU·2024년 6월 26일
0

Flutter

목록 보기
6/18

가려지는 위젯을 Container위젯으로 감싸고 다시 Padding위젯으로 감싼 뒤
Padding위젯의 padding값을 MediaQuery.of(context).viewInsets로 설정해주면
키보드가 올라올때 키보드 위로 가려졌던 위젯이 올라온다.

                  return Padding(
                    padding: MediaQuery.of(context).viewInsets,
                    child: Container(
                      height: 250,
                      child: const AddTask(),
                    ),
                  );
profile
안드로이드공부

0개의 댓글