chrome_os_io 0.2.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 50

Pub Package Github Actions CI

Introduction #

This package enables use of 'dart:io' networking APIs in Chrome OS Apps.

Supported 'dart:io' APIs include:

The package is implemented as a driver for package:universal_io. Licensed under the Apache License 2.0. A few files in the package were obtained from package:chrome under the BSD 2-Clause License.

Contributing #

Unfortunately writing automatic tests for Chrome OS Apps is painful. At the moment, the project uses the following manual workflow:

  1. Compile the example app.
  2. Open Chrome OS page "chrome://extensions".
  3. Click "Load unpacked extension"
  4. Use buttons in the web app for running tests.
  5. Look at the console (to be sure nothing is wrong).
  • chrome
    • For Chrome extensions.
  • webext
    • For Google Chrome, Mozilla Firefox, and Microsoft Edge extensions.
  • webextdev
    • A tool for browser extension developers.

Getting started #

In pubspec.yaml:

dependencies:
  chrome_os_io: ^0.1.0

In main.dart:

import 'package:chrome_os_io/chrome_os_io.dart';
import 'package:universal_io/io.dart';

void main() async {
  chromeIODriver.enable();

  // 'dart:io' works now!
  final socket = await Socket.connect("localhost", 8080);
}

0.2.1 #

  • Fixes issues with 'universal_io' imports.

0.2.0 #

  • Using 'universal_io' version 1.0.0.

0.1.0 #

  • Initial release

example/example.dart

import 'package:chrome_os_io/chrome_os_io.dart';
import 'package:universal_io/io.dart';

Future<void> main() async {
  // Enable Chrome IO Driver
  chromeIODriver.enable();

  // Open TCP server
  final server = await ServerSocket.bind('localhost', 0);
  server.listen((socket) {
    // ...
  });

  // Open TCP client
  final client = await Socket.connect('localhost', server.port);

  // ...

  await client.close();
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  chrome_os_io: ^0.2.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:chrome_os_io/chrome_os_io.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
50
Learn more about scoring.

We analyzed this package on Feb 27, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
meta ^1.1.7 1.1.8
universal_io ^1.0.1 1.0.1
Transitive dependencies
zone_local 0.1.2
Dev dependencies
pedantic ^1.9.0
test ^1.8.0
webextdev ^0.1.3