Trying to fix image loading on dev
This commit is contained in:
@@ -227,11 +227,7 @@ class _CustomerWidgetState extends State<CustomerWidget> {
|
|||||||
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
|
|
||||||
? loadingProgress.cumulativeBytesLoaded / loadingProgress.expectedTotalBytes!
|
|
||||||
: 0,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -348,9 +344,7 @@ class _CustomerWidgetState extends State<CustomerWidget> {
|
|||||||
|
|
||||||
Future<void> _actionDownload(BuildContext context, CustomerDto customerDto, PictureDto? pictureDto) async {
|
Future<void> _actionDownload(BuildContext context, CustomerDto customerDto, PictureDto? pictureDto) async {
|
||||||
final bytes = await _customerController.export(customerId: customerDto.id, pictureId: pictureDto?.id);
|
final bytes = await _customerController.export(customerId: customerDto.id, pictureId: pictureDto?.id);
|
||||||
final fileName = pictureDto != null
|
final fileName = pictureDto != null ? '${customerDto.customerNumber}_${pictureDto.id}.pdf' : '${customerDto.customerNumber}.pdf';
|
||||||
? '${customerDto.customerNumber}_${pictureDto.id}.pdf'
|
|
||||||
: '${customerDto.customerNumber}.pdf';
|
|
||||||
await downloadFile(bytes, fileName);
|
await downloadFile(bytes, fileName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ class PictureFullscreenDialog extends StatelessWidget {
|
|||||||
height: dialogHeight,
|
height: dialogHeight,
|
||||||
child: InteractiveViewer(
|
child: InteractiveViewer(
|
||||||
constrained: true,
|
constrained: true,
|
||||||
//boundaryMargin: EdgeInsets.all(20),
|
|
||||||
panEnabled: true,
|
panEnabled: true,
|
||||||
scaleEnabled: true,
|
scaleEnabled: true,
|
||||||
minScale: 0.5,
|
minScale: 0.5,
|
||||||
@@ -54,15 +53,10 @@ 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 Center(
|
return Center(
|
||||||
child: CircularProgressIndicator(
|
child: CircularProgressIndicator(),
|
||||||
value: loadingProgress.expectedTotalBytes != null ? loadingProgress.cumulativeBytesLoaded / loadingProgress.expectedTotalBytes! : 0,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -158,15 +158,10 @@ 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 ? loadingProgress.cumulativeBytesLoaded / loadingProgress.expectedTotalBytes! : 0,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user