Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 3.2.1
- Add conditional imports to prevent importing `dart:io` on Web targets

## 3.2.0
- Apply Blend mode at layer level

Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ packages:
path: ".."
relative: true
source: path
version: "3.2.0"
version: "3.2.1"
matcher:
dependency: transitive
description:
Expand Down
3 changes: 1 addition & 2 deletions lib/src/lottie.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'dart:io' as io;
import 'dart:typed_data';
import 'package:flutter/widgets.dart';
import 'package:http/http.dart' as http;
Expand Down Expand Up @@ -97,7 +96,7 @@ class Lottie extends StatefulWidget {

/// Creates a widget that displays an [LottieComposition] obtained from a [File].
static LottieBuilder file(
io.File file, {
Object file, {
Animation<double>? controller,
FrameRate? frameRate,
bool? animate,
Expand Down
3 changes: 1 addition & 2 deletions lib/src/lottie_builder.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'dart:async';
import 'dart:io' as io;
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:http/http.dart' as http;
Expand Down Expand Up @@ -111,7 +110,7 @@ class LottieBuilder extends StatefulWidget {
/// `android.permission.READ_EXTERNAL_STORAGE` permission.
///
LottieBuilder.file(
io.File file, {
Object file, {
this.controller,
this.frameRate,
this.animate,
Expand Down
5 changes: 3 additions & 2 deletions lib/src/providers/file_provider_io.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ import 'lottie_provider.dart';
@immutable
class FileLottie extends LottieProvider {
FileLottie(
this.file, {
Object file, {
super.imageProviderFactory,
super.decoder,
super.backgroundLoading,
}) : assert(
}) : file = file as io.File,
assert(
!kIsWeb,
'Lottie.file is not supported on Flutter Web. '
'Consider using either Lottie.asset or Lottie.network instead.',
Expand Down
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -351,4 +351,4 @@ packages:
version: "3.1.2"
sdks:
dart: ">=3.5.0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"
flutter: ">=3.24.0"
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: lottie
description: Render After Effects animations natively on Flutter. This package is a pure Dart implementation of a Lottie player.
version: 3.2.0
version: 3.2.1
repository: https://github.com/xvrh/lottie-flutter

funding:
Expand Down
Loading