# universal_io 0.2.0

Cross-platform version of 'dart:io'. Supports browser, Node.JS, and other targets.




## Installing
```
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add 'universal_io:0.2.0'
```
Published: 2019-05-31T10:54:11.421350Z
Expected archive SHA-256: debb79ed9c47f7a90973d0aae77bcd01bd8e0e66156412324f37399f2336d4ee

Available in cache; verification: upstream_checksum
## Direct dependencies
- ip: ^0.1.1
- meta: ^1.1.7
- raw: ^0.2.0
- typed_data: ^1.1.6
- zone_local: ^0.1.0

## Package README (untrusted upstream documentation)
# Introduction
A [Dart](https://dartlang.org) package that supports a subset of [dart:io](https://api.dartlang.org/stable/2.1.1/dart-io/dart-io-library.html)

__In the Dart VM and Flutter__, _"package:universal_io/io.dart"_ exports the standard _"dart:io"_.
This is accomplished with conditional imports, which is an undocumented feature of Dart.

Licensed under the [Apache License 2.0](LICENSE).

Much of the source code was adopted from the original 'dart:io' in [Dart SDK](https://github.com/dart-lang/sdk),
which was licensed under a BSD-style license.

## Issues
  * Found issues? Report them at the [Github issue tracker](https://github.com/gohilla/dart-universal_io/issues).
  * Have a fix? [Create a pull request](https://github.com/gohilla/dart-universal_io/pull/new/master)!

# Getting started
## 1.Add dependency
In `pubspec.yaml`:
```yaml
dependencies:
  universal_io: ^1.0.0
```

## 2.Choose driver
  * VM/Flutter?
    * Library "package:universal_io/io.dart" will automatically export _dart:io_ for you.
  * Browser?
    * _BrowserIODriver_ is automatically used when compiling with _Dart2js_ / _devc_. Most
      importantly, it implements  _HttpClient_ (with restrictions imposed by browsers).
    * If you need things like sockets or unrestricted _HttpClient_, choose one of the options below.
  * Chrome OS App?
    * [chrome_os_io](https://github.com/terrier989/dart-chrome_os_io)
  * Node.JS? Google Cloud Functions?
    * [node_io](https://github.com/terrier989/dart-node_io)
  * A backend + GRPC messaging?
    * [grpc_io](https://github.com/terrier989/dart-grpc_io)

# Default driver behavior
  * __Platform__
    * In browser, variables are determined by browser APIs such as _navigator.userAgent_.
    * Elsewhere (e.g. Node.JS), appears like Linux environment.
  * __Files__
    * Access to all directories and files is denied.
  * __InternetAddress__
    * Implemented using [package:ip](https://github.com/gohilla/dart-ip).
    * `InternetAddress.lookup` uses Google's DNS-over-HTTP servers.
  * __HTTP client__
    * In browser, HTTP client is implemented using _dart:html_ _HttpRequest_ (XmlHttpRequest).
    * If a cross-origin request fails, error message contains a detailed description how to fix
      possible issues like missing cross-origin headers.
  * __Sockets and HTTP server__
    * Connecting/binding throws _UnimplementedError_.

## Changelog







 
