Skip to content

Commit

Permalink
fix(#443) Null check operator used on a null value (#476)
Browse files Browse the repository at this point in the history
  • Loading branch information
renancaraujo authored Nov 15, 2021
1 parent 6b1b73f commit 88f4277
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/src/photo_view_default_widgets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ class PhotoViewDefaultLoading extends StatelessWidget {

@override
Widget build(BuildContext context) {
final value = event == null || event?.expectedTotalBytes != null
? 0.0
: event!.cumulativeBytesLoaded / event!.expectedTotalBytes!;
final expectedBytes = event?.expectedTotalBytes;
final loadedBytes = event?.cumulativeBytesLoaded;
final value = loadedBytes != null && expectedBytes != null
? loadedBytes / expectedBytes
: null;

return Center(
child: Container(
width: 20.0,
Expand Down

0 comments on commit 88f4277

Please sign in to comment.