① 배운 것
1. 키보드가 보일때, 안보일때 ui를 다르게 하기 - textField의 포커스노드를 이용
//키보드 보이는것, 안보이는것 감지하는 코드
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
final FocusNode _focusNode = FocusNode();
void isActive(){
if(_focusNode.hasFocus){
debugPrint("Keyboard is active");
}else{
debugPrint("Keyboard is not active");
}
}
void initState() {
_focusNode.addListener(isActive);
super.initState();
}
void dispose() {
_focusNode.dispose();
super.dispose();
}
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
TextField(focusNode: _focusNode,),
],
),
),
);
}
}
/github unsubscribe {팀이름}/{레포이름} {기능}
/github subscribe {팀이름}/{레포이름} {기능}
② 회고 (restropective)
오늘 일을 다 잘 끝내고 퇴근해서 기분이 좋았다.
③ 개선을 위한 방법
없음