Compare commits
3 Commits
v0.8.0-nul
...
v0.8.0-nul
Author | SHA1 | Date | |
---|---|---|---|
6831f475d4 | |||
bbfe04f00d | |||
5b7fde198a |
@ -1,3 +1,7 @@
|
|||||||
|
## [0.8.0]
|
||||||
|
- Migrate to null safety
|
||||||
|
- Fix some rendering bugs
|
||||||
|
|
||||||
## [0.7.1]
|
## [0.7.1]
|
||||||
- Fix a crash for some lottie file with empty paths.
|
- Fix a crash for some lottie file with empty paths.
|
||||||
|
|
||||||
|
BIN
example/assets/spinning_carrousel.zip
Normal file
@ -1,2 +1,3 @@
|
|||||||
|
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
|
||||||
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
|
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
|
||||||
#include "Generated.xcconfig"
|
#include "Generated.xcconfig"
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
|
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
|
||||||
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
|
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
|
||||||
#include "Generated.xcconfig"
|
#include "Generated.xcconfig"
|
||||||
|
@ -86,7 +86,7 @@ class _MyAppState extends State<MyApp> with TickerProviderStateMixin {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 30),
|
const SizedBox(height: 30),
|
||||||
RaisedButton(
|
ElevatedButton(
|
||||||
child: Text('Loop between frames'),
|
child: Text('Loop between frames'),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
// Loop between 2 specifics frames
|
// Loop between 2 specifics frames
|
||||||
|
@ -87,15 +87,15 @@ class _LottieDetailsState extends State<_LottieDetails>
|
|||||||
title: Text('Composition duration'),
|
title: Text('Composition duration'),
|
||||||
trailing: Text(widget.composition.durationFrames.toStringAsFixed(1)),
|
trailing: Text(widget.composition.durationFrames.toStringAsFixed(1)),
|
||||||
),
|
),
|
||||||
RaisedButton(
|
ElevatedButton(
|
||||||
child: Text('touchDownEnd - touchUpCancel'),
|
child: Text('touchDownEnd - touchUpCancel'),
|
||||||
onPressed: () => _playBetween('touchDownEnd', 'touchUpCancel'),
|
onPressed: () => _playBetween('touchDownEnd', 'touchUpCancel'),
|
||||||
),
|
),
|
||||||
RaisedButton(
|
ElevatedButton(
|
||||||
child: Text('touchDownStart - touchDownEnd'),
|
child: Text('touchDownStart - touchDownEnd'),
|
||||||
onPressed: () => _playBetween('touchDownStart', 'touchDownEnd'),
|
onPressed: () => _playBetween('touchDownStart', 'touchDownEnd'),
|
||||||
),
|
),
|
||||||
RaisedButton(
|
ElevatedButton(
|
||||||
child: Text('touchDownEnd - touchUpEnd'),
|
child: Text('touchDownEnd - touchUpEnd'),
|
||||||
onPressed: () => _playBetween('touchDownEnd', 'touchUpEnd'),
|
onPressed: () => _playBetween('touchDownEnd', 'touchUpEnd'),
|
||||||
),
|
),
|
||||||
|
@ -28,7 +28,7 @@ class _MyAppState extends State<MyApp> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
RaisedButton(
|
ElevatedButton(
|
||||||
child: Text('Export all frames'),
|
child: Text('Export all frames'),
|
||||||
onPressed: _export,
|
onPressed: _export,
|
||||||
),
|
),
|
||||||
|
@ -21,7 +21,8 @@ class App extends StatelessWidget {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text('Lottie Flutter'),
|
title: Text('Lottie Flutter'),
|
||||||
),
|
),
|
||||||
body: GridView.builder(
|
body: Scrollbar(
|
||||||
|
child: GridView.builder(
|
||||||
itemCount: files.length,
|
itemCount: files.length,
|
||||||
gridDelegate:
|
gridDelegate:
|
||||||
SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 4),
|
SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 4),
|
||||||
@ -51,6 +52,7 @@ class App extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
|
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
|
||||||
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
|
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
|
||||||
#include "ephemeral/Flutter-Generated.xcconfig"
|
#include "ephemeral/Flutter-Generated.xcconfig"
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
|
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
|
||||||
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
|
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
|
||||||
#include "ephemeral/Flutter-Generated.xcconfig"
|
#include "ephemeral/Flutter-Generated.xcconfig"
|
||||||
|
@ -1,27 +1,28 @@
|
|||||||
PODS:
|
PODS:
|
||||||
- FlutterMacOS (1.0.0)
|
- FlutterMacOS (1.22.4)
|
||||||
- path_provider (0.0.1)
|
- path_provider (0.0.1)
|
||||||
- path_provider_macos (0.0.1):
|
- path_provider_macos (0.0.1):
|
||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
|
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
- FlutterMacOS (from `Flutter/ephemeral/.symlinks/flutter/darwin-x64-profile`)
|
|
||||||
- path_provider (from `Flutter/ephemeral/.symlinks/plugins/path_provider/macos`)
|
- path_provider (from `Flutter/ephemeral/.symlinks/plugins/path_provider/macos`)
|
||||||
- path_provider_macos (from `Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos`)
|
- path_provider_macos (from `Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos`)
|
||||||
|
|
||||||
|
SPEC REPOS:
|
||||||
|
trunk:
|
||||||
|
- FlutterMacOS
|
||||||
|
|
||||||
EXTERNAL SOURCES:
|
EXTERNAL SOURCES:
|
||||||
FlutterMacOS:
|
|
||||||
:path: Flutter/ephemeral/.symlinks/flutter/darwin-x64-profile
|
|
||||||
path_provider:
|
path_provider:
|
||||||
:path: Flutter/ephemeral/.symlinks/plugins/path_provider/macos
|
:path: Flutter/ephemeral/.symlinks/plugins/path_provider/macos
|
||||||
path_provider_macos:
|
path_provider_macos:
|
||||||
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos
|
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_macos/macos
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
FlutterMacOS: 15bea8a44d2fa024068daa0140371c020b4b6ff9
|
FlutterMacOS: ac210ef71944b3f04789076d70d4c72c7ec0c619
|
||||||
path_provider: e0848572d1d38b9a7dd099e79cf83f5b7e2cde9f
|
path_provider: e0848572d1d38b9a7dd099e79cf83f5b7e2cde9f
|
||||||
path_provider_macos: a0a3fd666cb7cd0448e936fb4abad4052961002b
|
path_provider_macos: a0a3fd666cb7cd0448e936fb4abad4052961002b
|
||||||
|
|
||||||
PODFILE CHECKSUM: d8ba9b3e9e93c62c74a660b46c6fcb09f03991a7
|
PODFILE CHECKSUM: d8ba9b3e9e93c62c74a660b46c6fcb09f03991a7
|
||||||
|
|
||||||
COCOAPODS: 1.10.0
|
COCOAPODS: 1.10.1
|
||||||
|
@ -26,10 +26,6 @@
|
|||||||
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
|
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
|
||||||
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
|
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
|
||||||
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
|
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
|
||||||
33D1A10422148B71006C7A3E /* FlutterMacOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */; };
|
|
||||||
33D1A10522148B93006C7A3E /* FlutterMacOS.framework in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
|
||||||
D73912F022F37F9E000D13A0 /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D73912EF22F37F9E000D13A0 /* App.framework */; };
|
|
||||||
D73912F222F3801D000D13A0 /* App.framework in Bundle Framework */ = {isa = PBXBuildFile; fileRef = D73912EF22F37F9E000D13A0 /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
|
||||||
F03CC91740A974D36C2A6384 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0BC6FF5FCD90624533CC60DB /* Pods_Runner.framework */; };
|
F03CC91740A974D36C2A6384 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0BC6FF5FCD90624533CC60DB /* Pods_Runner.framework */; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
@ -50,8 +46,6 @@
|
|||||||
dstPath = "";
|
dstPath = "";
|
||||||
dstSubfolderSpec = 10;
|
dstSubfolderSpec = 10;
|
||||||
files = (
|
files = (
|
||||||
D73912F222F3801D000D13A0 /* App.framework in Bundle Framework */,
|
|
||||||
33D1A10522148B93006C7A3E /* FlutterMacOS.framework in Bundle Framework */,
|
|
||||||
);
|
);
|
||||||
name = "Bundle Framework";
|
name = "Bundle Framework";
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
@ -73,14 +67,12 @@
|
|||||||
33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = "<group>"; };
|
33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = "<group>"; };
|
||||||
33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = "<group>"; };
|
33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = "<group>"; };
|
||||||
33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = "<group>"; };
|
33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = "<group>"; };
|
||||||
33D1A10322148B71006C7A3E /* FlutterMacOS.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FlutterMacOS.framework; path = Flutter/ephemeral/FlutterMacOS.framework; sourceTree = SOURCE_ROOT; };
|
|
||||||
33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = "<group>"; };
|
33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = "<group>"; };
|
||||||
33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = "<group>"; };
|
33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = "<group>"; };
|
||||||
33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = "<group>"; };
|
33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = "<group>"; };
|
||||||
5B4C0E87024EC2686CA05E23 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
5B4C0E87024EC2686CA05E23 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
|
||||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
|
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
|
||||||
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
|
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
|
||||||
D73912EF22F37F9E000D13A0 /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/ephemeral/App.framework; sourceTree = SOURCE_ROOT; };
|
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
@ -88,8 +80,6 @@
|
|||||||
isa = PBXFrameworksBuildPhase;
|
isa = PBXFrameworksBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
D73912F022F37F9E000D13A0 /* App.framework in Frameworks */,
|
|
||||||
33D1A10422148B71006C7A3E /* FlutterMacOS.framework in Frameworks */,
|
|
||||||
F03CC91740A974D36C2A6384 /* Pods_Runner.framework in Frameworks */,
|
F03CC91740A974D36C2A6384 /* Pods_Runner.framework in Frameworks */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
@ -145,8 +135,6 @@
|
|||||||
33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */,
|
33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */,
|
||||||
33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */,
|
33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */,
|
||||||
33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */,
|
33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */,
|
||||||
D73912EF22F37F9E000D13A0 /* App.framework */,
|
|
||||||
33D1A10322148B71006C7A3E /* FlutterMacOS.framework */,
|
|
||||||
);
|
);
|
||||||
path = Flutter;
|
path = Flutter;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -281,7 +269,7 @@
|
|||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename\n";
|
shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n";
|
||||||
};
|
};
|
||||||
33CC111E2044C6BF0003C045 /* ShellScript */ = {
|
33CC111E2044C6BF0003C045 /* ShellScript */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
@ -129,14 +129,14 @@ packages:
|
|||||||
name: logging
|
name: logging
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.0-nullsafety.0"
|
version: "1.0.0"
|
||||||
lottie:
|
lottie:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
path: ".."
|
path: ".."
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "0.8.0-nullsafety.0"
|
version: "0.8.0-nullsafety.2"
|
||||||
matcher:
|
matcher:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -298,4 +298,4 @@ packages:
|
|||||||
version: "0.1.2"
|
version: "0.1.2"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.12.0-29.10.beta <3.0.0"
|
dart: ">=2.12.0-29.10.beta <3.0.0"
|
||||||
flutter: ">=1.24.0-10.2.pre <2.0.0"
|
flutter: ">=1.24.0-10.2.pre"
|
||||||
|
74
example/test/dynamic_image_test.dart
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
import 'dart:io';
|
||||||
|
import 'dart:ui' as ui;
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
import 'package:lottie/lottie.dart';
|
||||||
|
import 'utils.dart';
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
testWidgets('Can specify ImageProvider with zip file ', (tester) async {
|
||||||
|
var size = Size(500, 400);
|
||||||
|
tester.binding.window.physicalSizeTestValue = size;
|
||||||
|
tester.binding.window.devicePixelRatioTestValue = 1.0;
|
||||||
|
|
||||||
|
var callCount = 0;
|
||||||
|
LottieImageProviderFactory imageProviderFactory = (image) {
|
||||||
|
++callCount;
|
||||||
|
return FileImage(File('assets/Images/WeAccept/img_0.png'));
|
||||||
|
};
|
||||||
|
|
||||||
|
var composition = (await tester.runAsync(() => FileLottie(
|
||||||
|
File('assets/spinning_carrousel.zip'),
|
||||||
|
imageProviderFactory: imageProviderFactory)
|
||||||
|
.load()))!;
|
||||||
|
|
||||||
|
await tester.pumpWidget(FilmStrip(composition, size: size));
|
||||||
|
|
||||||
|
expect(callCount, 2);
|
||||||
|
await expectLater(find.byType(FilmStrip),
|
||||||
|
matchesGoldenFile('goldens/dynamic_image/zip_with_provider.png'));
|
||||||
|
});
|
||||||
|
|
||||||
|
testWidgets('Can specify image delegate', (tester) async {
|
||||||
|
var size = Size(500, 400);
|
||||||
|
tester.binding.window.physicalSizeTestValue = size;
|
||||||
|
tester.binding.window.devicePixelRatioTestValue = 1.0;
|
||||||
|
|
||||||
|
var image = await tester.runAsync(
|
||||||
|
() => loadImage(FileImage(File('assets/Images/WeAccept/img_0.png'))));
|
||||||
|
|
||||||
|
var composition = (await tester.runAsync(
|
||||||
|
() => FileLottie(File('assets/spinning_carrousel.zip')).load()))!;
|
||||||
|
|
||||||
|
var delegates = LottieDelegates(image: (composition, asset) {
|
||||||
|
return image;
|
||||||
|
});
|
||||||
|
await tester.pumpWidget(FilmStrip(
|
||||||
|
composition,
|
||||||
|
size: size,
|
||||||
|
delegates: delegates,
|
||||||
|
));
|
||||||
|
|
||||||
|
await expectLater(find.byType(FilmStrip),
|
||||||
|
matchesGoldenFile('goldens/dynamic_image/delegate.png'));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<ui.Image?> loadImage(ImageProvider provider) {
|
||||||
|
var completer = Completer<ui.Image?>();
|
||||||
|
var imageStream = provider.resolve(ImageConfiguration.empty);
|
||||||
|
late ImageStreamListener listener;
|
||||||
|
listener = ImageStreamListener((image, synchronousLoaded) {
|
||||||
|
imageStream.removeListener(listener);
|
||||||
|
|
||||||
|
completer.complete(image.image);
|
||||||
|
}, onError: (dynamic e, __) {
|
||||||
|
imageStream.removeListener(listener);
|
||||||
|
|
||||||
|
completer.complete();
|
||||||
|
});
|
||||||
|
imageStream.addListener(listener);
|
||||||
|
|
||||||
|
return completer.future;
|
||||||
|
}
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 884 B After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 65 KiB |
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 67 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 8.0 KiB After Width: | Height: | Size: 8.0 KiB |
BIN
example/test/goldens/all/spinning_carrousel.png
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
example/test/goldens/dynamic_image/delegate.png
Normal file
After Width: | Height: | Size: 62 KiB |
BIN
example/test/goldens/dynamic_image/zip_with_provider.png
Normal file
After Width: | Height: | Size: 62 KiB |
@ -9,6 +9,7 @@ export 'src/model/marker.dart' show Marker;
|
|||||||
export 'src/options.dart' show LottieOptions;
|
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/load_image.dart' show LottieImageProviderFactory;
|
||||||
export 'src/providers/lottie_provider.dart' show LottieProvider;
|
export 'src/providers/lottie_provider.dart' show LottieProvider;
|
||||||
export 'src/providers/memory_provider.dart' show MemoryLottie;
|
export 'src/providers/memory_provider.dart' show MemoryLottie;
|
||||||
export 'src/providers/network_provider.dart' show NetworkLottie;
|
export 'src/providers/network_provider.dart' show NetworkLottie;
|
||||||
|
@ -241,11 +241,9 @@ abstract class BaseStrokeContent
|
|||||||
var bounds = _path.getBounds();
|
var bounds = _path.getBounds();
|
||||||
|
|
||||||
var width = _widthAnimation.value;
|
var width = _widthAnimation.value;
|
||||||
bounds = Rect.fromLTWH(bounds.left - width / 2.0, bounds.top - width / 2.0,
|
bounds = bounds.inflate(width / 2.0);
|
||||||
bounds.right + width / 2.0, bounds.bottom + width / 2.0);
|
|
||||||
// Add padding to account for rounding errors.
|
// Add padding to account for rounding errors.
|
||||||
bounds = Rect.fromLTWH(
|
bounds = bounds.inflate(1);
|
||||||
bounds.left - 1, bounds.top - 1, bounds.right + 1, bounds.bottom + 1);
|
|
||||||
L.endSection('StrokeContent#getBounds');
|
L.endSection('StrokeContent#getBounds');
|
||||||
return bounds;
|
return bounds;
|
||||||
}
|
}
|
||||||
|
@ -102,8 +102,7 @@ class FillContent implements DrawingContent, KeyPathElementContent {
|
|||||||
}
|
}
|
||||||
var outBounds = _path.getBounds();
|
var outBounds = _path.getBounds();
|
||||||
// Add padding to account for rounding errors.
|
// Add padding to account for rounding errors.
|
||||||
outBounds = Rect.fromLTWH(outBounds.left - 1, outBounds.top - 1,
|
outBounds = outBounds.inflate(1);
|
||||||
outBounds.right + 1, outBounds.bottom + 1);
|
|
||||||
return outBounds;
|
return outBounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,8 +127,7 @@ class GradientFillContent implements DrawingContent, KeyPathElementContent {
|
|||||||
|
|
||||||
var outBounds = _path.getBounds();
|
var outBounds = _path.getBounds();
|
||||||
// Add padding to account for rounding errors.
|
// Add padding to account for rounding errors.
|
||||||
return Rect.fromLTWH(outBounds.left - 1, outBounds.top - 1,
|
return outBounds.inflate(1);
|
||||||
outBounds.right + 1, outBounds.bottom + 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Gradient _getLinearGradient() {
|
Gradient _getLinearGradient() {
|
||||||
|
@ -34,12 +34,14 @@ class CompositionParameters {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class LottieComposition {
|
class LottieComposition {
|
||||||
static Future<LottieComposition> fromByteData(ByteData data, {String? name}) {
|
static Future<LottieComposition> fromByteData(ByteData data,
|
||||||
return fromBytes(data.buffer.asUint8List(), name: name);
|
{String? name, LottieImageProviderFactory? imageProviderFactory}) {
|
||||||
|
return fromBytes(data.buffer.asUint8List(),
|
||||||
|
name: name, imageProviderFactory: imageProviderFactory);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<LottieComposition> fromBytes(Uint8List bytes,
|
static Future<LottieComposition> fromBytes(Uint8List bytes,
|
||||||
{String? name}) async {
|
{String? name, LottieImageProviderFactory? imageProviderFactory}) async {
|
||||||
Archive? archive;
|
Archive? archive;
|
||||||
if (bytes[0] == 0x50 && bytes[1] == 0x4B) {
|
if (bytes[0] == 0x50 && bytes[1] == 0x4B) {
|
||||||
archive = ZipDecoder().decodeBytes(bytes);
|
archive = ZipDecoder().decodeBytes(bytes);
|
||||||
@ -55,8 +57,18 @@ class LottieComposition {
|
|||||||
var imagePath = p.posix.join(image.dirName, image.fileName);
|
var imagePath = p.posix.join(image.dirName, image.fileName);
|
||||||
var found = archive.files.firstWhereOrNull(
|
var found = archive.files.firstWhereOrNull(
|
||||||
(f) => f.name.toLowerCase() == imagePath.toLowerCase());
|
(f) => f.name.toLowerCase() == imagePath.toLowerCase());
|
||||||
|
|
||||||
|
ImageProvider? provider;
|
||||||
|
if (imageProviderFactory != null) {
|
||||||
|
provider = imageProviderFactory(image);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (provider != null) {
|
||||||
|
image.loadedImage = await loadImage(composition, image, provider);
|
||||||
|
}
|
||||||
|
|
||||||
if (found != null) {
|
if (found != null) {
|
||||||
image.loadedImage = await loadImage(
|
image.loadedImage ??= await loadImage(
|
||||||
composition, image, MemoryImage(found.content as Uint8List));
|
composition, image, MemoryImage(found.content as Uint8List));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -381,14 +381,11 @@ class _LottieBuilderState extends State<LottieBuilder> {
|
|||||||
void _load() {
|
void _load() {
|
||||||
var provider = widget.lottie;
|
var provider = widget.lottie;
|
||||||
_loadingFuture = widget.lottie.load().then((composition) {
|
_loadingFuture = widget.lottie.load().then((composition) {
|
||||||
print('Loaded');
|
|
||||||
if (mounted && widget.onLoaded != null && widget.lottie == provider) {
|
if (mounted && widget.onLoaded != null && widget.lottie == provider) {
|
||||||
widget.onLoaded!(composition);
|
widget.onLoaded!(composition);
|
||||||
}
|
}
|
||||||
|
|
||||||
return composition;
|
return composition;
|
||||||
}, onError: (Object e, StackTrace t) {
|
|
||||||
print('Load error $e $t');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
|
import 'dart:ui' as ui;
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
|
import '../lottie.dart';
|
||||||
import 'lottie_drawable.dart';
|
import 'lottie_drawable.dart';
|
||||||
import 'value_delegate.dart';
|
import 'value_delegate.dart';
|
||||||
|
|
||||||
@ -43,12 +45,31 @@ class LottieDelegates {
|
|||||||
/// ```
|
/// ```
|
||||||
final List<ValueDelegate>? values;
|
final List<ValueDelegate>? values;
|
||||||
|
|
||||||
//TODO(xha): imageDelegate to change the image to display?
|
/// A callback to dynamically change an image of the animation.
|
||||||
|
///
|
||||||
|
/// Example:
|
||||||
|
/// ```dart
|
||||||
|
/// Lottie.asset(
|
||||||
|
// 'assets/data.json',
|
||||||
|
// delegates: LottieDelegates(
|
||||||
|
// image: (composition, image) {
|
||||||
|
// if (image.id == 'img_0' && _isMouseOver) {
|
||||||
|
// return myCustomImage;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // Use the default method: composition.images[image.id].loadedImage;
|
||||||
|
// return null;
|
||||||
|
// },
|
||||||
|
// )
|
||||||
|
// )
|
||||||
|
/// ```
|
||||||
|
final ui.Image? Function(LottieComposition, LottieImageAsset)? image;
|
||||||
|
|
||||||
LottieDelegates({
|
LottieDelegates({
|
||||||
this.text,
|
this.text,
|
||||||
TextStyle Function(LottieFontStyle)? textStyle,
|
TextStyle Function(LottieFontStyle)? textStyle,
|
||||||
this.values,
|
this.values,
|
||||||
|
this.image,
|
||||||
}) : textStyle = textStyle;
|
}) : textStyle = textStyle;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -79,7 +79,13 @@ class LottieDrawable {
|
|||||||
ui.Image? getImageAsset(String? ref) {
|
ui.Image? getImageAsset(String? ref) {
|
||||||
var imageAsset = composition.images[ref];
|
var imageAsset = composition.images[ref];
|
||||||
if (imageAsset != null) {
|
if (imageAsset != null) {
|
||||||
return imageAsset.loadedImage;
|
var imageDelegate = delegates?.image;
|
||||||
|
ui.Image? image;
|
||||||
|
if (imageDelegate != null) {
|
||||||
|
image = imageDelegate(composition, imageAsset);
|
||||||
|
}
|
||||||
|
|
||||||
|
return image ?? imageAsset.loadedImage;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ abstract class BaseLayer implements DrawingContent, KeyPathElement {
|
|||||||
static BaseLayer? forModel(Layer layerModel, LottieDrawable drawable,
|
static BaseLayer? forModel(Layer layerModel, LottieDrawable drawable,
|
||||||
LottieComposition composition) {
|
LottieComposition composition) {
|
||||||
switch (layerModel.layerType) {
|
switch (layerModel.layerType) {
|
||||||
case LayerType.shap:
|
case LayerType.shape:
|
||||||
return ShapeLayer(drawable, layerModel);
|
return ShapeLayer(drawable, layerModel);
|
||||||
case LayerType.preComp:
|
case LayerType.preComp:
|
||||||
return CompositionLayer(drawable, layerModel,
|
return CompositionLayer(drawable, layerModel,
|
||||||
@ -197,11 +197,11 @@ abstract class BaseLayer implements DrawingContent, KeyPathElement {
|
|||||||
var bounds = getBounds(_matrix, applyParents: false);
|
var bounds = getBounds(_matrix, applyParents: false);
|
||||||
|
|
||||||
// Uncomment this to draw matte outlines.
|
// Uncomment this to draw matte outlines.
|
||||||
/* Paint paint = new LPaint();
|
/*var paint = Paint()
|
||||||
paint.setColor(Color.RED);
|
..color = Color(0xFF00FF00)
|
||||||
paint.setStyle(Paint.Style.STROKE);
|
..style = PaintingStyle.stroke
|
||||||
paint.setStrokeWidth(3);
|
..strokeWidth = 3;
|
||||||
canvas.drawRect(rect, paint); */
|
canvas.drawRect(bounds, paint);*/
|
||||||
|
|
||||||
bounds = _intersectBoundsWithMatte(bounds, parentMatrix);
|
bounds = _intersectBoundsWithMatte(bounds, parentMatrix);
|
||||||
|
|
||||||
@ -261,10 +261,7 @@ abstract class BaseLayer implements DrawingContent, KeyPathElement {
|
|||||||
void _clearCanvas(Canvas canvas, Rect bounds) {
|
void _clearCanvas(Canvas canvas, Rect bounds) {
|
||||||
L.beginSection('Layer#clearLayer');
|
L.beginSection('Layer#clearLayer');
|
||||||
// If we don't pad the clear draw, some phones leave a 1px border of the graphics buffer.
|
// If we don't pad the clear draw, some phones leave a 1px border of the graphics buffer.
|
||||||
canvas.drawRect(
|
canvas.drawRect(bounds.inflate(1), _clearPaint);
|
||||||
Rect.fromLTRB(bounds.left - 1, bounds.top - 1, bounds.right + 1,
|
|
||||||
bounds.bottom + 1),
|
|
||||||
_clearPaint);
|
|
||||||
L.endSection('Layer#clearLayer');
|
L.endSection('Layer#clearLayer');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import '../animatable/animatable_transform.dart';
|
|||||||
import '../content/content_model.dart';
|
import '../content/content_model.dart';
|
||||||
import '../content/mask.dart';
|
import '../content/mask.dart';
|
||||||
|
|
||||||
enum LayerType { preComp, solid, image, nullLayer, shap, text, unknown }
|
enum LayerType { preComp, solid, image, nullLayer, shape, text, unknown }
|
||||||
|
|
||||||
enum MatteType { none, add, invert, unknown }
|
enum MatteType { none, add, invert, unknown }
|
||||||
|
|
||||||
|
@ -101,14 +101,13 @@ class LottieCompositionParser {
|
|||||||
}
|
}
|
||||||
layers.add(layer);
|
layers.add(layer);
|
||||||
layerMap[layer.id] = layer;
|
layerMap[layer.id] = layer;
|
||||||
|
}
|
||||||
if (imageCount > 4) {
|
if (imageCount > 4) {
|
||||||
composition.addWarning(
|
composition.addWarning(
|
||||||
'You have $imageCount images. Lottie should primarily be '
|
'You have $imageCount images. Lottie should primarily be '
|
||||||
'used with shapes. If you are using Adobe Illustrator, convert the Illustrator layers'
|
'used with shapes. If you are using Adobe Illustrator, convert the Illustrator layers'
|
||||||
' to shape layers.');
|
' to shape layers.');
|
||||||
}
|
}
|
||||||
}
|
|
||||||
reader.endArray();
|
reader.endArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +33,8 @@ class AssetLottie extends LottieProvider {
|
|||||||
var data = await chosenBundle.load(keyName);
|
var data = await chosenBundle.load(keyName);
|
||||||
|
|
||||||
var composition = await LottieComposition.fromByteData(data,
|
var composition = await LottieComposition.fromByteData(data,
|
||||||
name: p.url.basenameWithoutExtension(keyName));
|
name: p.url.basenameWithoutExtension(keyName),
|
||||||
|
imageProviderFactory: imageProviderFactory);
|
||||||
|
|
||||||
for (var image in composition.images.values) {
|
for (var image in composition.images.values) {
|
||||||
image.loadedImage ??= await _loadImage(composition, image);
|
image.loadedImage ??= await _loadImage(composition, image);
|
||||||
|
@ -18,7 +18,8 @@ class FileLottie extends LottieProvider {
|
|||||||
return sharedLottieCache.putIfAbsent(cacheKey, () async {
|
return sharedLottieCache.putIfAbsent(cacheKey, () async {
|
||||||
var bytes = await io.loadFile(file);
|
var bytes = await io.loadFile(file);
|
||||||
var composition = await LottieComposition.fromBytes(bytes,
|
var composition = await LottieComposition.fromBytes(bytes,
|
||||||
name: p.basenameWithoutExtension(io.filePath(file)));
|
name: p.basenameWithoutExtension(io.filePath(file)),
|
||||||
|
imageProviderFactory: imageProviderFactory);
|
||||||
|
|
||||||
for (var image in composition.images.values) {
|
for (var image in composition.images.values) {
|
||||||
image.loadedImage ??= await _loadImage(composition, image);
|
image.loadedImage ??= await _loadImage(composition, image);
|
||||||
|
@ -4,7 +4,7 @@ import 'package:flutter/widgets.dart';
|
|||||||
import '../composition.dart';
|
import '../composition.dart';
|
||||||
import '../lottie_image_asset.dart';
|
import '../lottie_image_asset.dart';
|
||||||
|
|
||||||
typedef LottieImageProviderFactory = ImageProvider Function(LottieImageAsset);
|
typedef LottieImageProviderFactory = ImageProvider? Function(LottieImageAsset);
|
||||||
|
|
||||||
Future<ui.Image?> loadImage(LottieComposition composition,
|
Future<ui.Image?> loadImage(LottieComposition composition,
|
||||||
LottieImageAsset lottieImage, ImageProvider provider) {
|
LottieImageAsset lottieImage, ImageProvider provider) {
|
||||||
|
@ -18,7 +18,8 @@ class MemoryLottie extends LottieProvider {
|
|||||||
// TODO(xha): hash the list content
|
// TODO(xha): hash the list content
|
||||||
var cacheKey = 'memory-${bytes.hashCode}-${bytes.lengthInBytes}';
|
var cacheKey = 'memory-${bytes.hashCode}-${bytes.lengthInBytes}';
|
||||||
return sharedLottieCache.putIfAbsent(cacheKey, () async {
|
return sharedLottieCache.putIfAbsent(cacheKey, () async {
|
||||||
var composition = await LottieComposition.fromBytes(bytes);
|
var composition = await LottieComposition.fromBytes(bytes,
|
||||||
|
imageProviderFactory: imageProviderFactory);
|
||||||
for (var image in composition.images.values) {
|
for (var image in composition.images.values) {
|
||||||
image.loadedImage ??= await _loadImage(composition, image);
|
image.loadedImage ??= await _loadImage(composition, image);
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,8 @@ class NetworkLottie extends LottieProvider {
|
|||||||
var bytes = await network.loadHttp(resolved, headers: headers);
|
var bytes = await network.loadHttp(resolved, headers: headers);
|
||||||
|
|
||||||
var composition = await LottieComposition.fromBytes(bytes,
|
var composition = await LottieComposition.fromBytes(bytes,
|
||||||
name: p.url.basenameWithoutExtension(url));
|
name: p.url.basenameWithoutExtension(url),
|
||||||
|
imageProviderFactory: imageProviderFactory);
|
||||||
|
|
||||||
for (var image in composition.images.values) {
|
for (var image in composition.images.values) {
|
||||||
image.loadedImage ??= await _loadImage(resolved, composition, image);
|
image.loadedImage ??= await _loadImage(resolved, composition, image);
|
||||||
|
24
pubspec.lock
@ -49,7 +49,7 @@ packages:
|
|||||||
name: build
|
name: build
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.6.1"
|
version: "1.6.2"
|
||||||
build_config:
|
build_config:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -63,28 +63,28 @@ packages:
|
|||||||
name: build_daemon
|
name: build_daemon
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.6"
|
version: "2.1.7"
|
||||||
build_resolvers:
|
build_resolvers:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: build_resolvers
|
name: build_resolvers
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.5.2"
|
version: "1.5.3"
|
||||||
build_runner:
|
build_runner:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: build_runner
|
name: build_runner
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.11.0"
|
version: "1.11.1"
|
||||||
build_runner_core:
|
build_runner_core:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: build_runner_core
|
name: build_runner_core
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.1.6"
|
version: "6.1.7"
|
||||||
built_collection:
|
built_collection:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -248,7 +248,7 @@ packages:
|
|||||||
name: js
|
name: js
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.6.2"
|
version: "0.6.3"
|
||||||
json_annotation:
|
json_annotation:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -262,7 +262,7 @@ packages:
|
|||||||
name: logging
|
name: logging
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.0-nullsafety.0"
|
version: "1.0.0"
|
||||||
matcher:
|
matcher:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -283,14 +283,14 @@ packages:
|
|||||||
name: mime
|
name: mime
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.9.7"
|
version: "1.0.0"
|
||||||
mockito:
|
mockito:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: mockito
|
name: mockito
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.0.0-nullsafety.5"
|
version: "5.0.0-nullsafety.7"
|
||||||
node_interop:
|
node_interop:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -325,7 +325,7 @@ packages:
|
|||||||
name: pedantic
|
name: pedantic
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.9.2"
|
version: "1.10.0"
|
||||||
pool:
|
pool:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -367,7 +367,7 @@ packages:
|
|||||||
name: shelf_web_socket
|
name: shelf_web_socket
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.2.3"
|
version: "0.2.4"
|
||||||
sky_engine:
|
sky_engine:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: flutter
|
description: flutter
|
||||||
@ -470,6 +470,6 @@ packages:
|
|||||||
name: yaml
|
name: yaml
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.1"
|
version: "3.0.0-nullsafety.0"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.12.0-0.0 <3.0.0"
|
dart: ">=2.12.0-0.0 <3.0.0"
|
||||||
|
20
pubspec.yaml
@ -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.8.0-nullsafety.0
|
version: 0.8.0-nullsafety.3
|
||||||
homepage: https://github.com/xvrh/lottie-flutter
|
homepage: https://github.com/xvrh/lottie-flutter
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
@ -8,15 +8,15 @@ environment:
|
|||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
archive: ^3.0.0-nullsafety.0
|
archive: ^3.0.0-nullsafety.0
|
||||||
characters: ^1.0.0-nullsafety.0
|
characters: ^1.1.0-nullsafety.5
|
||||||
charcode: ^1.2.0-nullsafety.0
|
charcode: ^1.2.0-nullsafety.3
|
||||||
collection: ^1.15.0-nullsafety.0
|
collection: ^1.15.0-nullsafety.5
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
logging: ^1.0.0-nullsafety.0
|
logging: ^1.0.0
|
||||||
meta: ^1.3.0-nullsafety.0
|
meta: ^1.3.0-nullsafety.6
|
||||||
path: ^1.8.0-nullsafety.0
|
path: ^1.8.0-nullsafety.3
|
||||||
vector_math: ^2.0.0-nullsafety.0
|
vector_math: ^2.1.0-nullsafety.5
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
analyzer:
|
analyzer:
|
||||||
@ -24,5 +24,5 @@ dev_dependencies:
|
|||||||
dart_style:
|
dart_style:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
mockito: ^5.0.0-nullsafety.1
|
mockito: ^5.0.0-nullsafety.7
|
||||||
yaml:
|
yaml: ^3.0.0-nullsafety.0
|
||||||
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
@ -1,10 +1,13 @@
|
|||||||
|
// Mocks generated by Mockito 5.0.0-nullsafety.7 from annotations
|
||||||
|
// in lottie/test/lottie_test.dart.
|
||||||
|
// Do not manually edit this file.
|
||||||
|
|
||||||
import 'dart:async' as _i4;
|
import 'dart:async' as _i4;
|
||||||
import 'dart:typed_data' as _i2;
|
import 'dart:typed_data' as _i2;
|
||||||
import 'package:flutter/src/services/asset_bundle.dart' as _i3;
|
import 'package:flutter/src/services/asset_bundle.dart' as _i3;
|
||||||
import 'package:mockito/mockito.dart' as _i1;
|
import 'package:mockito/mockito.dart' as _i1;
|
||||||
|
|
||||||
// ignore_for_file: comment_references
|
// ignore_for_file: comment_references
|
||||||
|
|
||||||
// ignore_for_file: unnecessary_parenthesis
|
// ignore_for_file: unnecessary_parenthesis
|
||||||
|
|
||||||
class _FakeByteData extends _i1.Fake implements _i2.ByteData {}
|
class _FakeByteData extends _i1.Fake implements _i2.ByteData {}
|
||||||
@ -19,22 +22,23 @@ class MockAssetBundle extends _i1.Mock implements _i3.AssetBundle {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
_i4.Future<_i2.ByteData> load(String? key) => (super.noSuchMethod(
|
_i4.Future<_i2.ByteData> load(String? key) => (super.noSuchMethod(
|
||||||
Invocation.method(#load, [key]), Future.value(_FakeByteData()))
|
Invocation.method(#load, [key]),
|
||||||
as _i4.Future<_i2.ByteData>);
|
returnValue: Future.value(_FakeByteData())) as _i4.Future<_i2.ByteData>);
|
||||||
@override
|
@override
|
||||||
_i4.Future<String> loadString(String? key, {bool? cache = true}) =>
|
_i4.Future<String> loadString(String? key, {bool? cache = true}) => (super
|
||||||
(super.noSuchMethod(
|
.noSuchMethod(Invocation.method(#loadString, [key], {#cache: cache}),
|
||||||
Invocation.method(#loadString, [key], {#cache: cache}),
|
returnValue: Future.value('')) as _i4.Future<String>);
|
||||||
Future.value('')) as _i4.Future<String>);
|
|
||||||
@override
|
@override
|
||||||
_i4.Future<T> loadStructuredData<T>(
|
_i4.Future<T> loadStructuredData<T>(
|
||||||
String? key, _i4.Future<T> Function(String)? parser) =>
|
String? key, _i4.Future<T> Function(String)? parser) =>
|
||||||
(super.noSuchMethod(Invocation.method(#loadStructuredData, [key, parser]),
|
(super.noSuchMethod(Invocation.method(#loadStructuredData, [key, parser]),
|
||||||
Future.value(null)) as _i4.Future<T>);
|
returnValue: Future.value(null)) as _i4.Future<T>);
|
||||||
@override
|
@override
|
||||||
void evict(String? key) =>
|
void evict(String? key) =>
|
||||||
super.noSuchMethod(Invocation.method(#evict, [key]));
|
super.noSuchMethod(Invocation.method(#evict, [key]),
|
||||||
|
returnValueForMissingStub: null);
|
||||||
@override
|
@override
|
||||||
String toString() =>
|
String toString() =>
|
||||||
(super.noSuchMethod(Invocation.method(#toString, []), '') as String);
|
(super.noSuchMethod(Invocation.method(#toString, []), returnValue: '')
|
||||||
|
as String);
|
||||||
}
|
}
|
||||||
|