我在我的Flutter应用程序中使用Lottie动画,但是遇到了一个错误,提示“使用JsonReader.setLenient(true)接受路径$处的格式不正确的JSON”
我在我的Flutter应用程序中使用Lottie动画,但是遇到了一个错误,提示“使用JsonReader.setLenient(true)接受路径$处的格式不正确的JSON”
dependencies:
flutter:
sdk: flutter
lottie: ^2.4.0
并在像这样的资产中:
assets:
- assets/lottie/
代码调用lottie:
Positioned(
top: size.height * 0.05,
child: SizedBox(
height: 200,
child: SimpleShadow(
child: Lottie.asset('assets/lottie/lottie-file.json'),
)),
),
OBS: SimpleShadow() 是一个库
dependencies:
simple_shadow: ^0.3.1
结果:
线内有小玩偶
希望能帮到你