🏆 2024

맛집 분야 크리에이터

🏆 2023

IT 분야 크리에이터

👩‍❤️‍👨 구독자 수

182

✒️ 게시글 수

0
https://tistory1.daumcdn.net/tistory/4631271/skin/images/blank.png 네이버블로그

🩷 방문자 추이

오늘

어제

전체

🏆 인기글 순위

티스토리 뷰

728x90
반응형

 

VSCode의 상단 메뉴바에서 View > Command Palette 를 클릭,

Flutter: New Application Project 클릭, 프로젝트 폴더명을 입력하여 프로젝트 폴더를 생성한다.

프로젝트를 저장하는 경로 도중에 한글이 있으면 에러가 발생하므로 주의해야 한다.

https://tistory1.daumcdn.net/tistory/4631271/skin/images/blank.png
https://tistory1.daumcdn.net/tistory/4631271/skin/images/blank.png

프로젝트를 생성하면 아래와 같이 폴더와 파일들이 자동으로 생성된다.

주로 코딩할 곳은 android, ios, lib 세가지이고,  lib > main.dart가 메인 개발소스코드 파일이다.

https://tistory1.daumcdn.net/tistory/4631271/skin/images/blank.png

dependency 를 추가하는 파일은 pubspec.yaml이다.

 

main.dart에는 이미 코딩이 살짝 되어있는데, 다 지우고서 아래 페이지에 있는 튜토리얼 코드를 복붙한다.

flutter.dev/docs/get-started/codelab

 

Write your first Flutter app, part 1

How to write a web-based app in Flutter.

flutter.dev

 

https://tistory1.daumcdn.net/tistory/4631271/skin/images/blank.png

 

<코드실행방법>

상단바의 Debug > start Debugging을 누르면 한줄한줄 읽으면서 실행,

Debug > run without debugging을 누르면 디버깅 없이 실행된다. (Ctrl+F5)

 

Debug > run without debugging을 눌러 테스트할 애뮬레이터를 선택한다.

https://tistory1.daumcdn.net/tistory/4631271/skin/images/blank.png

 

나는 cannot launch without an active device 에러가 뜨면서 애뮬레이터가 실행되지 않아서

Flutter (Chrome)를 눌렀더니 실행이되었다.

https://tistory1.daumcdn.net/tistory/4631271/skin/images/blank.png

 

코드를 수정하고 Ctrl+S로 저장하면 알아서 수정된 화면을 보여준다.

프로젝트 생성 끝.

728x90
반응형
댓글

돔돔이님의
글이 좋았다면 응원을 보내주세요!