简体   繁体   中英

Dartium and it's use of dart:io

I am building a feature-rich standalone application using dart. I picked dart since it seemed to allow not only the standard development approach for webapps but also to access system resources (such as nodejs does). One of my requirements is file io or database access (which again requires file io). Dartium however does not allow the use of the dart:io package (only in servermode is this library accessible). Can anybody think of a workaround, a change to the dart environment or the chromium environment to allow this ? Maybe a custom compiled dartVM in the browser environemnt.

Basically a way to use database connections in a dart standalone app. A REST wrapper is only an option if this code could get generated automatically.

I am not clear if such a thing is possible or if chromium will prevent any approach to access system resources.

Yes in standalone mode dart you can use files, and also TCP socket, and web socket. So you can connect to databases. (for example to MySQL: https://github.com/jamesots/sqljocky )

In browser mode you can use built-in databases dart:indexed_db or dart:web_sql. You can also use web-socket protocol

Maybe you can use websocket to connect with local or remote database.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM