cmd_OpenPhoto method

dynamic cmd_OpenPhoto(
  1. Uint8List img,
  2. String imgID, {
  3. DateTime? dtImage,
})

Implementation

cmd_OpenPhoto(Uint8List img, String imgID, {DateTime? dtImage}) async {
  await showDialog(
      context: context,
      builder: (builder) {
        return XAlertDialog(
            child: Container(
                width: MediaQuery.of(context).size.width - 1,
                height: MediaQuery.of(context).size.height - 1,
                child: PhotoViewGallery.builder(
                    scrollPhysics: const BouncingScrollPhysics(),
                    builder: (BuildContext context, int index) {
                      return PhotoViewGalleryPageOptions(
                        basePosition: Alignment.center,
                        imageProvider: MemoryImage(img),
                        initialScale: PhotoViewComputedScale.contained * 1,
                        heroAttributes: PhotoViewHeroAttributes(tag: imgID),
                      );
                    },
                    itemCount: 1,
                    backgroundDecoration: BoxDecoration(color: Colors.grey[900]))),
            title_Text: dtImage != null ? "Foto del ${XUtils.dateToString(dtImage, format: "dd/MM/yy")}" : "Foto",
            title_Style: XStyles.xStyTextForLabel(textColor: Colors.yellow),
            content_insetPadding: EdgeInsets.all(0),
            actionsBTNarea_Child: Row(children: [
              Expanded(
                  child: XBtnbase(
                height: 35,
                backGroundColor: Colors.transparent,
                onPressed: () => Navigator.pop(context),
                elevation: 0,
                label: "Chiudi",
                label_Style: XStyles.xStyTextForLabel(textColor: Colors.red),
              ))
            ]));
      });
}