updateHtmlWithPlatformMediumWebYesNo method
void
updateHtmlWithPlatformMediumWebYesNo(
- BuildContext context,
- AppModel app,
- String ownerId,
- HtmlWithPlatformMediumModel htmlModel,
- UpdatedHtml updatedHtml,
- String title,
- bool isWeb, {
- List<
Widget> ? extraIcons,
Implementation
void updateHtmlWithPlatformMediumWebYesNo(
BuildContext context,
AppModel app,
String ownerId,
HtmlWithPlatformMediumModel htmlModel,
UpdatedHtml updatedHtml,
String title,
bool isWeb,
{List<Widget>? extraIcons}) {
HtmlTextDialog.open(
context,
app,
ownerId,
title,
(value) {
htmlModel.html = value;
updatedHtml(value);
},
htmlModel.html ?? '',
isWeb,
extraIcons: extraIcons,
mediaAction: (AddMediaHtml addMediaHtml, String html) async {
var tempModel = HtmlWithPlatformMediumModel(
documentID: newRandomKey(),
appId: app.documentID,
html: html,
htmlMedia: htmlModel.htmlMedia,
conditions: htmlModel.conditions);
// the HtmlWithPlatformMediumComponents uses (unfortunately) a HtmlWithPlatformMediumModel, so we create one, just to be able to function, and to capture htmlMedia
await HtmlWithPlatformMediumComponents.openIt(app, context, tempModel,
(accepted, model) {
if (accepted) {
htmlModel.htmlMedia = model.htmlMedia;
}
}, addMediaHtml: addMediaHtml);
});
}