Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
ef06d63040 |
13
CHANGELOG.md
@ -1,3 +1,16 @@
|
|||||||
|
## [0.4.0]
|
||||||
|
- Disable "Merge paths" by default and provide an option to enable them.
|
||||||
|
This is the same behavior as in Lottie-android.
|
||||||
|
Merge paths currently don't work if the the operand shape is entirely contained within the
|
||||||
|
first shape. If you need to cut out one shape from another shape, use an even-odd fill type
|
||||||
|
instead of using merge paths.
|
||||||
|
|
||||||
|
Merge paths can be enabled with:
|
||||||
|
```dart
|
||||||
|
Lottie.asset('file.json', options: LottieOptions(enableMergePaths: true));
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## [0.3.6]
|
## [0.3.6]
|
||||||
- Export the `Marker` class
|
- Export the `Marker` class
|
||||||
|
|
||||||
|
1
example/assets/bluetoothscanning.json
Normal file
833
example/assets/example_with_images/data.json
Normal file
@ -0,0 +1,833 @@
|
|||||||
|
{
|
||||||
|
"v": "5.6.9",
|
||||||
|
"fr": 25,
|
||||||
|
"ip": 0,
|
||||||
|
"op": 75,
|
||||||
|
"w": 1200,
|
||||||
|
"h": 1200,
|
||||||
|
"nm": "Character-side v1",
|
||||||
|
"ddd": 0,
|
||||||
|
"assets": [
|
||||||
|
{
|
||||||
|
"id": "image_0",
|
||||||
|
"w": 1200,
|
||||||
|
"h": 1200,
|
||||||
|
"u": "images/",
|
||||||
|
"p": "img_0.png",
|
||||||
|
"e": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "image_1",
|
||||||
|
"w": 1200,
|
||||||
|
"h": 1200,
|
||||||
|
"u": "images/",
|
||||||
|
"p": "img_1.png",
|
||||||
|
"e": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "image_2",
|
||||||
|
"w": 1200,
|
||||||
|
"h": 1200,
|
||||||
|
"u": "images/",
|
||||||
|
"p": "img_2.png",
|
||||||
|
"e": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "image_3",
|
||||||
|
"w": 1200,
|
||||||
|
"h": 1200,
|
||||||
|
"u": "images/",
|
||||||
|
"p": "img_3.png",
|
||||||
|
"e": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "image_4",
|
||||||
|
"w": 1200,
|
||||||
|
"h": 1200,
|
||||||
|
"u": "images/",
|
||||||
|
"p": "img_4.png",
|
||||||
|
"e": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "image_5",
|
||||||
|
"w": 1200,
|
||||||
|
"h": 1200,
|
||||||
|
"u": "images/",
|
||||||
|
"p": "img_5.png",
|
||||||
|
"e": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "image_6",
|
||||||
|
"w": 1200,
|
||||||
|
"h": 1200,
|
||||||
|
"u": "images/",
|
||||||
|
"p": "img_6.png",
|
||||||
|
"e": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "image_7",
|
||||||
|
"w": 1200,
|
||||||
|
"h": 1200,
|
||||||
|
"u": "images/",
|
||||||
|
"p": "img_7.png",
|
||||||
|
"e": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "image_8",
|
||||||
|
"w": 1200,
|
||||||
|
"h": 1200,
|
||||||
|
"u": "images/",
|
||||||
|
"p": "img_8.png",
|
||||||
|
"e": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "image_9",
|
||||||
|
"w": 1200,
|
||||||
|
"h": 1200,
|
||||||
|
"u": "images/",
|
||||||
|
"p": "img_9.png",
|
||||||
|
"e": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"layers": [
|
||||||
|
{
|
||||||
|
"ddd": 0,
|
||||||
|
"ind": 2,
|
||||||
|
"ty": 2,
|
||||||
|
"nm": "F ARM Up",
|
||||||
|
"parent": 8,
|
||||||
|
"refId": "image_0",
|
||||||
|
"sr": 1,
|
||||||
|
"ks": {
|
||||||
|
"o": {
|
||||||
|
"a": 0,
|
||||||
|
"k": 100,
|
||||||
|
"ix": 11
|
||||||
|
},
|
||||||
|
"r": {
|
||||||
|
"a": 1,
|
||||||
|
"k": [
|
||||||
|
{
|
||||||
|
"i": {
|
||||||
|
"x": [
|
||||||
|
0.333
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
1
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"o": {
|
||||||
|
"x": [
|
||||||
|
0.667
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"t": 0,
|
||||||
|
"s": [
|
||||||
|
0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"i": {
|
||||||
|
"x": [
|
||||||
|
0.333
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
1
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"o": {
|
||||||
|
"x": [
|
||||||
|
0.667
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"t": 25,
|
||||||
|
"s": [
|
||||||
|
67
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"t": 50,
|
||||||
|
"s": [
|
||||||
|
0
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"ix": 10
|
||||||
|
},
|
||||||
|
"p": {
|
||||||
|
"a": 0,
|
||||||
|
"k": [
|
||||||
|
623.019,
|
||||||
|
296.734,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"ix": 2
|
||||||
|
},
|
||||||
|
"a": {
|
||||||
|
"a": 0,
|
||||||
|
"k": [
|
||||||
|
623.019,
|
||||||
|
296.734,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"ix": 1
|
||||||
|
},
|
||||||
|
"s": {
|
||||||
|
"a": 0,
|
||||||
|
"k": [
|
||||||
|
100,
|
||||||
|
100,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"ix": 6
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ao": 0,
|
||||||
|
"ip": 0,
|
||||||
|
"op": 250,
|
||||||
|
"st": 0,
|
||||||
|
"bm": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ddd": 0,
|
||||||
|
"ind": 3,
|
||||||
|
"ty": 2,
|
||||||
|
"nm": "F ARM Low",
|
||||||
|
"parent": 2,
|
||||||
|
"refId": "image_1",
|
||||||
|
"sr": 1,
|
||||||
|
"ks": {
|
||||||
|
"o": {
|
||||||
|
"a": 0,
|
||||||
|
"k": 100,
|
||||||
|
"ix": 11
|
||||||
|
},
|
||||||
|
"r": {
|
||||||
|
"a": 1,
|
||||||
|
"k": [
|
||||||
|
{
|
||||||
|
"i": {
|
||||||
|
"x": [
|
||||||
|
0.333
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
1
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"o": {
|
||||||
|
"x": [
|
||||||
|
0.667
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"t": 0,
|
||||||
|
"s": [
|
||||||
|
43
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"i": {
|
||||||
|
"x": [
|
||||||
|
0.333
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
1
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"o": {
|
||||||
|
"x": [
|
||||||
|
0.667
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"t": 25,
|
||||||
|
"s": [
|
||||||
|
0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"t": 50,
|
||||||
|
"s": [
|
||||||
|
43
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"ix": 10
|
||||||
|
},
|
||||||
|
"p": {
|
||||||
|
"a": 0,
|
||||||
|
"k": [
|
||||||
|
623.019,
|
||||||
|
439.113,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"ix": 2
|
||||||
|
},
|
||||||
|
"a": {
|
||||||
|
"a": 0,
|
||||||
|
"k": [
|
||||||
|
623.019,
|
||||||
|
439.113,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"ix": 1
|
||||||
|
},
|
||||||
|
"s": {
|
||||||
|
"a": 0,
|
||||||
|
"k": [
|
||||||
|
100,
|
||||||
|
100,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"ix": 6
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ao": 0,
|
||||||
|
"ip": 0,
|
||||||
|
"op": 250,
|
||||||
|
"st": 0,
|
||||||
|
"bm": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ddd": 0,
|
||||||
|
"ind": 4,
|
||||||
|
"ty": 2,
|
||||||
|
"nm": "F Hand",
|
||||||
|
"parent": 3,
|
||||||
|
"refId": "image_2",
|
||||||
|
"sr": 1,
|
||||||
|
"ks": {
|
||||||
|
"o": {
|
||||||
|
"a": 0,
|
||||||
|
"k": 100,
|
||||||
|
"ix": 11
|
||||||
|
},
|
||||||
|
"r": {
|
||||||
|
"a": 1,
|
||||||
|
"k": [
|
||||||
|
{
|
||||||
|
"i": {
|
||||||
|
"x": [
|
||||||
|
0.333
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
1
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"o": {
|
||||||
|
"x": [
|
||||||
|
0.667
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"t": 0,
|
||||||
|
"s": [
|
||||||
|
41
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"i": {
|
||||||
|
"x": [
|
||||||
|
0.333
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
1
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"o": {
|
||||||
|
"x": [
|
||||||
|
0.667
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"t": 25,
|
||||||
|
"s": [
|
||||||
|
0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"t": 50,
|
||||||
|
"s": [
|
||||||
|
41
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"ix": 10
|
||||||
|
},
|
||||||
|
"p": {
|
||||||
|
"a": 0,
|
||||||
|
"k": [
|
||||||
|
623.019,
|
||||||
|
584.501,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"ix": 2
|
||||||
|
},
|
||||||
|
"a": {
|
||||||
|
"a": 0,
|
||||||
|
"k": [
|
||||||
|
623.019,
|
||||||
|
584.501,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"ix": 1
|
||||||
|
},
|
||||||
|
"s": {
|
||||||
|
"a": 0,
|
||||||
|
"k": [
|
||||||
|
100,
|
||||||
|
100,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"ix": 6
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ao": 0,
|
||||||
|
"ip": 0,
|
||||||
|
"op": 250,
|
||||||
|
"st": 0,
|
||||||
|
"bm": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ddd": 0,
|
||||||
|
"ind": 5,
|
||||||
|
"ty": 2,
|
||||||
|
"nm": "F LEG Up",
|
||||||
|
"refId": "image_3",
|
||||||
|
"sr": 1,
|
||||||
|
"ks": {
|
||||||
|
"o": {
|
||||||
|
"a": 0,
|
||||||
|
"k": 100,
|
||||||
|
"ix": 11
|
||||||
|
},
|
||||||
|
"r": {
|
||||||
|
"a": 0,
|
||||||
|
"k": 90,
|
||||||
|
"ix": 10
|
||||||
|
},
|
||||||
|
"p": {
|
||||||
|
"a": 0,
|
||||||
|
"k": [
|
||||||
|
604.854,
|
||||||
|
589.662,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"ix": 2
|
||||||
|
},
|
||||||
|
"a": {
|
||||||
|
"a": 0,
|
||||||
|
"k": [
|
||||||
|
604.854,
|
||||||
|
589.662,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"ix": 1
|
||||||
|
},
|
||||||
|
"s": {
|
||||||
|
"a": 0,
|
||||||
|
"k": [
|
||||||
|
100,
|
||||||
|
100,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"ix": 6
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ao": 0,
|
||||||
|
"ip": 0,
|
||||||
|
"op": 250,
|
||||||
|
"st": 0,
|
||||||
|
"bm": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ddd": 0,
|
||||||
|
"ind": 6,
|
||||||
|
"ty": 2,
|
||||||
|
"nm": "F LEG Low",
|
||||||
|
"parent": 5,
|
||||||
|
"refId": "image_4",
|
||||||
|
"sr": 1,
|
||||||
|
"ks": {
|
||||||
|
"o": {
|
||||||
|
"a": 0,
|
||||||
|
"k": 100,
|
||||||
|
"ix": 11
|
||||||
|
},
|
||||||
|
"r": {
|
||||||
|
"a": 0,
|
||||||
|
"k": -90,
|
||||||
|
"ix": 10
|
||||||
|
},
|
||||||
|
"p": {
|
||||||
|
"a": 0,
|
||||||
|
"k": [
|
||||||
|
608.016,
|
||||||
|
829.202,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"ix": 2
|
||||||
|
},
|
||||||
|
"a": {
|
||||||
|
"a": 0,
|
||||||
|
"k": [
|
||||||
|
608.016,
|
||||||
|
829.202,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"ix": 1
|
||||||
|
},
|
||||||
|
"s": {
|
||||||
|
"a": 0,
|
||||||
|
"k": [
|
||||||
|
100,
|
||||||
|
100,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"ix": 6
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ao": 0,
|
||||||
|
"ip": 0,
|
||||||
|
"op": 250,
|
||||||
|
"st": 0,
|
||||||
|
"bm": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ddd": 0,
|
||||||
|
"ind": 7,
|
||||||
|
"ty": 2,
|
||||||
|
"nm": "F Foot",
|
||||||
|
"parent": 6,
|
||||||
|
"refId": "image_5",
|
||||||
|
"sr": 1,
|
||||||
|
"ks": {
|
||||||
|
"o": {
|
||||||
|
"a": 0,
|
||||||
|
"k": 100,
|
||||||
|
"ix": 11
|
||||||
|
},
|
||||||
|
"r": {
|
||||||
|
"a": 0,
|
||||||
|
"k": 0,
|
||||||
|
"ix": 10
|
||||||
|
},
|
||||||
|
"p": {
|
||||||
|
"a": 0,
|
||||||
|
"k": [
|
||||||
|
608.863,
|
||||||
|
1058.742,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"ix": 2
|
||||||
|
},
|
||||||
|
"a": {
|
||||||
|
"a": 0,
|
||||||
|
"k": [
|
||||||
|
608.863,
|
||||||
|
1058.742,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"ix": 1
|
||||||
|
},
|
||||||
|
"s": {
|
||||||
|
"a": 0,
|
||||||
|
"k": [
|
||||||
|
100,
|
||||||
|
100,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"ix": 6
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ao": 0,
|
||||||
|
"ip": 0,
|
||||||
|
"op": 250,
|
||||||
|
"st": 0,
|
||||||
|
"bm": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ddd": 0,
|
||||||
|
"ind": 8,
|
||||||
|
"ty": 2,
|
||||||
|
"nm": "Body",
|
||||||
|
"parent": 11,
|
||||||
|
"refId": "image_6",
|
||||||
|
"sr": 1,
|
||||||
|
"ks": {
|
||||||
|
"o": {
|
||||||
|
"a": 0,
|
||||||
|
"k": 100,
|
||||||
|
"ix": 11
|
||||||
|
},
|
||||||
|
"r": {
|
||||||
|
"a": 0,
|
||||||
|
"k": 0,
|
||||||
|
"ix": 10
|
||||||
|
},
|
||||||
|
"p": {
|
||||||
|
"a": 0,
|
||||||
|
"k": [
|
||||||
|
605.434,
|
||||||
|
468.468,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"ix": 2
|
||||||
|
},
|
||||||
|
"a": {
|
||||||
|
"a": 0,
|
||||||
|
"k": [
|
||||||
|
605.434,
|
||||||
|
468.468,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"ix": 1
|
||||||
|
},
|
||||||
|
"s": {
|
||||||
|
"a": 0,
|
||||||
|
"k": [
|
||||||
|
100,
|
||||||
|
100,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"ix": 6
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ao": 0,
|
||||||
|
"ip": 0,
|
||||||
|
"op": 250,
|
||||||
|
"st": 0,
|
||||||
|
"bm": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ddd": 0,
|
||||||
|
"ind": 9,
|
||||||
|
"ty": 2,
|
||||||
|
"nm": "Head",
|
||||||
|
"parent": 8,
|
||||||
|
"refId": "image_7",
|
||||||
|
"sr": 1,
|
||||||
|
"ks": {
|
||||||
|
"o": {
|
||||||
|
"a": 0,
|
||||||
|
"k": 100,
|
||||||
|
"ix": 11
|
||||||
|
},
|
||||||
|
"r": {
|
||||||
|
"a": 0,
|
||||||
|
"k": 0,
|
||||||
|
"ix": 10
|
||||||
|
},
|
||||||
|
"p": {
|
||||||
|
"a": 0,
|
||||||
|
"k": [
|
||||||
|
623.019,
|
||||||
|
263.511,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"ix": 2
|
||||||
|
},
|
||||||
|
"a": {
|
||||||
|
"a": 0,
|
||||||
|
"k": [
|
||||||
|
623.019,
|
||||||
|
263.511,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"ix": 1
|
||||||
|
},
|
||||||
|
"s": {
|
||||||
|
"a": 0,
|
||||||
|
"k": [
|
||||||
|
100,
|
||||||
|
100,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"ix": 6
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ao": 0,
|
||||||
|
"ip": 0,
|
||||||
|
"op": 250,
|
||||||
|
"st": 0,
|
||||||
|
"bm": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ddd": 0,
|
||||||
|
"ind": 10,
|
||||||
|
"ty": 2,
|
||||||
|
"nm": "Hair",
|
||||||
|
"parent": 9,
|
||||||
|
"refId": "image_8",
|
||||||
|
"sr": 1,
|
||||||
|
"ks": {
|
||||||
|
"o": {
|
||||||
|
"a": 0,
|
||||||
|
"k": 100,
|
||||||
|
"ix": 11
|
||||||
|
},
|
||||||
|
"r": {
|
||||||
|
"a": 0,
|
||||||
|
"k": 0,
|
||||||
|
"ix": 10
|
||||||
|
},
|
||||||
|
"p": {
|
||||||
|
"a": 0,
|
||||||
|
"k": [
|
||||||
|
600,
|
||||||
|
600,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"ix": 2
|
||||||
|
},
|
||||||
|
"a": {
|
||||||
|
"a": 0,
|
||||||
|
"k": [
|
||||||
|
600,
|
||||||
|
600,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"ix": 1
|
||||||
|
},
|
||||||
|
"s": {
|
||||||
|
"a": 0,
|
||||||
|
"k": [
|
||||||
|
100,
|
||||||
|
100,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"ix": 6
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ao": 0,
|
||||||
|
"ip": 0,
|
||||||
|
"op": 250,
|
||||||
|
"st": 0,
|
||||||
|
"bm": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ddd": 0,
|
||||||
|
"ind": 11,
|
||||||
|
"ty": 2,
|
||||||
|
"nm": "Waist",
|
||||||
|
"refId": "image_9",
|
||||||
|
"sr": 1,
|
||||||
|
"ks": {
|
||||||
|
"o": {
|
||||||
|
"a": 0,
|
||||||
|
"k": 100,
|
||||||
|
"ix": 11
|
||||||
|
},
|
||||||
|
"r": {
|
||||||
|
"a": 1,
|
||||||
|
"k": [
|
||||||
|
{
|
||||||
|
"i": {
|
||||||
|
"x": [
|
||||||
|
0.333
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
1
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"o": {
|
||||||
|
"x": [
|
||||||
|
0.667
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"t": 0,
|
||||||
|
"s": [
|
||||||
|
0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"i": {
|
||||||
|
"x": [
|
||||||
|
0.333
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
1
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"o": {
|
||||||
|
"x": [
|
||||||
|
0.667
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"t": 25,
|
||||||
|
"s": [
|
||||||
|
-70
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"t": 50,
|
||||||
|
"s": [
|
||||||
|
0
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"ix": 10
|
||||||
|
},
|
||||||
|
"p": {
|
||||||
|
"a": 0,
|
||||||
|
"k": [
|
||||||
|
604.854,
|
||||||
|
589.662,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"ix": 2
|
||||||
|
},
|
||||||
|
"a": {
|
||||||
|
"a": 0,
|
||||||
|
"k": [
|
||||||
|
604.854,
|
||||||
|
589.662,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"ix": 1
|
||||||
|
},
|
||||||
|
"s": {
|
||||||
|
"a": 0,
|
||||||
|
"k": [
|
||||||
|
100,
|
||||||
|
100,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"ix": 6
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ao": 0,
|
||||||
|
"ip": 0,
|
||||||
|
"op": 250,
|
||||||
|
"st": 0,
|
||||||
|
"bm": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"markers": [
|
||||||
|
{
|
||||||
|
"tm": 25,
|
||||||
|
"cm": "9",
|
||||||
|
"dr": 0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
BIN
example/assets/example_with_images/images/img_0.png
Normal file
After Width: | Height: | Size: 7.5 KiB |
10
example/assets/example_with_images/images/img_0.svg
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Generator: Adobe Illustrator 24.1.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||||
|
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||||
|
viewBox="0 0 1200 1200" style="enable-background:new 0 0 1200 1200;" xml:space="preserve">
|
||||||
|
<style type="text/css">
|
||||||
|
.st0{fill:#FFA913;}
|
||||||
|
</style>
|
||||||
|
<path class="st0" d="M641.59,439.11l7.69-142.38c0-14.5-11.76-26.26-26.26-26.26c-14.5,0-26.26,11.76-26.26,26.26l7.69,142.38
|
||||||
|
c0,10.26,8.31,18.57,18.57,18.57C633.28,457.68,641.59,449.37,641.59,439.11z"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 616 B |
BIN
example/assets/example_with_images/images/img_1.png
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
example/assets/example_with_images/images/img_2.png
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
example/assets/example_with_images/images/img_3.png
Normal file
After Width: | Height: | Size: 9.3 KiB |
BIN
example/assets/example_with_images/images/img_4.png
Normal file
After Width: | Height: | Size: 8.4 KiB |
BIN
example/assets/example_with_images/images/img_5.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
example/assets/example_with_images/images/img_6.png
Normal file
After Width: | Height: | Size: 8.5 KiB |
BIN
example/assets/example_with_images/images/img_7.png
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
example/assets/example_with_images/images/img_8.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
example/assets/example_with_images/images/img_9.png
Normal file
After Width: | Height: | Size: 8.7 KiB |
118232
example/assets/playing.json
Normal file
@ -1,6 +1,7 @@
|
|||||||
// Generated from tool/generate_file_list.dart
|
// Generated from tool/generate_file_list.dart
|
||||||
final files = [
|
final files = [
|
||||||
'assets/14595-thumbs-up.json',
|
'assets/14595-thumbs-up.json',
|
||||||
|
'assets/17297-fireworks.json',
|
||||||
'assets/AndroidWave.json',
|
'assets/AndroidWave.json',
|
||||||
'assets/DynamicGradient.json',
|
'assets/DynamicGradient.json',
|
||||||
'assets/HamburgerArrow.json',
|
'assets/HamburgerArrow.json',
|
||||||
@ -106,6 +107,10 @@ final files = [
|
|||||||
'assets/Tests/dalek_converted.json',
|
'assets/Tests/dalek_converted.json',
|
||||||
'assets/Tests/hd.json',
|
'assets/Tests/hd.json',
|
||||||
'assets/Tests/map.zip',
|
'assets/Tests/map.zip',
|
||||||
|
'assets/TwitterHeartButton.json',
|
||||||
|
'assets/_loading_indicator.json',
|
||||||
|
'assets/bluetoothscanning.json',
|
||||||
|
'assets/example_with_images/data.json',
|
||||||
'assets/lf20_w2Afea.json',
|
'assets/lf20_w2Afea.json',
|
||||||
'assets/lottiefiles/100_percent.json',
|
'assets/lottiefiles/100_percent.json',
|
||||||
'assets/lottiefiles/Plane.json',
|
'assets/lottiefiles/Plane.json',
|
||||||
@ -340,4 +345,11 @@ final files = [
|
|||||||
'assets/lottiefiles/xuanwheel_logo.json',
|
'assets/lottiefiles/xuanwheel_logo.json',
|
||||||
'assets/lottiefiles/yoga_carpet.json',
|
'assets/lottiefiles/yoga_carpet.json',
|
||||||
'assets/lottiefiles/youtube_icon_reveal.json',
|
'assets/lottiefiles/youtube_icon_reveal.json',
|
||||||
|
'assets/playing.json',
|
||||||
|
'assets/weather/_hurricane.json',
|
||||||
|
'assets/weather/fog.json',
|
||||||
|
'assets/weather/hurricane.json',
|
||||||
|
'assets/weather/thunder-storm.json',
|
||||||
|
'assets/weather/tornado.json',
|
||||||
|
'assets/weather/windy.json',
|
||||||
];
|
];
|
||||||
|
@ -129,7 +129,7 @@ packages:
|
|||||||
path: ".."
|
path: ".."
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "0.3.6"
|
version: "0.4.0"
|
||||||
matcher:
|
matcher:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -35,6 +35,8 @@ flutter:
|
|||||||
- assets/Images/
|
- assets/Images/
|
||||||
- assets/Images/WeAccept/
|
- assets/Images/WeAccept/
|
||||||
- assets/Weather/
|
- assets/Weather/
|
||||||
|
- assets/example_with_images/
|
||||||
|
- assets/example_with_images/images/
|
||||||
|
|
||||||
fonts:
|
fonts:
|
||||||
- family: Comic Neue
|
- family: Comic Neue
|
||||||
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 32 KiB |
BIN
example/test/goldens/all/bluetoothscanning.png
Normal file
After Width: | Height: | Size: 45 KiB |
BIN
example/test/goldens/all/example_with_images/data.png
Normal file
After Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 884 B After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 91 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 884 B After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 7.0 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 138 KiB After Width: | Height: | Size: 139 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
BIN
example/test/goldens/all/playing.png
Normal file
After Width: | Height: | Size: 58 KiB |
@ -5,6 +5,7 @@ export 'src/lottie_delegates.dart' show LottieDelegates;
|
|||||||
export 'src/lottie_drawable.dart' show LottieDrawable, LottieFontStyle;
|
export 'src/lottie_drawable.dart' show LottieDrawable, LottieFontStyle;
|
||||||
export 'src/lottie_image_asset.dart' show LottieImageAsset;
|
export 'src/lottie_image_asset.dart' show LottieImageAsset;
|
||||||
export 'src/model/marker.dart' show Marker;
|
export 'src/model/marker.dart' show Marker;
|
||||||
|
export 'src/options.dart' show LottieOptions;
|
||||||
export 'src/providers/asset_provider.dart' show AssetLottie;
|
export 'src/providers/asset_provider.dart' show AssetLottie;
|
||||||
export 'src/providers/file_provider.dart' show FileLottie;
|
export 'src/providers/file_provider.dart' show FileLottie;
|
||||||
export 'src/providers/lottie_provider.dart' show LottieProvider;
|
export 'src/providers/lottie_provider.dart' show LottieProvider;
|
||||||
|
@ -5,6 +5,7 @@ import 'package:flutter/widgets.dart';
|
|||||||
import '../lottie.dart';
|
import '../lottie.dart';
|
||||||
import 'l.dart';
|
import 'l.dart';
|
||||||
import 'lottie_builder.dart';
|
import 'lottie_builder.dart';
|
||||||
|
import 'options.dart';
|
||||||
import 'providers/load_image.dart';
|
import 'providers/load_image.dart';
|
||||||
|
|
||||||
/// A widget to display a loaded [LottieComposition].
|
/// A widget to display a loaded [LottieComposition].
|
||||||
@ -25,6 +26,7 @@ class Lottie extends StatefulWidget {
|
|||||||
bool repeat,
|
bool repeat,
|
||||||
bool reverse,
|
bool reverse,
|
||||||
this.delegates,
|
this.delegates,
|
||||||
|
this.options,
|
||||||
}) : animate = animate ?? true,
|
}) : animate = animate ?? true,
|
||||||
reverse = reverse ?? false,
|
reverse = reverse ?? false,
|
||||||
repeat = repeat ?? true,
|
repeat = repeat ?? true,
|
||||||
@ -37,6 +39,7 @@ class Lottie extends StatefulWidget {
|
|||||||
bool repeat,
|
bool repeat,
|
||||||
bool reverse,
|
bool reverse,
|
||||||
LottieDelegates delegates,
|
LottieDelegates delegates,
|
||||||
|
LottieOptions options,
|
||||||
void Function(LottieComposition) onLoaded,
|
void Function(LottieComposition) onLoaded,
|
||||||
LottieImageProviderFactory imageProviderFactory,
|
LottieImageProviderFactory imageProviderFactory,
|
||||||
Key key,
|
Key key,
|
||||||
@ -54,6 +57,7 @@ class Lottie extends StatefulWidget {
|
|||||||
repeat: repeat,
|
repeat: repeat,
|
||||||
reverse: reverse,
|
reverse: reverse,
|
||||||
delegates: delegates,
|
delegates: delegates,
|
||||||
|
options: options,
|
||||||
imageProviderFactory: imageProviderFactory,
|
imageProviderFactory: imageProviderFactory,
|
||||||
onLoaded: onLoaded,
|
onLoaded: onLoaded,
|
||||||
key: key,
|
key: key,
|
||||||
@ -74,6 +78,7 @@ class Lottie extends StatefulWidget {
|
|||||||
bool repeat,
|
bool repeat,
|
||||||
bool reverse,
|
bool reverse,
|
||||||
LottieDelegates delegates,
|
LottieDelegates delegates,
|
||||||
|
LottieOptions options,
|
||||||
LottieImageProviderFactory imageProviderFactory,
|
LottieImageProviderFactory imageProviderFactory,
|
||||||
void Function(LottieComposition) onLoaded,
|
void Function(LottieComposition) onLoaded,
|
||||||
Key key,
|
Key key,
|
||||||
@ -90,6 +95,7 @@ class Lottie extends StatefulWidget {
|
|||||||
repeat: repeat,
|
repeat: repeat,
|
||||||
reverse: reverse,
|
reverse: reverse,
|
||||||
delegates: delegates,
|
delegates: delegates,
|
||||||
|
options: options,
|
||||||
imageProviderFactory: imageProviderFactory,
|
imageProviderFactory: imageProviderFactory,
|
||||||
onLoaded: onLoaded,
|
onLoaded: onLoaded,
|
||||||
key: key,
|
key: key,
|
||||||
@ -108,6 +114,7 @@ class Lottie extends StatefulWidget {
|
|||||||
bool repeat,
|
bool repeat,
|
||||||
bool reverse,
|
bool reverse,
|
||||||
LottieDelegates delegates,
|
LottieDelegates delegates,
|
||||||
|
LottieOptions options,
|
||||||
LottieImageProviderFactory imageProviderFactory,
|
LottieImageProviderFactory imageProviderFactory,
|
||||||
void Function(LottieComposition) onLoaded,
|
void Function(LottieComposition) onLoaded,
|
||||||
Key key,
|
Key key,
|
||||||
@ -124,6 +131,7 @@ class Lottie extends StatefulWidget {
|
|||||||
repeat: repeat,
|
repeat: repeat,
|
||||||
reverse: reverse,
|
reverse: reverse,
|
||||||
delegates: delegates,
|
delegates: delegates,
|
||||||
|
options: options,
|
||||||
imageProviderFactory: imageProviderFactory,
|
imageProviderFactory: imageProviderFactory,
|
||||||
onLoaded: onLoaded,
|
onLoaded: onLoaded,
|
||||||
key: key,
|
key: key,
|
||||||
@ -142,6 +150,7 @@ class Lottie extends StatefulWidget {
|
|||||||
bool repeat,
|
bool repeat,
|
||||||
bool reverse,
|
bool reverse,
|
||||||
LottieDelegates delegates,
|
LottieDelegates delegates,
|
||||||
|
LottieOptions options,
|
||||||
LottieImageProviderFactory imageProviderFactory,
|
LottieImageProviderFactory imageProviderFactory,
|
||||||
void Function(LottieComposition) onLoaded,
|
void Function(LottieComposition) onLoaded,
|
||||||
Key key,
|
Key key,
|
||||||
@ -158,6 +167,7 @@ class Lottie extends StatefulWidget {
|
|||||||
repeat: repeat,
|
repeat: repeat,
|
||||||
reverse: reverse,
|
reverse: reverse,
|
||||||
delegates: delegates,
|
delegates: delegates,
|
||||||
|
options: options,
|
||||||
imageProviderFactory: imageProviderFactory,
|
imageProviderFactory: imageProviderFactory,
|
||||||
onLoaded: onLoaded,
|
onLoaded: onLoaded,
|
||||||
key: key,
|
key: key,
|
||||||
@ -229,13 +239,17 @@ class Lottie extends StatefulWidget {
|
|||||||
/// relative to text direction.
|
/// relative to text direction.
|
||||||
final AlignmentGeometry alignment;
|
final AlignmentGeometry alignment;
|
||||||
|
|
||||||
/// A group of options to further customize the lottie animation.
|
/// A group of callbacks to further customize the lottie animation.
|
||||||
/// - A [text] delegate to dynamically change some text displayed in the animation
|
/// - A [text] delegate to dynamically change some text displayed in the animation
|
||||||
/// - A value callback to change the properties of the animation at runtime.
|
/// - A value callback to change the properties of the animation at runtime.
|
||||||
/// - A text style factory to map between a font family specified in the animation
|
/// - A text style factory to map between a font family specified in the animation
|
||||||
/// and the font family in your assets.
|
/// and the font family in your assets.
|
||||||
final LottieDelegates delegates;
|
final LottieDelegates delegates;
|
||||||
|
|
||||||
|
/// Some options to enable/disable some feature of Lottie
|
||||||
|
/// - enableMergePaths: Enable merge path support
|
||||||
|
final LottieOptions options;
|
||||||
|
|
||||||
static bool get traceEnabled => L.traceEnabled;
|
static bool get traceEnabled => L.traceEnabled;
|
||||||
static set traceEnabled(bool enabled) {
|
static set traceEnabled(bool enabled) {
|
||||||
L.traceEnabled = enabled;
|
L.traceEnabled = enabled;
|
||||||
@ -295,6 +309,7 @@ class _LottieState extends State<Lottie> with TickerProviderStateMixin {
|
|||||||
builder: (context, _) => RawLottie(
|
builder: (context, _) => RawLottie(
|
||||||
composition: widget.composition,
|
composition: widget.composition,
|
||||||
delegates: widget.delegates,
|
delegates: widget.delegates,
|
||||||
|
options: widget.options,
|
||||||
progress: _progressAnimation.value,
|
progress: _progressAnimation.value,
|
||||||
width: widget.width,
|
width: widget.width,
|
||||||
height: widget.height,
|
height: widget.height,
|
||||||
|
@ -40,6 +40,7 @@ class LottieBuilder extends StatefulWidget {
|
|||||||
this.reverse,
|
this.reverse,
|
||||||
this.repeat,
|
this.repeat,
|
||||||
this.delegates,
|
this.delegates,
|
||||||
|
this.options,
|
||||||
this.onLoaded,
|
this.onLoaded,
|
||||||
this.frameBuilder,
|
this.frameBuilder,
|
||||||
this.width,
|
this.width,
|
||||||
@ -58,6 +59,7 @@ class LottieBuilder extends StatefulWidget {
|
|||||||
this.reverse,
|
this.reverse,
|
||||||
this.repeat,
|
this.repeat,
|
||||||
this.delegates,
|
this.delegates,
|
||||||
|
this.options,
|
||||||
LottieImageProviderFactory imageProviderFactory,
|
LottieImageProviderFactory imageProviderFactory,
|
||||||
this.onLoaded,
|
this.onLoaded,
|
||||||
Key key,
|
Key key,
|
||||||
@ -87,6 +89,7 @@ class LottieBuilder extends StatefulWidget {
|
|||||||
this.reverse,
|
this.reverse,
|
||||||
this.repeat,
|
this.repeat,
|
||||||
this.delegates,
|
this.delegates,
|
||||||
|
this.options,
|
||||||
LottieImageProviderFactory imageProviderFactory,
|
LottieImageProviderFactory imageProviderFactory,
|
||||||
this.onLoaded,
|
this.onLoaded,
|
||||||
Key key,
|
Key key,
|
||||||
@ -106,6 +109,7 @@ class LottieBuilder extends StatefulWidget {
|
|||||||
this.reverse,
|
this.reverse,
|
||||||
this.repeat,
|
this.repeat,
|
||||||
this.delegates,
|
this.delegates,
|
||||||
|
this.options,
|
||||||
LottieImageProviderFactory imageProviderFactory,
|
LottieImageProviderFactory imageProviderFactory,
|
||||||
this.onLoaded,
|
this.onLoaded,
|
||||||
Key key,
|
Key key,
|
||||||
@ -130,6 +134,7 @@ class LottieBuilder extends StatefulWidget {
|
|||||||
this.reverse,
|
this.reverse,
|
||||||
this.repeat,
|
this.repeat,
|
||||||
this.delegates,
|
this.delegates,
|
||||||
|
this.options,
|
||||||
LottieImageProviderFactory imageProviderFactory,
|
LottieImageProviderFactory imageProviderFactory,
|
||||||
this.onLoaded,
|
this.onLoaded,
|
||||||
Key key,
|
Key key,
|
||||||
@ -180,6 +185,10 @@ class LottieBuilder extends StatefulWidget {
|
|||||||
/// and the font family in your assets.
|
/// and the font family in your assets.
|
||||||
final LottieDelegates delegates;
|
final LottieDelegates delegates;
|
||||||
|
|
||||||
|
/// Some options to enable/disable some feature of Lottie
|
||||||
|
/// - enableMergePaths: Enable merge path support
|
||||||
|
final LottieOptions options;
|
||||||
|
|
||||||
/// A builder function responsible for creating the widget that represents
|
/// A builder function responsible for creating the widget that represents
|
||||||
/// this lottie animation.
|
/// this lottie animation.
|
||||||
///
|
///
|
||||||
@ -379,6 +388,7 @@ class _LottieBuilderState extends State<LottieBuilder> {
|
|||||||
reverse: widget.reverse,
|
reverse: widget.reverse,
|
||||||
repeat: widget.repeat,
|
repeat: widget.repeat,
|
||||||
delegates: widget.delegates,
|
delegates: widget.delegates,
|
||||||
|
options: widget.options,
|
||||||
width: widget.width,
|
width: widget.width,
|
||||||
height: widget.height,
|
height: widget.height,
|
||||||
fit: widget.fit,
|
fit: widget.fit,
|
||||||
|
@ -15,10 +15,13 @@ class LottieDrawable {
|
|||||||
final Size size;
|
final Size size;
|
||||||
LottieDelegates _delegates;
|
LottieDelegates _delegates;
|
||||||
bool _isDirty = true;
|
bool _isDirty = true;
|
||||||
|
final bool enableMergePaths;
|
||||||
|
|
||||||
LottieDrawable(this.composition, {LottieDelegates delegates})
|
LottieDrawable(this.composition,
|
||||||
|
{LottieDelegates delegates, bool enableMergePaths})
|
||||||
: size = Size(composition.bounds.width.toDouble(),
|
: size = Size(composition.bounds.width.toDouble(),
|
||||||
composition.bounds.height.toDouble()) {
|
composition.bounds.height.toDouble()),
|
||||||
|
enableMergePaths = enableMergePaths ?? false {
|
||||||
this.delegates = delegates;
|
this.delegates = delegates;
|
||||||
_compositionLayer = CompositionLayer(
|
_compositionLayer = CompositionLayer(
|
||||||
this, LayerParser.parse(composition), composition.layers, composition);
|
this, LayerParser.parse(composition), composition.layers, composition);
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import '../../animation/content/content.dart';
|
import '../../animation/content/content.dart';
|
||||||
import '../../animation/content/merge_paths_content.dart';
|
import '../../animation/content/merge_paths_content.dart';
|
||||||
|
import '../../logger.dart';
|
||||||
import '../../lottie_drawable.dart';
|
import '../../lottie_drawable.dart';
|
||||||
import '../layer/base_layer.dart';
|
import '../layer/base_layer.dart';
|
||||||
import 'content_model.dart';
|
import 'content_model.dart';
|
||||||
@ -15,6 +16,10 @@ class MergePaths implements ContentModel {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Content /*?*/ toContent(LottieDrawable drawable, BaseLayer layer) {
|
Content /*?*/ toContent(LottieDrawable drawable, BaseLayer layer) {
|
||||||
|
if (!drawable.enableMergePaths) {
|
||||||
|
logger.warning('Animation contains merge paths but they are disabled.');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return MergePathsContent(this);
|
return MergePathsContent(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
11
lib/src/options.dart
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
class LottieOptions {
|
||||||
|
/// Enable merge path support.
|
||||||
|
///
|
||||||
|
/// Merge paths currently don't work if the the operand shape is entirely contained within the
|
||||||
|
/// first shape. If you need to cut out one shape from another shape, use an even-odd fill type
|
||||||
|
/// instead of using merge paths.
|
||||||
|
final bool enableMergePaths;
|
||||||
|
|
||||||
|
LottieOptions({bool enableMergePaths})
|
||||||
|
: enableMergePaths = enableMergePaths ?? false;
|
||||||
|
}
|
@ -85,6 +85,8 @@ class ContentModelParser {
|
|||||||
break;
|
break;
|
||||||
case 'mm':
|
case 'mm':
|
||||||
model = MergePathsParser.parse(reader);
|
model = MergePathsParser.parse(reader);
|
||||||
|
composition.addWarning('Animation contains merge paths. '
|
||||||
|
'Merge paths must be manually enabled by settings enableMergePaths.');
|
||||||
break;
|
break;
|
||||||
case 'rp':
|
case 'rp':
|
||||||
model = RepeaterParser.parse(reader, composition);
|
model = RepeaterParser.parse(reader, composition);
|
||||||
|
@ -122,6 +122,7 @@ class LayerParser {
|
|||||||
if (layerTypeInt < LayerType.unknown.index) {
|
if (layerTypeInt < LayerType.unknown.index) {
|
||||||
layerType = LayerType.values[layerTypeInt];
|
layerType = LayerType.values[layerTypeInt];
|
||||||
} else {
|
} else {
|
||||||
|
print('Unknown $layerTypeInt');
|
||||||
layerType = LayerType.unknown;
|
layerType = LayerType.unknown;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -13,6 +13,7 @@ class RawLottie extends LeafRenderObjectWidget {
|
|||||||
Key key,
|
Key key,
|
||||||
this.composition,
|
this.composition,
|
||||||
this.delegates,
|
this.delegates,
|
||||||
|
this.options,
|
||||||
double progress,
|
double progress,
|
||||||
this.width,
|
this.width,
|
||||||
this.height,
|
this.height,
|
||||||
@ -28,6 +29,8 @@ class RawLottie extends LeafRenderObjectWidget {
|
|||||||
/// Allows to modify the Lottie animation at runtime
|
/// Allows to modify the Lottie animation at runtime
|
||||||
final LottieDelegates delegates;
|
final LottieDelegates delegates;
|
||||||
|
|
||||||
|
final LottieOptions options;
|
||||||
|
|
||||||
/// The progress of the Lottie animation (between 0.0 and 1.0).
|
/// The progress of the Lottie animation (between 0.0 and 1.0).
|
||||||
final double progress;
|
final double progress;
|
||||||
|
|
||||||
@ -71,6 +74,7 @@ class RawLottie extends LeafRenderObjectWidget {
|
|||||||
return RenderLottie(
|
return RenderLottie(
|
||||||
composition: composition,
|
composition: composition,
|
||||||
delegates: delegates,
|
delegates: delegates,
|
||||||
|
enableMergePaths: options?.enableMergePaths,
|
||||||
progress: progress,
|
progress: progress,
|
||||||
width: width,
|
width: width,
|
||||||
height: height,
|
height: height,
|
||||||
@ -82,7 +86,10 @@ class RawLottie extends LeafRenderObjectWidget {
|
|||||||
@override
|
@override
|
||||||
void updateRenderObject(BuildContext context, RenderLottie renderObject) {
|
void updateRenderObject(BuildContext context, RenderLottie renderObject) {
|
||||||
renderObject
|
renderObject
|
||||||
..setComposition(composition, progress: progress, delegates: delegates)
|
..setComposition(composition,
|
||||||
|
progress: progress,
|
||||||
|
delegates: delegates,
|
||||||
|
enableMergePaths: options?.enableMergePaths)
|
||||||
..width = width
|
..width = width
|
||||||
..height = height
|
..height = height
|
||||||
..alignment = alignment
|
..alignment = alignment
|
||||||
|
@ -11,6 +11,7 @@ class RenderLottie extends RenderBox {
|
|||||||
RenderLottie({
|
RenderLottie({
|
||||||
LottieComposition composition,
|
LottieComposition composition,
|
||||||
LottieDelegates delegates,
|
LottieDelegates delegates,
|
||||||
|
bool enableMergePaths,
|
||||||
double progress = 0.0,
|
double progress = 0.0,
|
||||||
double width,
|
double width,
|
||||||
double height,
|
double height,
|
||||||
@ -19,7 +20,7 @@ class RenderLottie extends RenderBox {
|
|||||||
}) : assert(alignment != null),
|
}) : assert(alignment != null),
|
||||||
assert(progress != null && progress >= 0.0 && progress <= 1.0),
|
assert(progress != null && progress >= 0.0 && progress <= 1.0),
|
||||||
_drawable = composition != null
|
_drawable = composition != null
|
||||||
? (LottieDrawable(composition)
|
? (LottieDrawable(composition, enableMergePaths: enableMergePaths)
|
||||||
..setProgress(progress)
|
..setProgress(progress)
|
||||||
..delegates = delegates)
|
..delegates = delegates)
|
||||||
: null,
|
: null,
|
||||||
@ -32,7 +33,11 @@ class RenderLottie extends RenderBox {
|
|||||||
LottieComposition get composition => _drawable?.composition;
|
LottieComposition get composition => _drawable?.composition;
|
||||||
LottieDrawable _drawable;
|
LottieDrawable _drawable;
|
||||||
void setComposition(LottieComposition composition,
|
void setComposition(LottieComposition composition,
|
||||||
{@required double progress, @required LottieDelegates delegates}) {
|
{@required double progress,
|
||||||
|
@required LottieDelegates delegates,
|
||||||
|
bool enableMergePaths}) {
|
||||||
|
enableMergePaths ??= false;
|
||||||
|
|
||||||
var needsLayout = false;
|
var needsLayout = false;
|
||||||
var needsPaint = false;
|
var needsPaint = false;
|
||||||
if (composition == null) {
|
if (composition == null) {
|
||||||
@ -40,8 +45,11 @@ class RenderLottie extends RenderBox {
|
|||||||
needsPaint = true;
|
needsPaint = true;
|
||||||
needsLayout = true;
|
needsLayout = true;
|
||||||
} else {
|
} else {
|
||||||
if (_drawable?.composition != composition) {
|
if (_drawable == null ||
|
||||||
_drawable = LottieDrawable(composition);
|
_drawable.composition != composition ||
|
||||||
|
_drawable.enableMergePaths != enableMergePaths) {
|
||||||
|
_drawable =
|
||||||
|
LottieDrawable(composition, enableMergePaths: enableMergePaths);
|
||||||
needsLayout = true;
|
needsLayout = true;
|
||||||
needsPaint = true;
|
needsPaint = true;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: lottie
|
name: lottie
|
||||||
description: Render After Effects animations natively on Flutter. This package is a pure Dart implementation of a Lottie player.
|
description: Render After Effects animations natively on Flutter. This package is a pure Dart implementation of a Lottie player.
|
||||||
version: 0.3.6
|
version: 0.4.0
|
||||||
homepage: https://github.com/xvrh/lottie-flutter
|
homepage: https://github.com/xvrh/lottie-flutter
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
|