Compare commits

...

2 Commits

Author SHA1 Message Date
2443bec3af Hypothetical fix for #243 2022-12-13 13:42:21 +01:00
a333a42f01 Enable use_super_parameters lint (#242) 2022-11-10 14:14:28 +01:00
57 changed files with 112 additions and 144 deletions

View File

@ -23,7 +23,7 @@ import 'package:lottie/lottie.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
const MyApp({super.key});
@override
Widget build(BuildContext context) {
@ -61,7 +61,7 @@ import 'package:lottie/lottie.dart';
void main() => runApp(const MyApp());
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
@ -136,7 +136,7 @@ This example shows how to load and parse a Lottie composition from a json file.
```dart
class MyWidget extends StatefulWidget {
const MyWidget({Key? key}) : super(key: key);
const MyWidget({super.key});
@override
State<MyWidget> createState() => _MyWidgetState();
@ -182,7 +182,7 @@ a specific position and size.
class CustomDrawer extends StatelessWidget {
final LottieComposition composition;
const CustomDrawer(this.composition, {Key? key}) : super(key: key);
const CustomDrawer(this.composition, {super.key});
@override
Widget build(BuildContext context) {

View File

@ -10,14 +10,16 @@ linter:
always_declare_return_types: true
avoid_dynamic_calls: true
avoid_escaping_inner_quotes: true
avoid_returning_null_for_future: true
avoid_setters_without_getters: true
cancel_subscriptions: true
cast_nullable_to_non_nullable: true
close_sinks: true
no_adjacent_strings_in_list: true
no_default_cases: true
omit_local_variable_types: true
only_throw_errors: true
prefer_interpolation_to_compose_strings: true
prefer_relative_imports: true
prefer_single_quotes: true
sort_child_properties_last: true
sort_pub_dependencies: true
@ -27,3 +29,4 @@ linter:
unnecessary_statements: true
unsafe_html: true
use_raw_strings: true
use_super_parameters: true

View File

@ -9,7 +9,7 @@ import 'package:lottie/lottie.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
const MyApp({super.key});
@override
Widget build(BuildContext context) {

View File

@ -5,7 +5,7 @@ import 'package:lottie/lottie.dart';
void main() => runApp(const App());
class App extends StatelessWidget {
const App({Key? key}) : super(key: key);
const App({super.key});
@override
Widget build(BuildContext context) {

View File

@ -6,7 +6,7 @@ void main() async {
}
class App extends StatelessWidget {
const App({Key? key}) : super(key: key);
const App({super.key});
@override
Widget build(BuildContext context) {

View File

@ -4,7 +4,7 @@ import 'package:lottie/lottie.dart';
void main() => runApp(const MyApp());
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();

View File

@ -12,7 +12,7 @@ import 'package:lottie/lottie.dart';
void main() => runApp(const MyApp());
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();

View File

@ -4,7 +4,7 @@ import 'package:lottie/lottie.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
const MyApp({super.key});
@override
Widget build(BuildContext context) {

View File

@ -5,7 +5,7 @@ import 'package:lottie/lottie.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
const MyApp({super.key});
@override
Widget build(BuildContext context) {
@ -18,7 +18,7 @@ class MyApp extends StatelessWidget {
}
class MyWidget extends StatefulWidget {
const MyWidget({Key? key}) : super(key: key);
const MyWidget({super.key});
@override
State<MyWidget> createState() => _MyWidgetState();
@ -60,7 +60,7 @@ class _MyWidgetState extends State<MyWidget> {
class CustomDrawer extends StatelessWidget {
final LottieComposition composition;
const CustomDrawer(this.composition, {Key? key}) : super(key: key);
const CustomDrawer(this.composition, {super.key});
@override
Widget build(BuildContext context) {

View File

@ -5,7 +5,7 @@ import 'package:lottie/lottie.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
const MyApp({super.key});
@override
Widget build(BuildContext context) {
@ -19,7 +19,7 @@ class MyApp extends StatelessWidget {
//--- example
class MyWidget extends StatefulWidget {
const MyWidget({Key? key}) : super(key: key);
const MyWidget({super.key});
@override
State<MyWidget> createState() => _MyWidgetState();

View File

@ -4,7 +4,7 @@ import 'package:lottie/lottie.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
const MyApp({super.key});
@override
Widget build(BuildContext context) {

View File

@ -7,7 +7,7 @@ void main() async {
}
class App extends StatefulWidget {
const App({Key? key}) : super(key: key);
const App({super.key});
@override
State<App> createState() => _AppState();

View File

@ -7,7 +7,7 @@ void main() async {
}
class App extends StatefulWidget {
const App({Key? key}) : super(key: key);
const App({super.key});
@override
State<App> createState() => _AppState();

View File

@ -4,7 +4,7 @@ import 'package:lottie/lottie.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
const MyApp({super.key});
@override
Widget build(BuildContext context) {

View File

@ -4,7 +4,7 @@ import 'package:lottie/lottie.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
const MyApp({super.key});
@override
Widget build(BuildContext context) {

View File

@ -6,7 +6,7 @@ void main() async {
}
class App extends StatefulWidget {
const App({Key? key}) : super(key: key);
const App({super.key});
@override
State<App> createState() => _AppState();

View File

@ -9,7 +9,7 @@ void main() async {
}
class App extends StatefulWidget {
const App({Key? key}) : super(key: key);
const App({super.key});
@override
State<App> createState() => _AppState();
@ -48,7 +48,7 @@ class _AppState extends State<App> with TickerProviderStateMixin {
class _LottieDetails extends StatefulWidget {
final LottieComposition composition;
const _LottieDetails(this.composition, {Key? key}) : super(key: key);
const _LottieDetails(this.composition);
@override
_LottieDetailsState createState() => _LottieDetailsState();

View File

@ -4,7 +4,7 @@ import 'package:lottie/lottie.dart';
void main() => runApp(const MyApp());
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();

View File

@ -12,7 +12,7 @@ void main() async {
}
class App extends StatefulWidget {
const App({Key? key}) : super(key: key);
const App({super.key});
@override
State<App> createState() => _AppState();

View File

@ -10,7 +10,7 @@ import 'package:path_provider/path_provider.dart';
void main() => runApp(const MyApp());
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();

View File

@ -4,7 +4,7 @@ import 'package:lottie/lottie.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
const MyApp({super.key});
@override
Widget build(BuildContext context) {

View File

@ -4,7 +4,7 @@ import 'package:lottie/lottie.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
const MyApp({super.key});
@override
Widget build(BuildContext context) {

View File

@ -14,7 +14,7 @@ void main() {
}
class App extends StatelessWidget {
const App({Key? key}) : super(key: key);
const App({super.key});
@override
Widget build(BuildContext context) {
@ -64,7 +64,7 @@ class App extends StatelessWidget {
class _Item extends StatelessWidget {
final Widget child;
const _Item({Key? key, required this.child}) : super(key: key);
const _Item({required this.child});
@override
Widget build(BuildContext context) {
@ -89,7 +89,7 @@ class _Item extends StatelessWidget {
class Detail extends StatefulWidget {
final String assetName;
const Detail(this.assetName, {Key? key}) : super(key: key);
const Detail(this.assetName, {super.key});
@override
State<Detail> createState() => _DetailState();

View File

@ -13,7 +13,7 @@ void main() async {
class App extends StatelessWidget {
final LottieComposition composition;
const App({Key? key, required this.composition}) : super(key: key);
const App({super.key, required this.composition});
@override
Widget build(BuildContext context) {
@ -103,8 +103,7 @@ class _Lottie extends StatefulWidget {
final AlignmentGeometry? alignment;
const _Lottie(this.composition,
{Key? key, this.width, this.height, this.fit, this.alignment})
: super(key: key);
{this.width, this.height, this.fit, this.alignment});
@override
__LottieState createState() => __LottieState();

View File

@ -6,7 +6,7 @@ void main() async {
}
class App extends StatelessWidget {
const App({Key? key}) : super(key: key);
const App({super.key});
@override
Widget build(BuildContext context) {

View File

@ -6,7 +6,7 @@ void main() async {
}
class App extends StatelessWidget {
const App({Key? key}) : super(key: key);
const App({super.key});
@override
Widget build(BuildContext context) {

View File

@ -302,7 +302,7 @@ packages:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
version: "3.1.1"
xdg_directories:
dependency: transitive
description:

View File

@ -4,7 +4,7 @@ import '../../value/keyframe.dart';
import 'keyframe_animation.dart';
class ColorKeyframeAnimation extends KeyframeAnimation<Color> {
ColorKeyframeAnimation(List<Keyframe<Color>> keyframes) : super(keyframes);
ColorKeyframeAnimation(super.keyframes);
@override
Color getValue(Keyframe<Color> keyframe, double keyframeProgress) {

View File

@ -3,7 +3,7 @@ import '../../value/keyframe.dart';
import 'keyframe_animation.dart';
class DoubleKeyframeAnimation extends KeyframeAnimation<double> {
DoubleKeyframeAnimation(List<Keyframe<double>> keyframes) : super(keyframes);
DoubleKeyframeAnimation(super.keyframes);
@override
double getValue(Keyframe<double> keyframe, double keyframeProgress) {

View File

@ -3,7 +3,7 @@ import '../../value/keyframe.dart';
import 'keyframe_animation.dart';
class IntegerKeyframeAnimation extends KeyframeAnimation<int> {
IntegerKeyframeAnimation(List<Keyframe<int>> keyframes) : super(keyframes);
IntegerKeyframeAnimation(super.keyframes);
@override
int getValue(Keyframe<int> keyframe, double keyframeProgress) {

View File

@ -1,7 +1,6 @@
import '../../value/keyframe.dart';
import 'base_keyframe_animation.dart';
abstract class KeyframeAnimation<T extends Object>
extends BaseKeyframeAnimation<T, T> {
KeyframeAnimation(List<Keyframe<T>> keyframes) : super(keyframes);
KeyframeAnimation(super.keyframes);
}

View File

@ -7,9 +7,9 @@ class PathKeyframe extends Keyframe<Offset> {
Path? _path;
final Keyframe<Offset> _pointKeyFrame;
PathKeyframe(LottieComposition composition, Keyframe<Offset> keyframe)
PathKeyframe(LottieComposition super.composition, Keyframe<Offset> keyframe)
: _pointKeyFrame = keyframe,
super(composition,
super(
startValue: keyframe.startValue,
endValue: keyframe.endValue,
interpolator: keyframe.interpolator,

View File

@ -7,7 +7,7 @@ class PathKeyframeAnimation extends KeyframeAnimation<Offset> {
PathKeyframe? _pathMeasureKeyframe;
late PathMetric _pathMeasure;
PathKeyframeAnimation(List<Keyframe<Offset>> keyframes) : super(keyframes);
PathKeyframeAnimation(super.keyframes);
@override
Offset getValue(Keyframe<Offset> keyframe, double keyframeProgress) {

View File

@ -3,7 +3,7 @@ import '../../value/keyframe.dart';
import 'keyframe_animation.dart';
class PointKeyframeAnimation extends KeyframeAnimation<Offset> {
PointKeyframeAnimation(List<Keyframe<Offset>> keyframes) : super(keyframes);
PointKeyframeAnimation(super.keyframes);
@override
Offset getValue(Keyframe<Offset> keyframe, double keyframeProgress) {

View File

@ -11,8 +11,7 @@ class ShapeKeyframeAnimation extends BaseKeyframeAnimation<ShapeData, Path> {
final Path _tempPath = PathFactory.create();
List<ShapeModifierContent>? _shapeModifiers;
ShapeKeyframeAnimation(List<Keyframe<ShapeData>> keyframes)
: super(keyframes);
ShapeKeyframeAnimation(super.keyframes);
@override
Path getValue(Keyframe<ShapeData> keyframe, double keyframeProgress) {

View File

@ -5,8 +5,7 @@ import '../../value/lottie_value_callback.dart';
import 'keyframe_animation.dart';
class TextKeyframeAnimation extends KeyframeAnimation<DocumentData> {
TextKeyframeAnimation(List<Keyframe<DocumentData>> keyframes)
: super(keyframes);
TextKeyframeAnimation(super.keyframes);
@override
DocumentData getValue(

View File

@ -12,7 +12,7 @@ import 'lottie_builder.dart';
/// [repeat] and [reverse].
class Lottie extends StatefulWidget {
const Lottie({
Key? key,
super.key,
required this.composition,
this.controller,
this.width,
@ -30,8 +30,7 @@ class Lottie extends StatefulWidget {
}) : animate = animate ?? true,
reverse = reverse ?? false,
repeat = repeat ?? true,
addRepaintBoundary = addRepaintBoundary ?? true,
super(key: key);
addRepaintBoundary = addRepaintBoundary ?? true;
/// Creates a widget that displays an [LottieComposition] obtained from an [AssetBundle].
static LottieBuilder asset(

View File

@ -41,7 +41,7 @@ typedef LottieErrorWidgetBuilder = Widget Function(
///
class LottieBuilder extends StatefulWidget {
const LottieBuilder({
Key? key,
super.key,
required this.lottie,
this.controller,
this.frameRate,
@ -60,7 +60,7 @@ class LottieBuilder extends StatefulWidget {
this.addRepaintBoundary,
this.filterQuality,
this.onWarning,
}) : super(key: key);
});
/// Creates a widget that displays an [LottieComposition] obtained from the network.
LottieBuilder.network(
@ -75,7 +75,7 @@ class LottieBuilder extends StatefulWidget {
this.options,
LottieImageProviderFactory? imageProviderFactory,
this.onLoaded,
Key? key,
super.key,
this.frameBuilder,
this.errorBuilder,
this.width,
@ -85,9 +85,8 @@ class LottieBuilder extends StatefulWidget {
this.addRepaintBoundary,
this.filterQuality,
this.onWarning,
}) : lottie = NetworkLottie(src,
headers: headers, imageProviderFactory: imageProviderFactory),
super(key: key);
}) : lottie = NetworkLottie(src,
headers: headers, imageProviderFactory: imageProviderFactory);
/// Creates a widget that displays an [LottieComposition] obtained from a [File].
///
@ -110,7 +109,7 @@ class LottieBuilder extends StatefulWidget {
this.options,
LottieImageProviderFactory? imageProviderFactory,
this.onLoaded,
Key? key,
super.key,
this.frameBuilder,
this.errorBuilder,
this.width,
@ -120,8 +119,7 @@ class LottieBuilder extends StatefulWidget {
this.addRepaintBoundary,
this.filterQuality,
this.onWarning,
}) : lottie = FileLottie(file, imageProviderFactory: imageProviderFactory),
super(key: key);
}) : lottie = FileLottie(file, imageProviderFactory: imageProviderFactory);
/// Creates a widget that displays an [LottieComposition] obtained from an [AssetBundle].
LottieBuilder.asset(
@ -135,7 +133,7 @@ class LottieBuilder extends StatefulWidget {
this.options,
LottieImageProviderFactory? imageProviderFactory,
this.onLoaded,
Key? key,
super.key,
AssetBundle? bundle,
this.frameBuilder,
this.errorBuilder,
@ -147,11 +145,10 @@ class LottieBuilder extends StatefulWidget {
this.addRepaintBoundary,
this.filterQuality,
this.onWarning,
}) : lottie = AssetLottie(name,
}) : lottie = AssetLottie(name,
bundle: bundle,
package: package,
imageProviderFactory: imageProviderFactory),
super(key: key);
imageProviderFactory: imageProviderFactory);
/// Creates a widget that displays an [LottieComposition] obtained from a [Uint8List].
LottieBuilder.memory(
@ -166,7 +163,7 @@ class LottieBuilder extends StatefulWidget {
LottieImageProviderFactory? imageProviderFactory,
this.onLoaded,
this.errorBuilder,
Key? key,
super.key,
this.frameBuilder,
this.width,
this.height,
@ -175,9 +172,7 @@ class LottieBuilder extends StatefulWidget {
this.addRepaintBoundary,
this.filterQuality,
this.onWarning,
}) : lottie =
MemoryLottie(bytes, imageProviderFactory: imageProviderFactory),
super(key: key);
}) : lottie = MemoryLottie(bytes, imageProviderFactory: imageProviderFactory);
/// The lottie animation to load.
/// Example of providers: [AssetLottie], [NetworkLottie], [FileLottie], [MemoryLottie]

View File

@ -1,11 +1,9 @@
import 'dart:ui';
import '../../animation/keyframe/color_keyframe_animation.dart';
import '../../value/keyframe.dart';
import 'base_animatable_value.dart';
class AnimatableColorValue extends BaseAnimatableValue<Color, Color> {
AnimatableColorValue.fromKeyframes(List<Keyframe<Color>> keyframes)
: super.fromKeyframes(keyframes);
AnimatableColorValue.fromKeyframes(super.keyframes) : super.fromKeyframes();
@override
ColorKeyframeAnimation createAnimation() {

View File

@ -1,12 +1,10 @@
import '../../animation/keyframe/double_keyframe_animation.dart';
import '../../value/keyframe.dart';
import 'base_animatable_value.dart';
class AnimatableDoubleValue extends BaseAnimatableValue<double, double> {
AnimatableDoubleValue() : super.fromValue(0.0);
AnimatableDoubleValue.fromKeyframes(List<Keyframe<double>> keyframes)
: super.fromKeyframes(keyframes);
AnimatableDoubleValue.fromKeyframes(super.keyframes) : super.fromKeyframes();
@override
DoubleKeyframeAnimation createAnimation() {

View File

@ -1,13 +1,11 @@
import '../../animation/keyframe/gradient_color_keyframe_animation.dart';
import '../../value/keyframe.dart';
import '../content/gradient_color.dart';
import 'base_animatable_value.dart';
class AnimatableGradientColorValue
extends BaseAnimatableValue<GradientColor, GradientColor> {
AnimatableGradientColorValue.fromKeyframes(
List<Keyframe<GradientColor>> keyframes)
: super.fromKeyframes(keyframes);
AnimatableGradientColorValue.fromKeyframes(super.keyframes)
: super.fromKeyframes();
@override
GradientColorKeyframeAnimation createAnimation() {

View File

@ -1,13 +1,11 @@
import '../../animation/keyframe/base_keyframe_animation.dart';
import '../../animation/keyframe/integer_keyframe_animation.dart';
import '../../value/keyframe.dart';
import 'base_animatable_value.dart';
class AnimatableIntegerValue extends BaseAnimatableValue<int, int> {
AnimatableIntegerValue() : super.fromValue(100);
AnimatableIntegerValue.fromKeyframes(List<Keyframe<int>> keyframes)
: super.fromKeyframes(keyframes);
AnimatableIntegerValue.fromKeyframes(super.keyframes) : super.fromKeyframes();
@override
BaseKeyframeAnimation<int, int> createAnimation() {

View File

@ -1,11 +1,9 @@
import 'dart:ui';
import '../../animation/keyframe/point_keyframe_animation.dart';
import '../../value/keyframe.dart';
import 'base_animatable_value.dart';
class AnimatablePointValue extends BaseAnimatableValue<Offset, Offset> {
AnimatablePointValue.fromKeyframes(List<Keyframe<Offset>> keyframes)
: super.fromKeyframes(keyframes);
AnimatablePointValue.fromKeyframes(super.keyframes) : super.fromKeyframes();
@override
PointKeyframeAnimation createAnimation() {

View File

@ -1,16 +1,14 @@
import 'dart:ui';
import '../../animation/keyframe/base_keyframe_animation.dart';
import '../../animation/keyframe/point_keyframe_animation.dart';
import '../../value/keyframe.dart';
import 'base_animatable_value.dart';
class AnimatableScaleValue extends BaseAnimatableValue<Offset, Offset> {
AnimatableScaleValue.one() : this(const Offset(1, 1));
AnimatableScaleValue(Offset value) : super.fromValue(value);
AnimatableScaleValue(super.value) : super.fromValue();
AnimatableScaleValue.fromKeyframes(List<Keyframe<Offset>> keyframes)
: super.fromKeyframes(keyframes);
AnimatableScaleValue.fromKeyframes(super.keyframes) : super.fromKeyframes();
@override
BaseKeyframeAnimation<Offset, Offset> createAnimation() {

View File

@ -1,12 +1,10 @@
import 'dart:ui';
import '../../animation/keyframe/shape_keyframe_animation.dart';
import '../../value/keyframe.dart';
import '../content/shape_data.dart';
import 'base_animatable_value.dart';
class AnimatableShapeValue extends BaseAnimatableValue<ShapeData, Path> {
AnimatableShapeValue.fromKeyframes(List<Keyframe<ShapeData>> keyframes)
: super.fromKeyframes(keyframes);
AnimatableShapeValue.fromKeyframes(super.keyframes) : super.fromKeyframes();
@override
ShapeKeyframeAnimation createAnimation() {

View File

@ -1,12 +1,10 @@
import '../../animation/keyframe/text_keyframe_animation.dart';
import '../../value/keyframe.dart';
import '../document_data.dart';
import 'base_animatable_value.dart';
class AnimatableTextFrame
extends BaseAnimatableValue<DocumentData, DocumentData> {
AnimatableTextFrame.fromKeyframes(List<Keyframe<DocumentData>> keyframes)
: super.fromKeyframes(keyframes);
AnimatableTextFrame.fromKeyframes(super.keyframes) : super.fromKeyframes();
@override
TextKeyframeAnimation createAnimation() {

View File

@ -2,19 +2,16 @@ import 'dart:ui';
import 'package:vector_math/vector_math_64.dart';
import '../../animation/keyframe/base_keyframe_animation.dart';
import '../../animation/keyframe/value_callback_keyframe_animation.dart';
import '../../lottie_drawable.dart';
import '../../lottie_property.dart';
import '../../utils.dart';
import '../../value/lottie_value_callback.dart';
import 'base_layer.dart';
import 'layer.dart';
class ImageLayer extends BaseLayer {
final Paint paint = Paint();
BaseKeyframeAnimation<ColorFilter, ColorFilter?>? _colorFilterAnimation;
ImageLayer(LottieDrawable lottieDrawable, Layer layerModel)
: super(lottieDrawable, layerModel);
ImageLayer(super.lottieDrawable, super.layerModel);
@override
void drawLayer(Canvas canvas, Size size, Matrix4 parentMatrix,

View File

@ -1,12 +1,9 @@
import 'dart:ui';
import 'package:vector_math/vector_math_64.dart';
import '../../lottie_drawable.dart';
import 'base_layer.dart';
import 'layer.dart';
class NullLayer extends BaseLayer {
NullLayer(LottieDrawable lottieDrawable, Layer layerModel)
: super(lottieDrawable, layerModel);
NullLayer(super.lottieDrawable, super.layerModel);
@override
void drawLayer(Canvas canvas, Size size, Matrix4 parentMatrix,

View File

@ -157,6 +157,7 @@ class TextLayer extends BaseLayer {
var parentScale = parentMatrix.getScale();
var text = documentData.text;
canvas.transform(parentMatrix.storage);
// Line height
var lineHeight = documentData.lineHeight;
@ -180,12 +181,14 @@ class TextLayer extends BaseLayer {
canvas.translate(0, translateY);
// Draw each line
_drawGlyphTextLine(textLine, documentData, parentMatrix, font, canvas,
_drawGlyphTextLine(textLine, documentData, Matrix4.identity(), font, canvas,
parentScale, fontScale);
// Reset canvas
canvas.restore();
}
canvas.restore();
}
void _drawGlyphTextLine(

View File

@ -13,8 +13,8 @@ class AssetLottie extends LottieProvider {
this.assetName, {
this.bundle,
this.package,
LottieImageProviderFactory? imageProviderFactory,
}) : super(imageProviderFactory: imageProviderFactory);
super.imageProviderFactory,
});
final String assetName;
String get keyName =>

View File

@ -7,8 +7,7 @@ import 'lottie_provider.dart';
import 'provider_io.dart' if (dart.library.html) 'provider_web.dart' as io;
class FileLottie extends LottieProvider {
FileLottie(this.file, {LottieImageProviderFactory? imageProviderFactory})
: super(imageProviderFactory: imageProviderFactory);
FileLottie(this.file, {super.imageProviderFactory});
final Object /*io.File|html.File*/ file;

View File

@ -8,8 +8,7 @@ import 'load_image.dart';
import 'lottie_provider.dart';
class MemoryLottie extends LottieProvider {
MemoryLottie(this.bytes, {LottieImageProviderFactory? imageProviderFactory})
: super(imageProviderFactory: imageProviderFactory);
MemoryLottie(this.bytes, {super.imageProviderFactory});
final Uint8List bytes;

View File

@ -9,9 +9,7 @@ import 'lottie_provider.dart';
import 'provider_io.dart' if (dart.library.html) 'provider_web.dart' as network;
class NetworkLottie extends LottieProvider {
NetworkLottie(this.url,
{this.headers, LottieImageProviderFactory? imageProviderFactory})
: super(imageProviderFactory: imageProviderFactory);
NetworkLottie(this.url, {this.headers, super.imageProviderFactory});
final String url;
final Map<String, String>? headers;

View File

@ -13,7 +13,7 @@ import 'render_lottie.dart';
class RawLottie extends LeafRenderObjectWidget {
/// Creates a widget that displays a Lottie composition.
const RawLottie({
Key? key,
super.key,
this.composition,
this.delegates,
this.options,
@ -25,8 +25,7 @@ class RawLottie extends LeafRenderObjectWidget {
AlignmentGeometry? alignment,
this.filterQuality,
}) : progress = progress ?? 0.0,
alignment = alignment ?? Alignment.center,
super(key: key);
alignment = alignment ?? Alignment.center;
/// The Lottie composition to display.
final LottieComposition? composition;

View File

@ -7,21 +7,21 @@ packages:
name: _fe_analyzer_shared
url: "https://pub.dartlang.org"
source: hosted
version: "48.0.0"
version: "50.0.0"
analyzer:
dependency: "direct dev"
description:
name: analyzer
url: "https://pub.dartlang.org"
source: hosted
version: "5.0.0"
version: "5.2.0"
archive:
dependency: "direct main"
description:
name: archive
url: "https://pub.dartlang.org"
source: hosted
version: "3.3.1"
version: "3.3.2"
args:
dependency: transitive
description:
@ -56,7 +56,7 @@ packages:
name: build_config
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.1.1"
build_daemon:
dependency: transitive
description:
@ -70,21 +70,21 @@ packages:
name: build_resolvers
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.10"
version: "2.1.0"
build_runner:
dependency: "direct dev"
description:
name: build_runner
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.1"
version: "2.3.2"
build_runner_core:
dependency: transitive
description:
name: build_runner_core
url: "https://pub.dartlang.org"
source: hosted
version: "7.2.4"
version: "7.2.7"
built_collection:
dependency: transitive
description:
@ -98,7 +98,7 @@ packages:
name: built_value
url: "https://pub.dartlang.org"
source: hosted
version: "8.4.1"
version: "8.4.2"
characters:
dependency: transitive
description:
@ -126,7 +126,7 @@ packages:
name: code_builder
url: "https://pub.dartlang.org"
source: hosted
version: "4.2.0"
version: "4.3.0"
collection:
dependency: transitive
description:
@ -140,7 +140,7 @@ packages:
name: convert
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.2"
version: "3.1.1"
crypto:
dependency: transitive
description:
@ -199,21 +199,21 @@ packages:
name: frontend_server_client
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
version: "3.1.0"
glob:
dependency: transitive
description:
name: glob
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
version: "2.1.1"
graphs:
dependency: transitive
description:
name: graphs
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
version: "2.2.0"
http_multi_server:
dependency: transitive
description:
@ -227,7 +227,7 @@ packages:
name: http_parser
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.1"
version: "4.0.2"
io:
dependency: transitive
description:
@ -241,28 +241,28 @@ packages:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.4"
version: "0.6.5"
json_annotation:
dependency: transitive
description:
name: json_annotation
url: "https://pub.dartlang.org"
source: hosted
version: "4.6.0"
version: "4.7.0"
lints:
dependency: transitive
description:
name: lints
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.0.1"
logging:
dependency: transitive
description:
name: logging
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
version: "1.1.0"
matcher:
dependency: transitive
description:
@ -318,7 +318,7 @@ packages:
name: pub_semver
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
version: "2.1.2"
pubspec_parse:
dependency: transitive
description:
@ -332,14 +332,14 @@ packages:
name: shelf
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.2"
version: "1.4.0"
shelf_web_socket:
dependency: transitive
description:
name: shelf_web_socket
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
version: "1.0.3"
sky_engine:
dependency: transitive
description: flutter
@ -372,7 +372,7 @@ packages:
name: stream_transform
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.1.0"
string_scanner:
dependency: transitive
description:
@ -421,7 +421,7 @@ packages:
name: watcher
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
version: "1.0.2"
web_socket_channel:
dependency: transitive
description:

View File

@ -1,7 +1,7 @@
name: lottie
description: Render After Effects animations natively on Flutter. This package is a pure Dart implementation of a Lottie player.
version: 2.0.0
homepage: https://github.com/xvrh/lottie-flutter
repository: https://github.com/xvrh/lottie-flutter
environment:
sdk: '>=2.18.0 <3.0.0'

View File

@ -7,8 +7,7 @@ class FilmStrip extends StatelessWidget {
final Size size;
const FilmStrip(this.composition,
{Key? key, required this.size, this.delegates})
: super(key: key);
{super.key, required this.size, this.delegates});
@override
Widget build(BuildContext context) {