diff --git a/lib/src/photo_view_default_widgets.dart b/lib/src/photo_view_default_widgets.dart index 52ab8a48..9d59430f 100644 --- a/lib/src/photo_view_default_widgets.dart +++ b/lib/src/photo_view_default_widgets.dart @@ -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,