Questions tagged [dart-io]

dart:io allows you to work with files, directories, sockets, processes, HTTP servers and clients, and more

dart:io library is used for Dart server applications, which run on a stand-alone Dart VM from the command line. This library does not work in browser based applications.

This library allows you to work with files, directories, sockets, processes, HTTP servers and clients, and more.

191 questions
0
votes
1 answer

Adding cookies with Dart server?

So I have a simple HttpServer like this: import 'dart:io'; main() { HttpServer .bind("127.0.0.1", 80) .then((server) { server.listen((request) { // Add cookie here how? …
Matija
  • 2,610
  • 1
  • 18
  • 18
0
votes
1 answer

Dart - HTTP - Encode JSON Object with Array & int properties

I'm trying to make a POST request using dart's http package with json data as the body, I'm using a variable of type dynamic to create the json object and so far it works perfectly as long as all the values in the object are strings. If I assign the…
effy
  • 410
  • 8
  • 20
0
votes
1 answer

Writing endlines to files in with dart:io

I am using WebStorm on Windows and I have simple command-line dart app: import 'dart:io'; main(List arguments) { File testFile = new File("test.txt"); testFile.writeAsStringSync("AAA\nBBBBB\rCCCCC"); } Program executes successfully,…
Lubomír Grund
  • 145
  • 1
  • 13
0
votes
0 answers

Working with WebSockets in Flutter

I'm looking at this document in the Flutter documentation. When executing this example from the Android or iOS emulator, everything works like expected. When I try it from my actual Android device (Pixel 2), the connect method states an error that…
Maik Mewes
  • 126
  • 1
  • 6
0
votes
1 answer

Dart: receive a file from a HTTP POST request on Dart server and save/print its contents on the server

I have a server side code which accepts a file from POST request and copy the contents to a new file. I am basically trying to reproduce the example mentioned on Dart how to upload image import 'dart:io'; import…
Rahul
  • 21
  • 5
0
votes
0 answers

In a CLI Dart application, how does one run multiple Processes within a shared env?

Say I need to source a shell script via one of these two examples: $ source setup.bash $ . setup.sh and then run a command included in PATH as a result of the previous step. How could you set up a method to perform these two steps using the Dart…
Crunchex
  • 307
  • 2
  • 10
0
votes
0 answers

Resource interpreted as Script but transferred with MIME type application/dart

I am sending a Dart file via HttpServer, but whenever I get it, Chrome says: "Resource interpreted as Script but transferred with MIME type application/dart: "http://localhost:8000/dart/game.dart"." The line for the client is:
anonmous
  • 137
  • 2
  • 9
0
votes
1 answer

sqljocky query - method not found

Trying to query mysql database with sqljocky. This query works fine in phpmyadmin and return 5 rows with fine data. In Dart i got exception: Class '_ResultsImpl' has no instance method 'forEach'. I made breakpoint in query callback. Result object…
kolombet
  • 87
  • 1
  • 1
  • 7
0
votes
2 answers

Using 'dart:io' in dartium ? Any work arounds?

I am new to dart and I am trying to read data from a file and use the contents to draw something canvas. In doing so I am running into 'The built-in library 'dart:io' is not available on Dartium ' issue. I understand Dart has limitations as…
DevOne
  • 9
  • 1
  • 4
0
votes
1 answer

Dart Language: GET (favicon issue)

I have a Dart application running on the server side. It is listening at a specific port and working fine. The problem is: my listener is responding to the GET of the favorite icon (favicon). How can I avoid that? EDIT: give some code…
Felipe
  • 376
  • 2
  • 5
  • 15
0
votes
1 answer

i cant connect db with sqljocky

i have some problems about sqljocky/dart var pool = new ConnectionPool(host: 'example.com', port: 3306, user: 'hvuo', password: 'xxx', db: 'xxx', max: 1); querySelector("#err1").text="Conexxon abierta"; pool.prepare("insert into…
dasavi
  • 25
  • 4
0
votes
0 answers

Is there a way to watch for changes to files matching a glob in Dart?

I'm trying to implement something similar to the gulp.watch() function in gulp.js, and watch for create/delete/changes to files matching a glob (i.e. '*/.dart', 'tests/*.dart'). Is there a way to do this using the standard library, or a way to…
Mark B
  • 2,870
  • 3
  • 20
  • 18
0
votes
1 answer

sqljocky dont save the data in list

import 'package:sqljocky/sqljocky.dart'; void recopilaDatos(){ List listaCorreos = new List(); var pool = new ConnectionPool(host: 'localhost', port: 3306, user: 'root', password: 'root', db: 'prueba', max: 5); //…
Juan Antonio
  • 2,451
  • 3
  • 24
  • 34
0
votes
2 answers

Dart mailer returning success or error to client

I'm learning dart and have created a simple contact form - based on the forms tutorial on the dart site, using mailer to send a mail. So far so good - the client post the message, the server picks up the post data, creates an envelope and sends the…
0
votes
1 answer

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…
ins0m
  • 850
  • 10
  • 20
1 2 3
12
13