Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
bf7d0ebf05 | |||
57faea6f5e | |||
548c77dc45 |
2
.github/workflows/analyze-and-test.yaml
vendored
@ -10,7 +10,7 @@ jobs:
|
|||||||
name: Flutter analyze
|
name: Flutter analyze
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
flutter: ['stable', 'dev']
|
flutter: ['stable']
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
14
CHANGELOG.md
@ -1,3 +1,17 @@
|
|||||||
|
## [0.7.0]
|
||||||
|
- Performance improvement for complex animations.
|
||||||
|
|
||||||
|
## [0.6.0]
|
||||||
|
- Runs the animation at the frame rate specified in the json file (ie. An animation encoded with a 20 FPS will only
|
||||||
|
be paint 20 times per seconds even though the AnimationController will invalidate the widget 60 times per seconds).
|
||||||
|
A new property `frameRate` allows to opt-out this behavior and have the widget to repaint at the device frame rate
|
||||||
|
(`FrameRate.max`).
|
||||||
|
- Automatically add a `RepaintBoundary` around the widget. Since `Lottie` animations are generally complex to paint, a
|
||||||
|
`RepaintBoundary` will separate the animation with the rest of the app and improve performance. A new property `addRepaintBoundary`
|
||||||
|
allows to opt-out this behavior.
|
||||||
|
- Fix a bug where we would call `markNeedPaint` when the animation was not changing. This removes unnecessary paints in
|
||||||
|
animations with static periods.
|
||||||
|
|
||||||
## [0.5.1]
|
## [0.5.1]
|
||||||
- Remove direct dependencies on dart:io to support Flutter Web
|
- Remove direct dependencies on dart:io to support Flutter Web
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ This example shows how to display a Lottie animation in the simplest way.
|
|||||||
The `Lottie` widget will load the json file and run the animation indefinitely.
|
The `Lottie` widget will load the json file and run the animation indefinitely.
|
||||||
|
|
||||||
```dart
|
```dart
|
||||||
import 'example/lib/examples/main.dart';
|
import 'example/lib/main.dart';
|
||||||
```
|
```
|
||||||
|
|
||||||
### Specify a custom `AnimationController`
|
### Specify a custom `AnimationController`
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:lottie/lottie.dart';
|
|
||||||
|
|
||||||
void main() => runApp(MyApp());
|
|
||||||
|
|
||||||
class MyApp extends StatelessWidget {
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return MaterialApp(
|
|
||||||
home: Scaffold(
|
|
||||||
body: ListView(
|
|
||||||
children: [
|
|
||||||
// Load a Lottie file from your assets
|
|
||||||
Lottie.asset('assets/LottieLogo1.json'),
|
|
||||||
|
|
||||||
// Load a Lottie file from a remote url
|
|
||||||
Lottie.network(
|
|
||||||
'https://raw.githubusercontent.com/xvrh/lottie-flutter/master/example/assets/Mobilo/A.json'),
|
|
||||||
|
|
||||||
// Load an animation and its images from a zip file
|
|
||||||
Lottie.asset('assets/lottiefiles/angel.zip'),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,157 +1,24 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:logging/logging.dart';
|
|
||||||
import 'package:lottie/lottie.dart';
|
import 'package:lottie/lottie.dart';
|
||||||
import 'src/all_files.g.dart';
|
|
||||||
|
|
||||||
void main() {
|
void main() => runApp(MyApp());
|
||||||
Logger.root
|
|
||||||
..level = Level.ALL
|
|
||||||
..onRecord.listen(print);
|
|
||||||
Lottie.traceEnabled = true;
|
|
||||||
runApp(App());
|
|
||||||
}
|
|
||||||
|
|
||||||
class App extends StatelessWidget {
|
class MyApp extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
//showPerformanceOverlay: true,
|
|
||||||
home: Scaffold(
|
home: Scaffold(
|
||||||
appBar: AppBar(
|
body: ListView(
|
||||||
title: Text('Lottie Flutter'),
|
|
||||||
),
|
|
||||||
body: GridView.builder(
|
|
||||||
itemCount: files.length,
|
|
||||||
gridDelegate:
|
|
||||||
SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 4),
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
var assetName = files[index];
|
|
||||||
return GestureDetector(
|
|
||||||
child: _Item(
|
|
||||||
child: Lottie.asset(
|
|
||||||
assetName,
|
|
||||||
frameBuilder: (context, child, composition) {
|
|
||||||
return AnimatedOpacity(
|
|
||||||
child: child,
|
|
||||||
opacity: composition == null ? 0 : 1,
|
|
||||||
duration: const Duration(seconds: 1),
|
|
||||||
curve: Curves.easeOut,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onTap: () {
|
|
||||||
Navigator.of(context).push(MaterialPageRoute<void>(
|
|
||||||
builder: (context) => Detail(assetName)));
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class _Item extends StatelessWidget {
|
|
||||||
final Widget child;
|
|
||||||
|
|
||||||
const _Item({Key key, this.child}) : super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.white,
|
|
||||||
borderRadius: BorderRadius.all(Radius.circular(10)),
|
|
||||||
boxShadow: [
|
|
||||||
BoxShadow(
|
|
||||||
color: Colors.black.withOpacity(0.1),
|
|
||||||
offset: Offset(2, 2),
|
|
||||||
blurRadius: 5)
|
|
||||||
]),
|
|
||||||
child: child,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class Detail extends StatefulWidget {
|
|
||||||
final String assetName;
|
|
||||||
|
|
||||||
const Detail(this.assetName, {Key key}) : super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
_DetailState createState() => _DetailState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _DetailState extends State<Detail> with TickerProviderStateMixin {
|
|
||||||
AnimationController _controller;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
|
|
||||||
_controller = AnimationController(vsync: this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
_controller.dispose();
|
|
||||||
|
|
||||||
super.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Scaffold(
|
|
||||||
appBar: AppBar(
|
|
||||||
title: Text('${widget.assetName}'),
|
|
||||||
),
|
|
||||||
body: SingleChildScrollView(
|
|
||||||
child: Column(
|
|
||||||
children: [
|
children: [
|
||||||
Center(
|
// Load a Lottie file from your assets
|
||||||
child: Lottie.asset(
|
Lottie.asset('assets/LottieLogo1.json'),
|
||||||
widget.assetName,
|
|
||||||
controller: _controller,
|
// Load a Lottie file from a remote url
|
||||||
onLoaded: (composition) {
|
Lottie.network(
|
||||||
_controller.duration = composition.duration;
|
'https://raw.githubusercontent.com/xvrh/lottie-flutter/master/example/assets/Mobilo/A.json'),
|
||||||
_controller.repeat();
|
|
||||||
},
|
// Load an animation and its images from a zip file
|
||||||
),
|
Lottie.asset('assets/lottiefiles/angel.zip'),
|
||||||
),
|
|
||||||
AnimatedBuilder(
|
|
||||||
animation: _controller,
|
|
||||||
builder: (context, _) => Row(
|
|
||||||
children: <Widget>[
|
|
||||||
Expanded(
|
|
||||||
child: Slider(
|
|
||||||
value: _controller.value,
|
|
||||||
onChanged: (newValue) {
|
|
||||||
_controller.value = newValue;
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
IconButton(
|
|
||||||
icon: Icon(_controller.isAnimating
|
|
||||||
? Icons.stop
|
|
||||||
: Icons.play_arrow),
|
|
||||||
onPressed: () {
|
|
||||||
setState(() {
|
|
||||||
if (_controller.isAnimating) {
|
|
||||||
_controller.stop();
|
|
||||||
} else {
|
|
||||||
_controller.repeat();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
160
example/lib/main_app.dart
Normal file
@ -0,0 +1,160 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:logging/logging.dart';
|
||||||
|
import 'package:lottie/lottie.dart';
|
||||||
|
import 'src/all_files.g.dart';
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
Logger.root
|
||||||
|
..level = Level.ALL
|
||||||
|
..onRecord.listen(print);
|
||||||
|
Lottie.traceEnabled = true;
|
||||||
|
runApp(App());
|
||||||
|
}
|
||||||
|
|
||||||
|
class App extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return MaterialApp(
|
||||||
|
//showPerformanceOverlay: true,
|
||||||
|
home: Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: Text('Lottie Flutter'),
|
||||||
|
),
|
||||||
|
body: GridView.builder(
|
||||||
|
itemCount: files.length,
|
||||||
|
gridDelegate:
|
||||||
|
SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 4),
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
var assetName = files[index];
|
||||||
|
return GestureDetector(
|
||||||
|
child: _Item(
|
||||||
|
child: Lottie.asset(
|
||||||
|
assetName,
|
||||||
|
frameBuilder: (context, child, composition) {
|
||||||
|
return AnimatedOpacity(
|
||||||
|
child: child,
|
||||||
|
opacity: composition == null ? 0 : 1,
|
||||||
|
duration: const Duration(seconds: 1),
|
||||||
|
curve: Curves.easeOut,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
Navigator.of(context).push(MaterialPageRoute<void>(
|
||||||
|
builder: (context) => Detail(assetName)));
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _Item extends StatelessWidget {
|
||||||
|
final Widget child;
|
||||||
|
|
||||||
|
const _Item({Key key, this.child}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(10)),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.black.withOpacity(0.1),
|
||||||
|
offset: Offset(2, 2),
|
||||||
|
blurRadius: 5)
|
||||||
|
]),
|
||||||
|
child: child,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Detail extends StatefulWidget {
|
||||||
|
final String assetName;
|
||||||
|
|
||||||
|
const Detail(this.assetName, {Key key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_DetailState createState() => _DetailState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _DetailState extends State<Detail> with TickerProviderStateMixin {
|
||||||
|
AnimationController _controller;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
|
||||||
|
_controller = AnimationController(vsync: this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_controller.dispose();
|
||||||
|
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: Text('${widget.assetName}'),
|
||||||
|
),
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Center(
|
||||||
|
child: Lottie.asset(
|
||||||
|
widget.assetName,
|
||||||
|
controller: _controller,
|
||||||
|
onLoaded: (composition) {
|
||||||
|
_controller.duration = composition.duration;
|
||||||
|
_controller.repeat();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
AnimatedBuilder(
|
||||||
|
animation: _controller,
|
||||||
|
builder: (context, _) => Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
child: Slider(
|
||||||
|
value: _controller.value,
|
||||||
|
onChanged: (newValue) {
|
||||||
|
_controller.value = newValue;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
icon: Icon(_controller.isAnimating
|
||||||
|
? Icons.stop
|
||||||
|
: Icons.play_arrow),
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
if (_controller.isAnimating) {
|
||||||
|
_controller.stop();
|
||||||
|
} else {
|
||||||
|
_controller.repeat();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -5,13 +5,13 @@ PODS:
|
|||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
|
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
- FlutterMacOS (from `Flutter/ephemeral/.symlinks/flutter/darwin-x64`)
|
- 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`)
|
||||||
|
|
||||||
EXTERNAL SOURCES:
|
EXTERNAL SOURCES:
|
||||||
FlutterMacOS:
|
FlutterMacOS:
|
||||||
:path: Flutter/ephemeral/.symlinks/flutter/darwin-x64
|
: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:
|
||||||
|
@ -21,42 +21,42 @@ packages:
|
|||||||
name: async
|
name: async
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.4.1"
|
version: "2.5.0-nullsafety.1"
|
||||||
boolean_selector:
|
boolean_selector:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: boolean_selector
|
name: boolean_selector
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.0"
|
version: "2.1.0-nullsafety.1"
|
||||||
characters:
|
characters:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: characters
|
name: characters
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.0"
|
version: "1.1.0-nullsafety.3"
|
||||||
charcode:
|
charcode:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: charcode
|
name: charcode
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.3"
|
version: "1.2.0-nullsafety.1"
|
||||||
clock:
|
clock:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: clock
|
name: clock
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.1"
|
version: "1.1.0-nullsafety.1"
|
||||||
collection:
|
collection:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: collection
|
name: collection
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.14.12"
|
version: "1.15.0-nullsafety.3"
|
||||||
convert:
|
convert:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -77,7 +77,14 @@ packages:
|
|||||||
name: fake_async
|
name: fake_async
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.2.0-nullsafety.1"
|
||||||
|
ffi:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: ffi
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.1.3"
|
||||||
file:
|
file:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -143,35 +150,35 @@ packages:
|
|||||||
path: ".."
|
path: ".."
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "0.4.1"
|
version: "0.7.0"
|
||||||
matcher:
|
matcher:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: matcher
|
name: matcher
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.6"
|
version: "0.12.10-nullsafety.1"
|
||||||
meta:
|
meta:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: meta
|
name: meta
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.8"
|
version: "1.3.0-nullsafety.3"
|
||||||
path:
|
path:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path
|
name: path
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.7.0"
|
version: "1.8.0-nullsafety.1"
|
||||||
path_provider:
|
path_provider:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: path_provider
|
name: path_provider
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.6.11"
|
version: "1.6.21"
|
||||||
path_provider_linux:
|
path_provider_linux:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -185,21 +192,28 @@ packages:
|
|||||||
name: path_provider_macos
|
name: path_provider_macos
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.0.4+3"
|
version: "0.0.4+4"
|
||||||
path_provider_platform_interface:
|
path_provider_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path_provider_platform_interface
|
name: path_provider_platform_interface
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.2"
|
version: "1.0.3"
|
||||||
|
path_provider_windows:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_windows
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "0.0.4+1"
|
||||||
pedantic:
|
pedantic:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: pedantic
|
name: pedantic
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.9.0"
|
version: "1.9.2"
|
||||||
platform:
|
platform:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -213,7 +227,7 @@ packages:
|
|||||||
name: plugin_platform_interface
|
name: plugin_platform_interface
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.2"
|
version: "1.0.3"
|
||||||
process:
|
process:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@ -232,63 +246,70 @@ packages:
|
|||||||
name: source_span
|
name: source_span
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.7.0"
|
version: "1.8.0-nullsafety.2"
|
||||||
stack_trace:
|
stack_trace:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: stack_trace
|
name: stack_trace
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.9.3"
|
version: "1.10.0-nullsafety.1"
|
||||||
stream_channel:
|
stream_channel:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: stream_channel
|
name: stream_channel
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.0"
|
version: "2.1.0-nullsafety.1"
|
||||||
string_scanner:
|
string_scanner:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: string_scanner
|
name: string_scanner
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.5"
|
version: "1.1.0-nullsafety.1"
|
||||||
term_glyph:
|
term_glyph:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: term_glyph
|
name: term_glyph
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.2.0-nullsafety.1"
|
||||||
test_api:
|
test_api:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_api
|
name: test_api
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.2.16"
|
version: "0.2.19-nullsafety.2"
|
||||||
typed_data:
|
typed_data:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: typed_data
|
name: typed_data
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.6"
|
version: "1.3.0-nullsafety.3"
|
||||||
vector_math:
|
vector_math:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: vector_math
|
name: vector_math
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.0.8"
|
version: "2.1.0-nullsafety.3"
|
||||||
|
win32:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: win32
|
||||||
|
url: "https://pub.dartlang.org"
|
||||||
|
source: hosted
|
||||||
|
version: "1.7.3"
|
||||||
xdg_directories:
|
xdg_directories:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: xdg_directories
|
name: xdg_directories
|
||||||
url: "https://pub.dartlang.org"
|
url: "https://pub.dartlang.org"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.1.0"
|
version: "0.1.2"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=2.7.0 <3.0.0"
|
dart: ">=2.10.0-110 <2.11.0"
|
||||||
flutter: ">=1.12.13+hotfix.5 <2.0.0"
|
flutter: ">=1.12.13+hotfix.5 <2.0.0"
|
||||||
|
@ -8,11 +8,11 @@ environment:
|
|||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
flutter_colorpicker:
|
||||||
|
http:
|
||||||
lottie:
|
lottie:
|
||||||
path: ../
|
path: ../
|
||||||
flutter_colorpicker:
|
|
||||||
path_provider:
|
path_provider:
|
||||||
http:
|
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
@ -34,7 +34,7 @@ flutter:
|
|||||||
- assets/Logo/
|
- assets/Logo/
|
||||||
- assets/Images/
|
- assets/Images/
|
||||||
- assets/Images/WeAccept/
|
- assets/Images/WeAccept/
|
||||||
- assets/Weather/
|
- assets/weather/
|
||||||
- assets/example_with_images/
|
- assets/example_with_images/
|
||||||
- assets/example_with_images/images/
|
- assets/example_with_images/images/
|
||||||
|
|
||||||
|
@ -33,6 +33,7 @@ void main() {
|
|||||||
composition: composition,
|
composition: composition,
|
||||||
controller: animation,
|
controller: animation,
|
||||||
delegates: LottieDelegates(values: [delegate]),
|
delegates: LottieDelegates(values: [delegate]),
|
||||||
|
addRepaintBoundary: false,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
await tester.pump();
|
await tester.pump();
|
||||||
@ -45,6 +46,7 @@ void main() {
|
|||||||
composition: composition,
|
composition: composition,
|
||||||
controller: animation,
|
controller: animation,
|
||||||
delegates: LottieDelegates(values: []),
|
delegates: LottieDelegates(values: []),
|
||||||
|
addRepaintBoundary: false,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
await tester.pump();
|
await tester.pump();
|
||||||
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 9.5 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 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: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 95 KiB |
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 91 KiB After Width: | Height: | Size: 91 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 120 KiB |
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 66 KiB |
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 129 KiB |
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 151 KiB After Width: | Height: | Size: 151 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 139 KiB After Width: | Height: | Size: 139 KiB |
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 9.9 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 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: 14 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
@ -42,7 +42,7 @@ class _CustomerPainter extends CustomPainter {
|
|||||||
thumbSize;
|
thumbSize;
|
||||||
|
|
||||||
drawable
|
drawable
|
||||||
..setProgress(progress)
|
..setProgress(progress, frameRate: FrameRate.max)
|
||||||
..draw(canvas, rect);
|
..draw(canvas, rect);
|
||||||
|
|
||||||
++index;
|
++index;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:lottie_example/main.dart';
|
import 'package:lottie_example/main_app.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
testWidgets('Main sample', (tester) async {
|
testWidgets('Main sample', (tester) async {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
export 'src/composition.dart' show LottieComposition;
|
export 'src/composition.dart' show LottieComposition;
|
||||||
|
export 'src/frame_rate.dart' show FrameRate;
|
||||||
export 'src/lottie.dart' show Lottie;
|
export 'src/lottie.dart' show Lottie;
|
||||||
export 'src/lottie_builder.dart' show LottieBuilder;
|
export 'src/lottie_builder.dart' show LottieBuilder;
|
||||||
export 'src/lottie_delegates.dart' show LottieDelegates;
|
export 'src/lottie_delegates.dart' show LottieDelegates;
|
||||||
|
@ -13,6 +13,7 @@ import '../../model/layer/base_layer.dart';
|
|||||||
import '../../utils.dart';
|
import '../../utils.dart';
|
||||||
import '../../utils/dash_path.dart';
|
import '../../utils/dash_path.dart';
|
||||||
import '../../utils/misc.dart';
|
import '../../utils/misc.dart';
|
||||||
|
import '../../utils/path_factory.dart';
|
||||||
import '../../utils/utils.dart';
|
import '../../utils/utils.dart';
|
||||||
import '../../value/lottie_value_callback.dart';
|
import '../../value/lottie_value_callback.dart';
|
||||||
import '../keyframe/base_keyframe_animation.dart';
|
import '../keyframe/base_keyframe_animation.dart';
|
||||||
@ -25,8 +26,8 @@ import 'trim_path_content.dart';
|
|||||||
|
|
||||||
abstract class BaseStrokeContent
|
abstract class BaseStrokeContent
|
||||||
implements KeyPathElementContent, DrawingContent {
|
implements KeyPathElementContent, DrawingContent {
|
||||||
final Path _path = Path();
|
final Path _path = PathFactory.create();
|
||||||
final Path _trimPathPath = Path();
|
final Path _trimPathPath = PathFactory.create();
|
||||||
final LottieDrawable lottieDrawable;
|
final LottieDrawable lottieDrawable;
|
||||||
final BaseLayer layer;
|
final BaseLayer layer;
|
||||||
final List<_PathGroup> _pathGroups = <_PathGroup>[];
|
final List<_PathGroup> _pathGroups = <_PathGroup>[];
|
||||||
|