system 0.2.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 59

Build Status

Launch system operating system commands. Supported on Linux and macOS.

This is a wrapper around system.3: https://man.openbsd.org/system.3

Example uses #

For a runable example, see example/main.dart.

Possible uses include:

  • System.invoke('open <Url>');: Open <Url> in the system default web browser.

Notes #

For calling regular shell commands, it's recommended to use dart:io's Process.run() method. This allows you to get the standard output and supply standard input.

0.2.0 #

  • Upgraded to Dart 2.6 and FFI beta

0.1.0 #

  • Initial release

example/main.dart

import 'package:system/system.dart';

// Use the system `open` command to lauch the system default web browser on the
// Url dart.dev.
main() async {
  bool result = System.invoke('open http://dart.dev');
  if (result) {
    print('Succesfully launched dart.dev');
  } else {
    print('Failed launching dart.dev');
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  system: ^0.2.0

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:system/system.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
18
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]
59
Learn more about scoring.

We analyzed this package on Dec 9, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.12.21

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0 <3.0.0
ffi ^0.1.3 0.1.3
Dev dependencies
pedantic ^1.7.0
test ^1.5.0