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/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: [ SizedBox( height: size.height *0.3, width: size.width * 0.9, child: Center( child: Padding( padding: const EdgeInsets.all(8.0), child: PhotoView( imageProvider: Image.memory(base64Decode(resourceModel.data!)).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!)),*/ ), ), ), Padding( padding: const EdgeInsets.all(8.0), child: Text( TranslationHelper.get(imageDTO.title, appContext), style: const TextStyle(fontSize: kArticleContentSize, fontWeight: FontWeight.w400)), ), ], ), ), contentPadding: EdgeInsets.zero, ), context: context ); }