오늘은 플러터 애니메이션을 사용하기 위해 Lottie를 사용하려한다.
흠... 그런데
import할 때마다 자주 뜨는 이 오류..! ㅜ
Target of URI doesn't exist: 'package:lottie/lottie.dart'.
해결방법을 알아보자.
1️⃣ 원하는 패키지 정보 찾기
The official repository for Dart and Flutter packages.
Pub is the package manager for the Dart programming language, containing reusable libraries & packages for Flutter and general Dart programs.
pub.dev
나는 lottie를 사용할 것이라 lottie 정보를 가지고 왔다.
2️⃣원하는 파일에 import 추가
import 'package:lottie/lottie.dart';
그러면 아까 본 오류가 떠 있을 것이다.
3️⃣ pubspec.yaml 파일에 의존성 추가
lottie: ^3.0.0
dev_dependencies에 추가하였다.
그냥 dependencies에 하니 오류가 안사라졌다. dev_dependencies 확인! ✔️
4️⃣ pub get 눌러서 적용시키기
대충 요런식으로 code 0이 나오면 성공이다~
'🥸 웹앱개발 이모저모 > Flutter' 카테고리의 다른 글
[Dart] Async Programming : 비동기 프로그래밍 (0) | 2024.03.10 |
---|---|
[Dart] Functional Programming : 함수형 프로그래밍 (0) | 2024.03.10 |
[Dart] OOP(Object Oriented Programming) : 객체지향 프로그래밍 (0) | 2024.03.09 |
Dart 기초 문법 (0) | 2024.03.02 |