import 'package:flutter/material.dart'; import 'package:flutter_widget_from_html/flutter_widget_from_html.dart'; import 'package:manager_api/api.dart'; import 'package:tablet_app/Components/show_element_for_resource.dart'; import 'package:tablet_app/app_context.dart'; import 'package:tablet_app/constants.dart'; void showMessage(TranslationAndResourceDTO translationAndResourceDTO, AppContext appContext, BuildContext context, Size size) { print("translationAndResourceDTO"); print(translationAndResourceDTO); showDialog( builder: (BuildContext context) => AlertDialog( shape: RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(20.0)) ), content: SingleChildScrollView( child: Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.center, children: [ if(translationAndResourceDTO.resourceId != null) Container( //color: Colors.cyan, height: size.height *0.45, width: size.width *0.5, child: Center( child: Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(30), //border: Border.all(width: 3, color: Colors.black) ), child: showElementForResource(ResourceDTO(id: translationAndResourceDTO.resourceId, type: translationAndResourceDTO.resourceType, url: translationAndResourceDTO.resourceUrl), appContext), ), ), ), Container( //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'}; }, textStyle: 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 ); }