Skip to content

Instantly share code, notes, and snippets.

@ffkev
Created September 25, 2025 09:54
Show Gist options
  • Select an option

  • Save ffkev/f16abece4f5866d01f42a7c08083c318 to your computer and use it in GitHub Desktop.

Select an option

Save ffkev/f16abece4f5866d01f42a7c08083c318 to your computer and use it in GitHub Desktop.
Code snippet to export html data from quill editor
ElevatedButton(
child: Text('Download as HTML'),
onPressed: () {
final htmlContent = _model.htmlString ?? '';
final bytes = utf8.encode(htmlContent);
final blob = html.Blob([bytes], 'text/html');
final url = html.Url.createObjectUrlFromBlob(blob);
final anchor = html.AnchorElement(href: url)
..setAttribute('download', 'quill_data.html')
..click();
html.Url.revokeObjectUrl(url);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment