전체 > import (2) DART 07. 상황별 패키지 접근 방식 {유목민 알폰스} 프로젝트/lib/testClassBin/Test.dart //testClassBin > Test class Test { void getMessage() { print("[testClassBin/Test.dart]로드완료!"); } } 프로젝트/lib/classBin/ChildTest.dart //classBin > ChildTest class ChildTest { void getMessage() { print("[classBin/ChildTest]로드완료!"); } } package접두사 package접두사로 import할때 아래 코드에서 hello_prj는 프로젝트명이 됩니다. 폴더를 자세히 관찰해 보면 lib폴더가 있지만 lib폴더의 경로는 생략하고 기입 합니다. Main.dart import 'cl.. DART 06. 최초실행 후 외부클래스 import하기 {유목민 알폰스} HelloUser.dart int year = 2023; String userName = "제임스"; void sayHello() { print('hello, $userName $year 화이팅!'); } class User { int year = 2023; String userName = "제임스"; void sayHello() { print('hello, $userName $year 화이팅!'); } } Main.dart - main함수가 있는 파일이 실행파일입니다. import 'HelloUser.dart'; main() { print("========== import in (변수, 함수) ===========\n"); print("$userName"); sayHello(); print("\n===.. 이전 1 다음