Compare commits

...

1 Commits

Author SHA1 Message Date
bbfe04f00d Remove prints (#129) 2021-02-06 14:42:46 +01:00
4 changed files with 32 additions and 33 deletions

View File

@ -21,34 +21,36 @@ class App extends StatelessWidget {
appBar: AppBar( appBar: AppBar(
title: Text('Lottie Flutter'), title: Text('Lottie Flutter'),
), ),
body: GridView.builder( body: Scrollbar(
itemCount: files.length, child: GridView.builder(
gridDelegate: itemCount: files.length,
SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 4), gridDelegate:
itemBuilder: (context, index) { SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 4),
var assetName = files[index]; itemBuilder: (context, index) {
return GestureDetector( var assetName = files[index];
child: _Item( return GestureDetector(
child: Lottie.asset( child: _Item(
assetName, child: Lottie.asset(
frameBuilder: (context, child, composition) { assetName,
return AnimatedOpacity( frameBuilder: (context, child, composition) {
child: child, return AnimatedOpacity(
opacity: composition == null ? 0 : 1, child: child,
duration: const Duration(seconds: 1), opacity: composition == null ? 0 : 1,
curve: Curves.easeOut, duration: const Duration(seconds: 1),
); curve: Curves.easeOut,
}, );
},
),
), ),
), onTap: () {
onTap: () { Navigator.push(
Navigator.push( context,
context, MaterialPageRoute<void>(
MaterialPageRoute<void>( builder: (context) => Detail(assetName)));
builder: (context) => Detail(assetName))); },
}, );
); },
}, ),
), ),
), ),
); );

View File

@ -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:

View File

@ -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');
}); });
} }

View File

@ -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.1 version: 0.8.0-nullsafety.2
homepage: https://github.com/xvrh/lottie-flutter homepage: https://github.com/xvrh/lottie-flutter
environment: environment: