Search code examples
dartdart-htmldart-io

dart:io and dart:html being mutually exclusive


I've run into a similar situation to this chap where I'd like to have dart:io and dart:html in the same application. I know that dart:io is a server-side library and dart:html is a client side. My situation is as follows. I have a program to outputs a huge amount of text to a log file. I've found Dart to be great at text manipulation. I wanted to take the log file text, manipulate it, put some information in headed textareas for readability etc., and view the page.

I have no intentions to put this on the web. It's just for my work computer. I just want the file loading capabilities of dart:io and the nice display of dart:html. The previous post was in April and development on Dart is speedy. Is there now another way of doing what I want?

I know I could write a program to build a HTML file with the manipulated text in the appropriate fields and then open that HTML file but I don't like that idea as much. Is there another way?


Solution

  • You may consider using this library html5lib on server side apps to generate HTML output. Then it's simply a matter of opening the file up in a browser. This can also be automated by calling starting a Process which launches the browser and points to your generated html file.

    html5lib is still a work in progress, but I'm sure they would like to hear your feedback.