import 'package:flutter/material.dart'; import 'package:flutter_widget_from_html/flutter_widget_from_html.dart'; import 'package:manager_api_new/api.dart'; import 'package:mymuseum_visitapp/Components/show_element_for_resource.dart'; import 'package:mymuseum_visitapp/Models/visitContext.dart'; import 'package:mymuseum_visitapp/app_context.dart'; import 'package:mymuseum_visitapp/constants.dart'; void showMessage(TranslationAndResourceDTO translationAndResourceDTO, AppContext appContext, BuildContext context, Size size) { print("translationAndResourceDTO"); print(translationAndResourceDTO); VisitAppContext visitAppContext = appContext.getContext(); showDialog( builder: (BuildContext context) => AlertDialog( shape: RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0)) ), content: SingleChildScrollView( child: Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.center, children: [ if(translationAndResourceDTO.resourceId != null) Container( constraints: BoxConstraints(maxHeight: 250), //color: Colors.cyan, height: size.height *0.45, width: size.width *0.5, child: Center( child: Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 30), //border: Border.all(width: 3, color: Colors.black) ), child: showElementForResource(ResourceDTO(id: translationAndResourceDTO.resourceId, type: translationAndResourceDTO.resource!.type, url: translationAndResourceDTO.resource!.url), appContext, true, false), ), ), ), Container( constraints: BoxConstraints(maxHeight: 350), //color: Colors.green, height: size.height *0.3, width: size.width *0.5, child: Center( child: Align( alignment: Alignment.center, child: Padding( padding: const EdgeInsets.all(8.0), child: HtmlWidget( translationAndResourceDTO.value!, customStylesBuilder: (element) { return {'text-align': 'center', 'font-family': "Roboto"}; }, textStyle: const TextStyle(fontSize: kDescriptionSize), ),/*Text( resourceDTO.label == null ? "" : resourceDTO.label, style: new TextStyle(fontSize: 25, fontWeight: FontWeight.w400)),*/ ), ), ), ), ], ), ), /*actions: [ Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Padding( padding: const EdgeInsets.all(8.0), child: Align( alignment: AlignmentDirectional.bottomEnd, child: Container( width: 175, height: 70, child: RoundedButton( text: "Merci", icon: Icons.undo, color: kSecondGrey, press: () { Navigator.of(context).pop(); }, fontSize: 20, ), ), ), ), ], ), ],*/ ), context: context ); }