openJsonAsLink method

  1. @override
Widget openJsonAsLink(
  1. BuildContext context,
  2. AppModel app,
  3. String jsonString
)
override

Implementation

@override
Widget openJsonAsLink(BuildContext context, AppModel app, String jsonString) {
  var blob = html.Blob([jsonString], 'text/plain', 'native');
  return button(app, context, label: "Open file", onPressed: () {
    final url = html.Url.createObjectUrlFromBlob(blob);
    html.window.open(url, "_blank");
    html.Url.revokeObjectUrl(url);
  });
}