美文网首页
11.1.flutter-lottie

11.1.flutter-lottie

作者: ChaosHeart | 来源:发表于2021-09-06 08:40 被阅读0次
    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

    相关文章

      网友评论

          本文标题:11.1.flutter-lottie

          本文链接:https://www.haomeiwen.com/subject/tjhewltx.html