-
-
Notifications
You must be signed in to change notification settings - Fork 219
Open
Description
FileLottie never hit LottieCache, because FileLottie's hashCode() method return file.hashcode, not file.path.hashcode.
class FileLottie extends LottieProvider {
FileLottie(
Object file, {
super.imageProviderFactory,
super.decoder,
super.backgroundLoading,
}) : file = file as io.File,
assert(
!kIsWeb,
'Lottie.file is not supported on Flutter Web. '
'Consider using either Lottie.asset or Lottie.network instead.',
);
final io.File file;
...
@OverRide
bool operator ==(Object other) {
if (other.runtimeType != runtimeType) return false;
return other is FileLottie && file.path == other.file.path;
}
@OverRide
int get hashCode => file.hashCode;
@OverRide
String toString() => '$runtimeType(file: ${file.path})';
}
}
Metadata
Metadata
Assignees
Labels
No labels