lottie: ^1.1.0 #lottie动画
import 'package:flutter/material.dart';
import 'package:lottie/lottie.dart';
class LottiePage extends StatefulWidget {
const LottiePage({Key key}) : super(key: key);
@override
_LottiePageState createState() => _LottiePageState();
}
class _LottiePageState extends State<LottiePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
centerTitle: true,
title: Text("Lottie"),
),
body: Center(
child: Container(
child: Lottie.asset('resource/json/75257-limon-naranja.json'),
),
),
);
}
}
参考:
https://pub.dev/packages/lottie
https://www.jianshu.com/p/706032bd8464
网友评论