반응형
initState()
-
life cycle 라이프 사이클 initState(), dispose()프로그래밍 공부 메모/flutter 2022. 6. 7. 21:35
statefulwidget 클래스를 생성하여 위젯 트리에 삽입되면 initState() 메서드가 호출된다 즉 앱이 실행되어 statefulwidget이 생성되면 뭔가 실행하고 싶다면 initState() 구현하면 된다 import 'package:flutter/material.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( d..