Closed cjl84914 closed 4 months ago
data.json
{ "v": "5.12.2", "fr": 30, "ip": 0, "op": 30, "w": 500, "h": 500, "nm": "合成 1", "ddd": 0, "assets": [ { "id": "image_0", "w": 512, "h": 512, "u": "images/", "p": "img_0.jpg", "e": 0 } ], "layers": [ { "ddd": 0, "ind": 1, "ty": 2, "nm": "logo", "refId": "image_0", "sr": 1, "ks": { "o": { "a": 0, "k": 100, "ix": 11 }, "r": { "a": 0, "k": 0, "ix": 10 }, "p": { "a": 0, "k": [ 382, 104, 0 ], "ix": 2, "l": 2 }, "a": { "a": 0, "k": [ 256, 256, 0 ], "ix": 1, "l": 2 }, "s": { "a": 0, "k": [ 25.781, 25.781, 100 ], "ix": 6, "l": 2 } }, "ao": 0, "ip": 0, "op": 30, "st": 0, "bm": 0 } ], "markers": [], "props": {} }
flutter code:
class _AnimationState2 extends State<_Animation2> { @override Widget build(BuildContext context) { return Lottie.asset( 'assets/bodymovin/data.json', delegates: LottieDelegates( text: (initialText) => '**$initialText**', values: [ ValueDelegate.position( const ['logo', '**'], relative: const Offset(120, 400), ), ], ), ); } }
data.json
flutter code: