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
0 answers

How do I pass control to another command-line program

I have two related programs, one is interactive and the other is not. Both can be run from the command-line. The interactive program maintains parameters and on completion optionally writes the parameters to file. It also optionally allows the…
Brian Oh
  • 9,604
  • 12
  • 49
  • 68
0
votes
1 answer

Enable TLS on open socket (STARTTLS)

Looks like SSL/TLS support has recently been added to Dart via the SecureSocket class, which is great. So, for example this SecureSocket.connect(_host, _port).then( (Socket socket) { ... opens a socket with TLS enabled right…
Max
  • 9,220
  • 10
  • 51
  • 83
0
votes
1 answer

Async/await pattern in Dart?

Does Dart have anything remotely similar to the async/await pattern in .net? For example, I want to open a socket and do several handshakes: send 1, wait for response 1, send 2, wait for response 2 etc. Waiting for a response shouldn't be blocking…
Max
  • 9,220
  • 10
  • 51
  • 83
0
votes
1 answer

Reading text file using readAsString() and using the result

The following example (1) reads a file and prints the contents without explicitly assigning the file contents to a variable (ie. “.then(stdout.write)”). However, if I want to do more than just print the contents (2), I need to assign the contents to…
Brian Oh
  • 9,604
  • 12
  • 49
  • 68
0
votes
2 answers

Console application - StringDecoder stdin

The following or similar was shown for terminal input, however terminating input with ctl-d is not good. Is there another way to exit from this "loop"? import "dart:io"; void main() { stdout.write("Enter Data : "); new…
Brian Oh
  • 9,604
  • 12
  • 49
  • 68
-1
votes
1 answer

How i can convert to double .dart

I have problem in this code, this code can not be executed. Here is the code: import 'dart:io'; main() { print("CALCULATOR"); stdout.write("Number a: "); double a = double.parse(stdin.readLineSync()); stdout.write("Number b: "); double b…
-1
votes
1 answer

Open file with File() from dart:io

I have a flutter application with a folder certs/ inside the assets' folder like this: certs/ with a cert.pem file inside. I already added the file to the pubspec.yaml: assets: - assets/images/ - assets/texts/ -…
AFortunato
  • 181
  • 1
  • 10
-1
votes
1 answer

Why some libraries cannot be used in web and command-line apps?

While reading the article library tour of Dart, I've just discovered that some libraries cannot be used in web apps and other libraries cannot be used or are not available for command-line apps, while all of these mentioned libraries belonging to…
nbro
  • 15,395
  • 32
  • 113
  • 196
-1
votes
1 answer

How to create a client sever application and execute it

How to create client server application in dart. My aim is to create a program to extract parameters form URL and store them in session on variable and connect the dart to .net web service and in below code i shows The built-in library 'dart:io' is…
unlimitederrors
  • 93
  • 2
  • 11
-2
votes
1 answer

How to take input in an Array in Dart?

I need to ask the user to input any quantity of space/comma-separated integers and add them to an array to then bubble sort them. I only need help with taking an input in an array. I'm losing brain cells, please. Examples of an input: 10, 9, 8, 6,…
-3
votes
1 answer

How in Dart get command line arguments outside of the `main` method?

In C# langauge exists global system variable for this purpose. Environment.CommandLine This property provides access to the program name and any arguments specified on the command line when the current process was started. Dart is asynchronous…
mezoni
  • 10,684
  • 4
  • 32
  • 54
1 2 3
12
13