ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [Dart] Dart 언어 VScode로 시작하기(다운방법, SDK, 환경변수 설정법)
    카테고리 없음 2024. 4. 5. 19:05

    1.
    윈도우 키 > windows powershell > 우클릭 > 관리자 권한으로 실행

    Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) 
    복사 후 붙여넣기
    (설치 완료되면 choco 입력하면 버전 출력됨)
    참고 사이트 ( https://chocolatey.org/install#individual )

    2.
    윈도우 키 > CMD > 우클릭 > 관리자 권한으로 실행 >
    choco install dart-sdk
    Do you want to run the script?([Y]es/[A]ll - yes to all/[N]o/[P]rint): 나오면 y 엔터
    완료 후
    choco upgrade dart-sdk 
    (업그레이드 명령어임)

    3.
    윈도우 키 > 시스템 환경 변수 편집 > 환경 변수 > 사용자 변수 > Path > 편집 > C:\tools\dart-sdk\bin 되어있는거 확인

    4.
    VSCode 실행 > Extension > Dart, Flutter 설치
    Ctrl + Shift + P > Dart 검색 > Dart: New Project 클릭 > Console Application > 저장할 경로 설정 > app 이름 설정 > bin에 dart 파일 생성됨.

    5.

    import 'package:dart_application_1/dart_application_1.dart' as dart_application_1;

    void main(List<String> arguments) {
      print('Hello world: ${dart_application_1.calculate()}!');
    }

    > 프로젝트 생성 완료되면 Hello World 코드 만들어져 있음. > F5 = Debug, Ctrl + F5 = Run

Designed by Tistory.