mac 2.0.0

  • README.md
  • Installing
  • Versions
  • 37

macOS for Dart

Dart package for macOS integration.

Features

  • Easy to use
  • Dictation (Speech Recognition and TTS)
  • Application Interaction (High Level API for working with applications)
  • Scripting Helpers
  • System Information
  • User Interface

Example

import "package:mac/mac.dart";

void main() {
  say("Your computer is named: ${SystemInformation.getComputerName()}");
  say("You are running macOS ${SystemInformation.getVersion()}");
  say("Battery is at ${Battery.getLevel()}%");
  say("There are ${Applications.list().length} apps installed");

  if (Finder.getWindowCount() == 0) {
    say("Finder is not open.");
  } else {
    say("Finder is open.");
  }

  var app = Applications.get("Textual 5");

  if (app.isInstalled()) {
    say("Textual 5 is installed");
  } else {
    say("Textual 5 is not installed.");
  }

  var result = UI.displayDialog("Open Mission Control?", buttons: [
    "Yes",
    "No"
  ]);

  if (result.button == "Yes") {
    say("Opening Mission Control");
    MissionControl.activate();
  }
}

1. Depend on it

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


dependencies:
  mac: "^2.0.0"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:mac/mac.dart';
        
Version Uploaded Documentation Archive
2.0.0 Aug 20, 2016 Go to the documentation of mac 2.0.0 Download mac 2.0.0 archive

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • tool failures on Feb 14, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
0 / 100
Health:
Code health derived from static analysis. [more]
97 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
39 / 100
Overall score:
Weighted score of the above. [more]
37

Platforms

Detected platforms: Flutter, other

Primary library: package:mac/mac.dart with components: io.

Suggestions

  • Fix lib/src/plist.dart.

    Strong-mode analysis of lib/src/plist.dart failed with the following error:

    line: 37 col: 27
    The getter 'name' isn't defined for the class 'XmlNode'.

  • Maintain CHANGELOG.md.

    Changelog entries help clients to follow the progress in your code.

  • Fix issues reported by dartanalyzer.

    dartanalyzer reported 1 error(s) and 0 warning(s).

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Maintain an example.

    None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use mac.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
crypto >=0.9.2 <3.0.0 2.0.2+1
jsonx >=2.0.0 <3.0.0 2.0.2
xml >=2.0.0 <3.0.0 2.6.0 3.0.0-alpha
Transitive dependencies
charcode 1.1.1
collection 1.14.5
convert 2.0.1
matcher 0.12.1+4
path 1.5.1
petitparser 1.7.0
stack_trace 1.9.2
typed_data 1.1.5