mirror of
https://github.com/xvrh/lottie-flutter.git
synced 2025-08-06 16:39:36 +08:00
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
d8f5b872ef |
@ -1,3 +1,6 @@
|
||||
## [1.4.0]
|
||||
- Added `filterQuality` property to control the performance vs quality trade-off to use when drawing images
|
||||
|
||||
## [1.3.0]
|
||||
- Added support for rounded corners on shapes and rects
|
||||
- Add support for text in dynamic properties (`ValueDelegate`)
|
||||
|
@ -64,7 +64,7 @@ class MyApp extends StatefulWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_MyAppState createState() => _MyAppState();
|
||||
State<MyApp> createState() => _MyAppState();
|
||||
}
|
||||
|
||||
class _MyAppState extends State<MyApp> with TickerProviderStateMixin {
|
||||
@ -139,7 +139,7 @@ class MyWidget extends StatefulWidget {
|
||||
const MyWidget({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_MyWidgetState createState() => _MyWidgetState();
|
||||
State<MyWidget> createState() => _MyWidgetState();
|
||||
}
|
||||
|
||||
class _MyWidgetState extends State<MyWidget> {
|
||||
|
@ -25,7 +25,7 @@ class __PageState extends State<_Page> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
SchedulerBinding.instance!.addPostFrameCallback((_) => _showLoader());
|
||||
SchedulerBinding.instance.addPostFrameCallback((_) => _showLoader());
|
||||
}
|
||||
|
||||
void _showLoader() {
|
||||
|
@ -7,7 +7,7 @@ class MyApp extends StatefulWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_MyAppState createState() => _MyAppState();
|
||||
State<MyApp> createState() => _MyAppState();
|
||||
}
|
||||
|
||||
class _MyAppState extends State<MyApp> with TickerProviderStateMixin {
|
||||
|
@ -15,7 +15,7 @@ class MyApp extends StatefulWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_MyAppState createState() => _MyAppState();
|
||||
State<MyApp> createState() => _MyAppState();
|
||||
}
|
||||
|
||||
class _MyAppState extends State<MyApp> with TickerProviderStateMixin {
|
||||
|
@ -21,7 +21,7 @@ class MyWidget extends StatefulWidget {
|
||||
const MyWidget({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_MyWidgetState createState() => _MyWidgetState();
|
||||
State<MyWidget> createState() => _MyWidgetState();
|
||||
}
|
||||
|
||||
class _MyWidgetState extends State<MyWidget> {
|
||||
|
@ -22,7 +22,7 @@ class MyWidget extends StatefulWidget {
|
||||
const MyWidget({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_MyWidgetState createState() => _MyWidgetState();
|
||||
State<MyWidget> createState() => _MyWidgetState();
|
||||
}
|
||||
|
||||
class _MyWidgetState extends State<MyWidget> {
|
||||
|
@ -10,7 +10,7 @@ class App extends StatefulWidget {
|
||||
const App({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_AppState createState() => _AppState();
|
||||
State<App> createState() => _AppState();
|
||||
}
|
||||
|
||||
class _AppState extends State<App> with TickerProviderStateMixin {
|
||||
|
@ -10,7 +10,7 @@ class App extends StatefulWidget {
|
||||
const App({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_AppState createState() => _AppState();
|
||||
State<App> createState() => _AppState();
|
||||
}
|
||||
|
||||
class _AppState extends State<App> with TickerProviderStateMixin {
|
||||
|
@ -9,7 +9,7 @@ class App extends StatefulWidget {
|
||||
const App({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_AppState createState() => _AppState();
|
||||
State<App> createState() => _AppState();
|
||||
}
|
||||
|
||||
class _AppState extends State<App> with TickerProviderStateMixin {
|
||||
|
@ -12,7 +12,7 @@ class App extends StatefulWidget {
|
||||
const App({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_AppState createState() => _AppState();
|
||||
State<App> createState() => _AppState();
|
||||
}
|
||||
|
||||
class _AppState extends State<App> with TickerProviderStateMixin {
|
||||
|
@ -7,7 +7,7 @@ class MyApp extends StatefulWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_MyAppState createState() => _MyAppState();
|
||||
State<MyApp> createState() => _MyAppState();
|
||||
}
|
||||
|
||||
class _MyAppState extends State<MyApp> with TickerProviderStateMixin {
|
||||
|
@ -15,7 +15,7 @@ class App extends StatefulWidget {
|
||||
const App({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_AppState createState() => _AppState();
|
||||
State<App> createState() => _AppState();
|
||||
}
|
||||
|
||||
class _AppState extends State<App> with TickerProviderStateMixin {
|
||||
|
@ -13,7 +13,7 @@ class MyApp extends StatefulWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_MyAppState createState() => _MyAppState();
|
||||
State<MyApp> createState() => _MyAppState();
|
||||
}
|
||||
|
||||
class _MyAppState extends State<MyApp> {
|
||||
|
@ -92,7 +92,7 @@ class Detail extends StatefulWidget {
|
||||
const Detail(this.assetName, {Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_DetailState createState() => _DetailState();
|
||||
State<Detail> createState() => _DetailState();
|
||||
}
|
||||
|
||||
class _DetailState extends State<Detail> with TickerProviderStateMixin {
|
||||
|
@ -15,8 +15,8 @@ EXTERNAL SOURCES:
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424
|
||||
path_provider_macos: a0a3fd666cb7cd0448e936fb4abad4052961002b
|
||||
path_provider_macos: 160cab0d5461f0c0e02995469a98f24bdb9a3f1f
|
||||
|
||||
PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c
|
||||
|
||||
COCOAPODS: 1.10.1
|
||||
COCOAPODS: 1.11.3
|
||||
|
@ -7,7 +7,7 @@ packages:
|
||||
name: archive
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.3.0"
|
||||
version: "3.3.1"
|
||||
async:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -49,28 +49,28 @@ packages:
|
||||
name: collection
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.15.0"
|
||||
version: "1.16.0"
|
||||
crypto:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: crypto
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
version: "3.0.2"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fake_async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
version: "1.3.0"
|
||||
ffi:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: ffi
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.1.2"
|
||||
version: "2.0.1"
|
||||
file:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -96,7 +96,7 @@ packages:
|
||||
name: flutter_lints
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.4"
|
||||
version: "2.0.1"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
@ -122,14 +122,14 @@ packages:
|
||||
name: http_parser
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.0.0"
|
||||
version: "4.0.1"
|
||||
lints:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: lints
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
version: "2.0.0"
|
||||
logging:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -143,7 +143,7 @@ packages:
|
||||
path: ".."
|
||||
relative: true
|
||||
source: path
|
||||
version: "1.3.0"
|
||||
version: "1.4.0"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -157,7 +157,7 @@ packages:
|
||||
name: material_color_utilities
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.1.3"
|
||||
version: "0.1.4"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -166,61 +166,61 @@ packages:
|
||||
source: hosted
|
||||
version: "1.7.0"
|
||||
path:
|
||||
dependency: transitive
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0"
|
||||
version: "1.8.1"
|
||||
path_provider:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: path_provider
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.9"
|
||||
version: "2.0.11"
|
||||
path_provider_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_android
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.12"
|
||||
version: "2.0.16"
|
||||
path_provider_ios:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_ios
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.8"
|
||||
version: "2.0.10"
|
||||
path_provider_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_linux
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.5"
|
||||
version: "2.1.7"
|
||||
path_provider_macos:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_macos
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.5"
|
||||
version: "2.0.6"
|
||||
path_provider_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_platform_interface
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.3"
|
||||
version: "2.0.4"
|
||||
path_provider_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_windows
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.5"
|
||||
version: "2.1.0"
|
||||
platform:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -253,7 +253,7 @@ packages:
|
||||
name: source_span
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.1"
|
||||
version: "1.8.2"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -288,28 +288,28 @@ packages:
|
||||
name: test_api
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.4.8"
|
||||
version: "0.4.9"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
version: "1.3.1"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_math
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
version: "2.1.2"
|
||||
win32:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: win32
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.5.1"
|
||||
version: "2.7.0"
|
||||
xdg_directories:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -318,5 +318,5 @@ packages:
|
||||
source: hosted
|
||||
version: "0.2.0+1"
|
||||
sdks:
|
||||
dart: ">=2.15.0 <3.0.0"
|
||||
flutter: ">=2.10.0"
|
||||
dart: ">=2.17.0 <3.0.0"
|
||||
flutter: ">=3.0.0"
|
||||
|
@ -13,6 +13,7 @@ dependencies:
|
||||
logging:
|
||||
lottie:
|
||||
path: ../
|
||||
path:
|
||||
path_provider:
|
||||
|
||||
dev_dependencies:
|
||||
|
@ -26,6 +26,7 @@ class Lottie extends StatefulWidget {
|
||||
this.delegates,
|
||||
this.options,
|
||||
bool? addRepaintBoundary,
|
||||
this.filterQuality,
|
||||
}) : animate = animate ?? true,
|
||||
reverse = reverse ?? false,
|
||||
repeat = repeat ?? true,
|
||||
@ -54,6 +55,7 @@ class Lottie extends StatefulWidget {
|
||||
Alignment? alignment,
|
||||
String? package,
|
||||
bool? addRepaintBoundary,
|
||||
FilterQuality? filterQuality,
|
||||
WarningCallback? onWarning,
|
||||
}) =>
|
||||
LottieBuilder.asset(
|
||||
@ -77,6 +79,7 @@ class Lottie extends StatefulWidget {
|
||||
alignment: alignment,
|
||||
package: package,
|
||||
addRepaintBoundary: addRepaintBoundary,
|
||||
filterQuality: filterQuality,
|
||||
onWarning: onWarning,
|
||||
);
|
||||
|
||||
@ -100,6 +103,7 @@ class Lottie extends StatefulWidget {
|
||||
BoxFit? fit,
|
||||
Alignment? alignment,
|
||||
bool? addRepaintBoundary,
|
||||
FilterQuality? filterQuality,
|
||||
WarningCallback? onWarning,
|
||||
}) =>
|
||||
LottieBuilder.file(
|
||||
@ -121,6 +125,7 @@ class Lottie extends StatefulWidget {
|
||||
fit: fit,
|
||||
alignment: alignment,
|
||||
addRepaintBoundary: addRepaintBoundary,
|
||||
filterQuality: filterQuality,
|
||||
onWarning: onWarning,
|
||||
);
|
||||
|
||||
@ -144,6 +149,7 @@ class Lottie extends StatefulWidget {
|
||||
BoxFit? fit,
|
||||
Alignment? alignment,
|
||||
bool? addRepaintBoundary,
|
||||
FilterQuality? filterQuality,
|
||||
WarningCallback? onWarning,
|
||||
}) =>
|
||||
LottieBuilder.memory(
|
||||
@ -165,6 +171,7 @@ class Lottie extends StatefulWidget {
|
||||
fit: fit,
|
||||
alignment: alignment,
|
||||
addRepaintBoundary: addRepaintBoundary,
|
||||
filterQuality: filterQuality,
|
||||
onWarning: onWarning,
|
||||
);
|
||||
|
||||
@ -188,6 +195,7 @@ class Lottie extends StatefulWidget {
|
||||
BoxFit? fit,
|
||||
Alignment? alignment,
|
||||
bool? addRepaintBoundary,
|
||||
FilterQuality? filterQuality,
|
||||
WarningCallback? onWarning,
|
||||
}) =>
|
||||
LottieBuilder.network(
|
||||
@ -209,6 +217,7 @@ class Lottie extends StatefulWidget {
|
||||
fit: fit,
|
||||
alignment: alignment,
|
||||
addRepaintBoundary: addRepaintBoundary,
|
||||
filterQuality: filterQuality,
|
||||
onWarning: onWarning,
|
||||
);
|
||||
|
||||
@ -299,13 +308,19 @@ class Lottie extends StatefulWidget {
|
||||
/// This property is `true` by default.
|
||||
final bool addRepaintBoundary;
|
||||
|
||||
/// The quality of the image layer. See [FilterQuality]
|
||||
/// [FilterQuality.high] is highest quality but slowest.
|
||||
///
|
||||
/// Defaults to [FilterQuality.none]
|
||||
final FilterQuality? filterQuality;
|
||||
|
||||
static bool get traceEnabled => L.traceEnabled;
|
||||
static set traceEnabled(bool enabled) {
|
||||
L.traceEnabled = enabled;
|
||||
}
|
||||
|
||||
@override
|
||||
_LottieState createState() => _LottieState();
|
||||
State<Lottie> createState() => _LottieState();
|
||||
}
|
||||
|
||||
class _LottieState extends State<Lottie> with TickerProviderStateMixin {
|
||||
@ -366,6 +381,7 @@ class _LottieState extends State<Lottie> with TickerProviderStateMixin {
|
||||
height: widget.height,
|
||||
fit: widget.fit,
|
||||
alignment: widget.alignment,
|
||||
filterQuality: widget.filterQuality,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
@ -59,6 +59,7 @@ class LottieBuilder extends StatefulWidget {
|
||||
this.fit,
|
||||
this.alignment,
|
||||
this.addRepaintBoundary,
|
||||
this.filterQuality,
|
||||
this.onWarning,
|
||||
}) : super(key: key);
|
||||
|
||||
@ -83,6 +84,7 @@ class LottieBuilder extends StatefulWidget {
|
||||
this.fit,
|
||||
this.alignment,
|
||||
this.addRepaintBoundary,
|
||||
this.filterQuality,
|
||||
this.onWarning,
|
||||
}) : lottie = NetworkLottie(src,
|
||||
headers: headers, imageProviderFactory: imageProviderFactory),
|
||||
@ -117,6 +119,7 @@ class LottieBuilder extends StatefulWidget {
|
||||
this.fit,
|
||||
this.alignment,
|
||||
this.addRepaintBoundary,
|
||||
this.filterQuality,
|
||||
this.onWarning,
|
||||
}) : lottie = FileLottie(file, imageProviderFactory: imageProviderFactory),
|
||||
super(key: key);
|
||||
@ -143,6 +146,7 @@ class LottieBuilder extends StatefulWidget {
|
||||
this.alignment,
|
||||
String? package,
|
||||
this.addRepaintBoundary,
|
||||
this.filterQuality,
|
||||
this.onWarning,
|
||||
}) : lottie = AssetLottie(name,
|
||||
bundle: bundle,
|
||||
@ -170,6 +174,7 @@ class LottieBuilder extends StatefulWidget {
|
||||
this.fit,
|
||||
this.alignment,
|
||||
this.addRepaintBoundary,
|
||||
this.filterQuality,
|
||||
this.onWarning,
|
||||
}) : lottie =
|
||||
MemoryLottie(bytes, imageProviderFactory: imageProviderFactory),
|
||||
@ -361,6 +366,12 @@ class LottieBuilder extends StatefulWidget {
|
||||
/// This property is `true` by default.
|
||||
final bool? addRepaintBoundary;
|
||||
|
||||
/// The quality of the image layer. See [FilterQuality]
|
||||
/// [FilterQuality.high] is highest quality but slowest.
|
||||
///
|
||||
/// Defaults to [FilterQuality.none]
|
||||
final FilterQuality? filterQuality;
|
||||
|
||||
/// A callback called when there is a warning during the loading or painting
|
||||
/// of the animation.
|
||||
final WarningCallback? onWarning;
|
||||
@ -398,7 +409,7 @@ class LottieBuilder extends StatefulWidget {
|
||||
final ImageErrorWidgetBuilder? errorBuilder;
|
||||
|
||||
@override
|
||||
_LottieBuilderState createState() => _LottieBuilderState();
|
||||
State<LottieBuilder> createState() => _LottieBuilderState();
|
||||
|
||||
@override
|
||||
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
|
||||
@ -482,6 +493,7 @@ class _LottieBuilderState extends State<LottieBuilder> {
|
||||
fit: widget.fit,
|
||||
alignment: widget.alignment,
|
||||
addRepaintBoundary: widget.addRepaintBoundary,
|
||||
filterQuality: widget.filterQuality,
|
||||
);
|
||||
|
||||
if (widget.frameBuilder != null) {
|
||||
|
@ -16,16 +16,15 @@ class LottieDrawable {
|
||||
final Size size;
|
||||
LottieDelegates? _delegates;
|
||||
bool _isDirty = true;
|
||||
final bool enableMergePaths;
|
||||
bool enableMergePaths = false;
|
||||
FilterQuality? filterQuality;
|
||||
|
||||
/// Gives a suggestion whether to paint with anti-aliasing, or not. Default is true.
|
||||
bool antiAliasingSuggested = true;
|
||||
|
||||
LottieDrawable(this.composition,
|
||||
{LottieDelegates? delegates, bool? enableMergePaths})
|
||||
LottieDrawable(this.composition, {LottieDelegates? delegates})
|
||||
: size = Size(composition.bounds.width.toDouble(),
|
||||
composition.bounds.height.toDouble()),
|
||||
enableMergePaths = enableMergePaths ?? false {
|
||||
composition.bounds.height.toDouble()) {
|
||||
this.delegates = delegates;
|
||||
_compositionLayer = CompositionLayer(
|
||||
this, LayerParser.parse(composition), composition.layers, composition);
|
||||
|
@ -25,6 +25,7 @@ class ImageLayer extends BaseLayer {
|
||||
}
|
||||
var density = window.devicePixelRatio;
|
||||
|
||||
paint.filterQuality = lottieDrawable.filterQuality ?? FilterQuality.none;
|
||||
paint.setAlpha(parentAlpha);
|
||||
if (_colorFilterAnimation != null) {
|
||||
paint.colorFilter = _colorFilterAnimation!.value;
|
||||
|
@ -23,6 +23,7 @@ class RawLottie extends LeafRenderObjectWidget {
|
||||
this.height,
|
||||
this.fit,
|
||||
AlignmentGeometry? alignment,
|
||||
this.filterQuality,
|
||||
}) : progress = progress ?? 0.0,
|
||||
alignment = alignment ?? Alignment.center,
|
||||
super(key: key);
|
||||
@ -78,6 +79,8 @@ class RawLottie extends LeafRenderObjectWidget {
|
||||
/// relative to text direction.
|
||||
final AlignmentGeometry alignment;
|
||||
|
||||
final FilterQuality? filterQuality;
|
||||
|
||||
@override
|
||||
RenderLottie createRenderObject(BuildContext context) {
|
||||
return RenderLottie(
|
||||
@ -90,17 +93,21 @@ class RawLottie extends LeafRenderObjectWidget {
|
||||
height: height,
|
||||
fit: fit,
|
||||
alignment: alignment,
|
||||
filterQuality: filterQuality,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void updateRenderObject(BuildContext context, RenderLottie renderObject) {
|
||||
renderObject
|
||||
..setComposition(composition,
|
||||
..setComposition(
|
||||
composition,
|
||||
progress: progress,
|
||||
frameRate: frameRate,
|
||||
delegates: delegates,
|
||||
enableMergePaths: options?.enableMergePaths)
|
||||
enableMergePaths: options?.enableMergePaths,
|
||||
filterQuality: filterQuality,
|
||||
)
|
||||
..width = width
|
||||
..height = height
|
||||
..alignment = alignment
|
||||
|
@ -19,11 +19,14 @@ class RenderLottie extends RenderBox {
|
||||
double? height,
|
||||
BoxFit? fit,
|
||||
AlignmentGeometry alignment = Alignment.center,
|
||||
FilterQuality? filterQuality,
|
||||
}) : assert(progress >= 0.0 && progress <= 1.0),
|
||||
_drawable = composition != null
|
||||
? (LottieDrawable(composition, enableMergePaths: enableMergePaths)
|
||||
? (LottieDrawable(composition)
|
||||
..setProgress(progress, frameRate: frameRate)
|
||||
..delegates = delegates)
|
||||
..delegates = delegates
|
||||
..enableMergePaths = enableMergePaths ?? false
|
||||
..filterQuality = filterQuality)
|
||||
: null,
|
||||
_width = width,
|
||||
_height = height,
|
||||
@ -33,11 +36,13 @@ class RenderLottie extends RenderBox {
|
||||
/// The lottie composition to display.
|
||||
LottieComposition? get composition => _drawable?.composition;
|
||||
LottieDrawable? _drawable;
|
||||
|
||||
void setComposition(LottieComposition? composition,
|
||||
{required double progress,
|
||||
required FrameRate? frameRate,
|
||||
required LottieDelegates? delegates,
|
||||
bool? enableMergePaths}) {
|
||||
bool? enableMergePaths,
|
||||
FilterQuality? filterQuality}) {
|
||||
var drawable = _drawable;
|
||||
enableMergePaths ??= false;
|
||||
|
||||
@ -50,11 +55,8 @@ class RenderLottie extends RenderBox {
|
||||
needsLayout = true;
|
||||
}
|
||||
} else {
|
||||
if (drawable == null ||
|
||||
drawable.composition != composition ||
|
||||
drawable.enableMergePaths != enableMergePaths) {
|
||||
drawable = _drawable =
|
||||
LottieDrawable(composition, enableMergePaths: enableMergePaths);
|
||||
if (drawable == null || drawable.composition != composition) {
|
||||
drawable = _drawable = LottieDrawable(composition);
|
||||
needsLayout = true;
|
||||
needsPaint = true;
|
||||
}
|
||||
@ -65,6 +67,14 @@ class RenderLottie extends RenderBox {
|
||||
drawable.delegates = delegates;
|
||||
needsPaint = true;
|
||||
}
|
||||
if (enableMergePaths != drawable.enableMergePaths) {
|
||||
drawable.enableMergePaths = enableMergePaths;
|
||||
needsPaint = true;
|
||||
}
|
||||
if (filterQuality != drawable.filterQuality) {
|
||||
drawable.filterQuality = filterQuality;
|
||||
needsPaint = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (needsPaint) {
|
||||
|
74
pubspec.lock
74
pubspec.lock
@ -7,28 +7,28 @@ packages:
|
||||
name: _fe_analyzer_shared
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "38.0.0"
|
||||
version: "43.0.0"
|
||||
analyzer:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: analyzer
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.4.1"
|
||||
version: "4.3.1"
|
||||
archive:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: archive
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.3.0"
|
||||
version: "3.3.1"
|
||||
args:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: args
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.3.0"
|
||||
version: "2.3.1"
|
||||
async:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -49,35 +49,35 @@ packages:
|
||||
name: build
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.2.2"
|
||||
version: "2.3.0"
|
||||
build_config:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build_config
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
version: "1.1.0"
|
||||
build_daemon:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build_daemon
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
version: "3.1.0"
|
||||
build_resolvers:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build_resolvers
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.7"
|
||||
version: "2.0.9"
|
||||
build_runner:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: build_runner
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.8"
|
||||
version: "2.2.0"
|
||||
build_runner_core:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -98,7 +98,7 @@ packages:
|
||||
name: built_value
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "8.1.4"
|
||||
version: "8.4.0"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -140,35 +140,35 @@ packages:
|
||||
name: collection
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.15.0"
|
||||
version: "1.16.0"
|
||||
convert:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: convert
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
version: "3.0.2"
|
||||
crypto:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: crypto
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
version: "3.0.2"
|
||||
dart_style:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: dart_style
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.2.2"
|
||||
version: "2.2.3"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fake_async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
version: "1.3.0"
|
||||
file:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -182,7 +182,7 @@ packages:
|
||||
name: fixnum
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.0"
|
||||
version: "1.0.1"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
@ -194,7 +194,7 @@ packages:
|
||||
name: flutter_lints
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.4"
|
||||
version: "2.0.1"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
@ -206,14 +206,14 @@ packages:
|
||||
name: frontend_server_client
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.2"
|
||||
version: "2.1.3"
|
||||
glob:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: glob
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.2"
|
||||
version: "2.1.0"
|
||||
graphs:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -227,14 +227,14 @@ packages:
|
||||
name: http_multi_server
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.2.0"
|
||||
version: "3.2.1"
|
||||
http_parser:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: http_parser
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.0.0"
|
||||
version: "4.0.1"
|
||||
io:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -255,14 +255,14 @@ packages:
|
||||
name: json_annotation
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.4.0"
|
||||
version: "4.6.0"
|
||||
lints:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: lints
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
version: "2.0.0"
|
||||
logging:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -283,7 +283,7 @@ packages:
|
||||
name: material_color_utilities
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.1.3"
|
||||
version: "0.1.4"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -297,28 +297,28 @@ packages:
|
||||
name: mime
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
version: "1.0.2"
|
||||
package_config:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: package_config
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.2"
|
||||
version: "2.1.0"
|
||||
path:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.0"
|
||||
version: "1.8.1"
|
||||
pool:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pool
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.5.0"
|
||||
version: "1.5.1"
|
||||
pub_semver:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
@ -339,14 +339,14 @@ packages:
|
||||
name: shelf
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
version: "1.3.1"
|
||||
shelf_web_socket:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: shelf_web_socket
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
version: "1.0.2"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
@ -358,7 +358,7 @@ packages:
|
||||
name: source_span
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.1"
|
||||
version: "1.8.2"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -400,7 +400,7 @@ packages:
|
||||
name: test_api
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.4.8"
|
||||
version: "0.4.9"
|
||||
timing:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -414,14 +414,14 @@ packages:
|
||||
name: typed_data
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
version: "1.3.1"
|
||||
vector_math:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: vector_math
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
version: "2.1.2"
|
||||
watcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -435,14 +435,14 @@ packages:
|
||||
name: web_socket_channel
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
version: "2.2.0"
|
||||
yaml:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: yaml
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.1.0"
|
||||
version: "3.1.1"
|
||||
sdks:
|
||||
dart: ">=2.16.0 <3.0.0"
|
||||
dart: ">=2.17.0 <3.0.0"
|
||||
flutter: ">=2.10.0"
|
||||
|
@ -1,6 +1,6 @@
|
||||
name: lottie
|
||||
description: Render After Effects animations natively on Flutter. This package is a pure Dart implementation of a Lottie player.
|
||||
version: 1.3.0
|
||||
version: 1.4.0
|
||||
homepage: https://github.com/xvrh/lottie-flutter
|
||||
|
||||
environment:
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 36 KiB |
Reference in New Issue
Block a user