IT/flutter6 flutter | final ? const?| 문법 정리 const & final 의 공통점 둘 다 "상수" 선언 방법 final string a = "final"; const string b = "const"; 이후에 a = "final2"; b = "const2"; 이와 같이 값을 변화시키려고 하면 에러가 난다. why? const 영상에서 아래 구문에서 에러가 났는데 const int myConst = 5; [Only static fields can be declared as const.] 라고 에러 메세지가 나왔다. const가 사용되는 곳 top level static local → 이는 const 인스턴스 필드가 없음을 의미한다 특징 f.. 2021. 10. 14. [실습1] Flutter "Hello world" 출력 import 'package:flutter/material.dart'; void main() { runApp(Center( child: Text( "Hello World!", textDirection: TextDirection.ltr, ) ) ); } 2021. 6. 24. 이전 1 2 다음