buildViewer method
Implementation
@override
Widget buildViewer() {
if (fileBytes == null) {
return Center(child: Text(setText('Không có dữ liệu', 'No data')));
}
return PhotoView(
imageProvider: MemoryImage(fileBytes!),
controller: _photoController,
minScale: PhotoViewComputedScale.contained,
maxScale: PhotoViewComputedScale.covered * 4,
backgroundDecoration: const BoxDecoration(color: Colors.black),
onScaleEnd: (context, details, controllerValue) {
_currentScale = controllerValue.scale ?? 1.0;
},
);
}