updateHtmlWithPlatformMediumWebYesNo method

void updateHtmlWithPlatformMediumWebYesNo(
  1. BuildContext context,
  2. AppModel app,
  3. String ownerId,
  4. HtmlWithPlatformMediumModel htmlModel,
  5. UpdatedHtml updatedHtml,
  6. String title,
  7. bool isWeb, {
  8. 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);
      });
}