본문 바로가기

Flutter4

flutter 패키지 설치 명령어 git에서 새로운 flutter 프로젝트 가져온 후 내 로컬 환경에서 열어보기 받자마자 main.dart 열어보면 빨간색이 가득!npm install처럼 필요한 패키지를 설치하고 main.dart 디버깅이 가능한데, 설치 명령어는 이것! 외워두자$ flutter pub get 2024. 9. 1.
[VSCode] Use 'const' with the constructor to improve performance. VSCode에서 Flutter 코드 작성 중 파란 줄이 엄청 많이 뜨는 경우가 있는데, 문구는 아래와 같다 Use 'const' with the constructor to improve performance.Try adding the 'const' keyword to the constructor invocation.dart prefer_const_constructors  prefer_const_constructorsLearn more about the prefer_const_constructors linter rule.dart.dev 변하지 않을 상수에는 const를 쓰는 걸 권장한다.. 라는 것인데, 어느 것이 const인지 판별하다 오히려 오류가 날 수도 있다는 단점이 있다. 파란 줄을 뜨게 하지 않.. 2024. 8. 22.
vscode에서 Flutter Android emulator 실행하기 1. Android Studio 설치  + Flutter plugin 설치  + Flutter SDK 경로 설정  2. Android emulator 생성  3. VSCode 에서 Ctrl + Shift + P 후 Launch Emulator   4. 사용할 emulator 선택 그러면 안드로이드 화면이 뜸  5. VSCode에서 실행 중인 Flutter 앱의 main.dart 실행 (Run Without Debugging)  그러면 만든 앱이 잘 뜬다저장하면 수정 사항 반영도 잘 됨 2024. 8. 20.
Dart 기본 문법 Introduction  Dart is a language Optimized for UI Dart has 2 compilers  - dart web: javascript로 변환   - dart native: ARM64, x86_64 등 여러 CPU 아키텍처에 맞게 변환 AOT(Ahead-Of-Time) JIT(Just-In-Time) Dart는 개발 환경에서 VM을 이용하여 JIT로 바로 실행 결과 볼 수 있게 함. 이때는 코드가 가상 머신에서 작동하기 때문에 느리다 배포 시에는 AOT를 이용하여 컴파일된 파일이 더 빠르게 작동할 수 있게 한다.null safety: 안전한 프로그램 위해 반영됨 (null 참조 오류 방지) Flutter가 Dart를 채택한 이유  - JIT와 AOT가 모두 제공됨   -.. 2024. 8. 11.
728x90