[Flutter] 디렉토리 구조의 pubspec.yaml 알아보기
2020. 8. 9. 20:21ㆍFlutter
안드로이드 스튜디오에서 생성된 플러터 프로젝트를 보면 pubspec.yaml파일이 생성됩니다.
yaml파일은 설정파일로 .yaml확장아로 나옵니다. 보통 xml형식으로 의존성을 추가하는데 xml이나 json형식보다
사람이 저장하고 읽고 쓰기 쉬운 형식으로 나온 약속입니다.
node.js의 package.json같은 패키지들의 의존성 관리 및 프로젝트를 정의하는(프로젝트 이름, 버전, 개발 환경등을 기술하는) 역할을 합니다.
name: i_am_rich
description: A new Flutter application.
# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# Android에서 빌드 이름은 versionName으로, 빌드 번호는 versionCode로 사용됩니다.
# Android 버전에 대한 자세한 내용은 아래 참조하십시오.
# https://developer.android.com/studio/publish/versioning
# iOS에서 빌드 이름은 CFBundleShortVersionString으로, 빌드 번호는 CFBundleVersion으로 사용됩니다.
# iOS 버전 설정에 대한 자세한 내용은 다음 사이트를 참조하십시오.
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.3
dev_dependencies:
flutter_test:
sdk: flutter
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
# 애플리케이션의 자산(정적 파일들)을 추가 하려면 다음과 같은 assets 섹션을 추가할 것
assets:
- images/diamond.png
# 이미지 자산은 하나 이상의 해상도별 "변수"를 참조할 수 있습니다.
# https://flutter.dev/assets-and-images/#resolution-aware.
# 패키지 의존성에서 assets 추가에 대한 자세한 사항은 아래 참고
# https://flutter.dev/assets-and-images/#from-packages
# 프로그램에 사용자 정의 글꼴을 추가하려면 여기에 fonts 섹션을 추가합니다.
# flutter 섹션에서 각 목록은 fonts와 family키를 가지는데 family는 폰트 패밀리 이름,
# fonts 키는 각 폰트의 대한 discriptors(기울기나 weight 같은?)의 리스트를 가진다.
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
# 패키지 종속성의 글꼴에 대한 자세한 내용은 아래를 참조하세요.
# see https://flutter.dev/custom-fonts/#from-packages
Pub
Flutter는 Pub이라는 패키지 매니저를 제공합니다. (npm 같은)
같은 Pub 패키지 매니저라고 Dart는 기본적으로 pub명령어를 그대로 사용하고 flutter는 flutter package 명령어를 사용합니다.
아래 주소는 npmjs.com 같은 패키지 저장소입니다. Flutter 또는 웹 또는 Dart프로젝트에서 사용할 패키지들을 볼 수 있고 가져와서 사용하면 됩니다.
Dart packages
Pub is the package manager for the Dart programming language, containing reusable libraries & packages for Flutter, AngularDart, and general Dart programs.
pub.dev
'Flutter' 카테고리의 다른 글
[Flutter] Routes 와 Navigation (feat. 멀티스크린) (0) | 2020.12.26 |
---|---|
[Flutter] Flutter에서 Dart 문법(2) - Functions as First Order Objects (2) | 2020.12.19 |
[Flutter] Flutter에서 Dart 문법 (enum 타입 , 삼항 연산자, Map 타입) (0) | 2020.12.13 |
[Flutter] 사용자 동작(제스터)를 감지하는 GestureDetector위젯 (0) | 2020.12.12 |
[Flutter] 정적 이미지 파일 가져오기 (화면에 따른 조정법) (0) | 2020.09.13 |