<aside> ๐ Contents
</aside>
๐ข ctrl
+f
๋๋ฌ ์ํ๋ ๋ด์ฉ์ ์ฝ๊ฒ ์ฐพ์๋ณด์ธ์!
StatefulWidget : ํด๋นapp์ ๋ํ ์ํ๊ด๋ฆฌ ํ์ํ ๋
-data๋ฅผ ๋ฐฑ์๋์์ ๊ฐ์ ธ์์ผํ๊ธฐ ๋๋ฌธ์ Stateful
StatelessWidget : ์ํ๊ด๋ฆฌ๊ฐ ํ์ x ์์ ฏ์ ์ฌ์ฉํ ๋ (์ํ๋ณํx)
//Stateful
class ํด๋์ค์ด๋ฆ extends StatefulWidget {
_ํด๋์ค์ด๋ฆState createState() => _ํด๋์ค์ด๋ฆState();
}
class _ํด๋์ค์ด๋ฆState extends State<ํด๋์ค์ด๋ฆ> {
...
@override
Widget build(BuildContext context) {
return Container(...);
}
}
//Stateless
class ํด๋์ค์ด๋ฆ extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(...);
}
}
[Flutter] StatelessWidget & StatefulWidget ์ฐจ์ด์ ์ ๋ฆฌ
[Flutter] ํ๋ฌํฐ Stateful Widget Lifecycle(์๋ช ์ฃผ๊ธฐ)๋??
: ์๋จ ์ฑ๋ฐ, material๋์์ธ์ด ์ ์ฉ๋ ํ๋ฉด์ด ๊ทธ๋ ค์ ธ์ ๋์์ธ ํต์ผ์ ์ ์ต