check image for null safety
This commit is contained in:
@@ -8,17 +8,26 @@ class DisplayImageSource {
|
||||
File? file;
|
||||
DisplayImageSource({this.url, this.file});
|
||||
|
||||
ImageProvider? get imageProvider =>
|
||||
file == null ? CachedNetworkImageProvider(url!) : FileImage(file!);
|
||||
ImageProvider get imageProvider {
|
||||
if (file == null) {
|
||||
return CachedNetworkImageProvider(url!);
|
||||
} else {
|
||||
return FileImage(file!);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(other) {
|
||||
if (identical(this, other)) {
|
||||
if (identical(this, other) && other is DisplayImageSource) {
|
||||
return true;
|
||||
}
|
||||
return (other.file == this.file &&
|
||||
|
||||
return (other is DisplayImageSource &&
|
||||
other.file == this.file &&
|
||||
(other.file != null || this.file != null)) ||
|
||||
(other.url == this.url && (other.url != null || this.url != null));
|
||||
(other is DisplayImageSource &&
|
||||
other.url == this.url &&
|
||||
(other.url != null || this.url != null));
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user