Trying to fix image loading on dev
This commit is contained in:
@@ -54,9 +54,16 @@ class PictureFullscreenDialog extends StatelessWidget {
|
|||||||
child: Image.network(
|
child: Image.network(
|
||||||
headers: {cred.name: cred.value},
|
headers: {cred.name: cred.value},
|
||||||
dto.imageUrl,
|
dto.imageUrl,
|
||||||
|
frameBuilder: (context, child, frame, wasSynchronouslyLoaded) {
|
||||||
|
return child;
|
||||||
|
},
|
||||||
loadingBuilder: (context, child, loadingProgress) {
|
loadingBuilder: (context, child, loadingProgress) {
|
||||||
if (loadingProgress == null) return child;
|
if (loadingProgress == null) return child;
|
||||||
return Text("Loading...");
|
return Center(
|
||||||
|
child: CircularProgressIndicator(
|
||||||
|
value: loadingProgress.expectedTotalBytes != null ? loadingProgress.cumulativeBytesLoaded / loadingProgress.expectedTotalBytes! : 0,
|
||||||
|
),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ class _PictureWidgetState extends State<PictureWidget> {
|
|||||||
|
|
||||||
Widget _imageWidget(PictureDto dto) {
|
Widget _imageWidget(PictureDto dto) {
|
||||||
Header cred = HeaderUtils().getAuthHeader();
|
Header cred = HeaderUtils().getAuthHeader();
|
||||||
|
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
key: const Key("image"),
|
key: const Key("image"),
|
||||||
behavior: HitTestBehavior.opaque,
|
behavior: HitTestBehavior.opaque,
|
||||||
@@ -158,13 +158,14 @@ class _PictureWidgetState extends State<PictureWidget> {
|
|||||||
headers: {cred.name: cred.value},
|
headers: {cred.name: cred.value},
|
||||||
dto.normalSizeUrl,
|
dto.normalSizeUrl,
|
||||||
fit: BoxFit.contain,
|
fit: BoxFit.contain,
|
||||||
|
frameBuilder: (context, child, frame, wasSynchronouslyLoaded) {
|
||||||
|
return child;
|
||||||
|
},
|
||||||
loadingBuilder: (context, child, loadingProgress) {
|
loadingBuilder: (context, child, loadingProgress) {
|
||||||
if (loadingProgress == null) return child;
|
if (loadingProgress == null) return child;
|
||||||
return Center(
|
return Center(
|
||||||
child: CircularProgressIndicator(
|
child: CircularProgressIndicator(
|
||||||
value: loadingProgress.expectedTotalBytes != null
|
value: loadingProgress.expectedTotalBytes != null ? loadingProgress.cumulativeBytesLoaded / loadingProgress.expectedTotalBytes! : 0,
|
||||||
? loadingProgress.cumulativeBytesLoaded / loadingProgress.expectedTotalBytes!
|
|
||||||
: 0,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user