rules:
prefer_typing_uninitialized_variables: false
prefer_const_constructors_in_immutables: false
prefer_const_constructors: false
avoid_print: false
prefer_const_literals_to_create_immutables: false
File > Settings > Editor > Inspections > 상단 Profile을 Default로 선택 > Proofreading > Typo 체크 해제

file > settings > languates & Frameworks > Flutter > Format on save 체크
flutter: assets: > 하단에 - assets/ 추가현재 위젯의 조상 위젯들에 대한 정보를 담음, 쉽게 말해 족보 개념
class MyApp extends StatelessWidget {
...
build (context) {
return MaterialApp(
home : Scaffold(
body : Custom()
)
);
}
}
class Custom extends StatelessWidget {
...
build (context) {
return Text('족보');
}
}
Custom 위젯 안의 context에는 Scaffold, MaterialApp 정보가 들어있고
MyApp한텐 부모가 없으므로 context에도 암것두 없음
build (context) {
return MaterialApp(
home: Scaffold(
floatingActionButton: FloatingActionButton(
onPressed: (){
showDialog(
context: context,
builder: (context){ return Dialog( child: Text('안녕'), ); },
);
},
),
이 경우 MaterialApp의 context(정보 없음)를 갖다 쓰게 되므로 에러 발생
→ MaterialApp을 이 부모로 들어있는 context를 하나 만들(MaterialApp을 바깥으로(부모쪽으로) 보내)거나
→ Builder(builder: (context2) {return FAB(.. (context2)(return Dialog(..)))} 사용
→ Builder 쓰면 복잡해지니 응급 시에 사용, 보통 MaterialApp을 바깥으로 빼서 해결
Text('원래 있던 문자 ${넣고 싶은 변수}')