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
1
vote
1 answer

dart chat-server sample, connecting from another machine

How do I connect to the chat-server example from another physical machine? In https://www.dartlang.org/slides/2012/06/io12/Bullseye-Your-first-Dart-app-Codelab- googleIO2012.pdf I modify the chat-server, to bind 192.168.1.5 rather than…
user1334731
  • 81
  • 2
  • 5
1
vote
1 answer

How can I do stdin.close() with the new Streams API in Dart?

I ask user for input in my command line (dart:io) app. After I get my answer from the user, I want to unsubscribe from the Stream. Then, later, I may want to listen to it again (but with different listener, so pause() and resume() don't help me). On…
filiph
  • 2,673
  • 2
  • 26
  • 33
0
votes
1 answer

How can I display an image from Image_picker and dart:io?

I'm currently working on a program where the user would be able to select an image to analyze the text in the image and keep getting the following error while trying to get display the selected image in the following code-block: InkWell( …
Jana
  • 1
  • 1
0
votes
0 answers

Issues where I can build app bundle for a simple socket connection app but works on certain android devices

I am working on a simple TCP socket application (through flutter on VS) that is acting as a remote control to a Server. The issue is that the app seems to work on certain android devices. I have a Samsung Galaxy phone in which the app runs on, it is…
Donovan
  • 1
  • 1
0
votes
0 answers

Flutter: Create list of directories with StreamBuilder

I want to create a widget that lists all of the sub directories in a given directory. I have elected to use StreamBuilder to achieve this, here is my app: import 'dart:io'; import 'package:flutter/material.dart'; import…
Peter
  • 2,919
  • 1
  • 16
  • 35
0
votes
1 answer

Dart readAsStringSync not reading lines containing a special character (a dot/full stop)

I am writing a data export/import feature in my application. The output is written as text to a csv file and this appears to be working ok, but the data import is skipping some of the exported lines (the "statistic" data in the output csv file…
Twelve1110
  • 175
  • 12
0
votes
0 answers

The dart server was terminated when the server is trying to upload files (images) on production host

I am using Ubuntu 20.04 (LTS) x64, NGINX, memory 1 GB, Dart SDK version: 2.19.4 (stable) , and Dart server. I run this dart server in the console with: pm2 start dart --name dart_server -- run dart_server/bin/dart_server.dart pm2 logs The issue…
0
votes
0 answers

Can’t open excel file on macos through dart

import 'dart:convert'; import 'dart:io'; import 'package:flutter/material.dart'; import 'package:excel/excel.dart'; import 'package:http/http.dart' as http; void main() { runApp(ExcelFirebase()); } class ExcelFirebase extends StatelessWidget { …
0
votes
0 answers

How to modify a single line in a large file?

I have a large .csv file where I need to edit a single value. Is there a way to do that without writing the entire file again? I know that I can read a file line-by-line like this: await for (var event in file .openRead() …
Smofe
  • 71
  • 2
0
votes
1 answer

building platform specific UI (Android &Ios ) error : ,'Widget', is a potentially non-nullable type

Widget getPicker() { if (Platform.isAndroid) { getDropdownButton(); } else if (Platform.isIOS) { getCupertinoPicker(); } } error: The body might complete normally, causing 'null' to be returned, but the return type, 'Widget', is a…
0
votes
2 answers

Flutter - android: Exception when convert large file (more than 1GB) to byte

I'm using dart:io to convert file to bytes. with image and short video it's work. but with large file (more than 1GB) i got error E/flutter (16030): [ERROR:flutter/shell/common/shell.cc(93)] Dart Error: NewExternalTypedData expects argument 'length'…
anhdhq
  • 35
  • 4
0
votes
1 answer

dart.io is not supported for web, and universal.io's File doesn't work when assigning arguments

I am making a website and would like files to be uploaded to Firebase Cloud Storage. The issue is, FirebaseStorage.instance.ref().child().putfile() takes in a File, which is from dart.io (apparently not supported for web). I tried using…
BTB
  • 13
  • 2
0
votes
0 answers

How to check if FileSystemEntity is a Directory

Problem I get the FileSystemEntity list and want to select only Directories from it. So I create a new list and remove all entity types from it except Directory. However, the list just happens to be empty (it is guaranteed that subdirectories…
L3odr0id
  • 170
  • 1
  • 10
0
votes
0 answers

How to delete one directory and replace it with another one for web?

I've replaced one package with another: dart:io on universal_io. And this showed me an error. : Error: A value of type 'Directory/*1*/' can't be assigned to a variable of type 'Directory/*2*/'. lib/…/sqlite/database.dart:42 - 'Directory/*1*/' is…
rays7c
  • 5
  • 2
0
votes
1 answer

final imageFile = await File(path); doesn't create a file

I am using the camera to take a picture and save the picture on phones memory to later send it to AWS. I can take a picture and the path for the picture is there, but I am failing to create a file from the path using: final imageFile = await…
anar
  • 11
  • 3