import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:manager_api/api.dart'; import 'package:mymuseum_visitapp/Helpers/translationHelper.dart'; import 'package:mymuseum_visitapp/Models/resourceModel.dart'; import 'package:mymuseum_visitapp/Models/visitContext.dart'; import 'package:mymuseum_visitapp/app_context.dart'; import 'package:mymuseum_visitapp/constants.dart'; import 'package:photo_view/photo_view.dart'; void showImagePopup(ImageDTO imageDTO, ResourceModel resourceModel, AppContext appContext, BuildContext context, Size size) { showDialog( builder: (BuildContext context) => AlertDialog( shape: const RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(10.0)) ), content: SingleChildScrollView( child: Column( children: [ if(TranslationHelper.get(imageDTO.title, appContext.getContext()).isNotEmpty) Padding( padding: const EdgeInsets.only(top: 8.0, left:8.0, right: 8.0), child: Text( TranslationHelper.get(imageDTO.title, appContext.getContext()), style: const TextStyle(fontSize: kArticleContentSize, fontWeight: FontWeight.w400)), ), SizedBox( height: size.height * 0.5, width: size.width * 0.95, child: Center( child: Padding( padding: const EdgeInsets.only(left:8.0, right: 8.0, bottom: 8.0, top: 8.0), child: PhotoView( imageProvider: (appContext.getContext() as VisitAppContext).configuration!.isOffline! ? Image.memory(base64Decode(resourceModel.data!)).image : Image.network(resourceModel.source!).image, minScale: PhotoViewComputedScale.contained * 1.0, maxScale: PhotoViewComputedScale.contained * 3.0, backgroundDecoration: const BoxDecoration( color: Colors.transparent, /*shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(15.0),*/ ), ),/*Image.memory(base64Decode(resourceModel!.data!)),*/ ), ), ), ], ), ), contentPadding: EdgeInsets.zero, ), context: context ); }