mac 2.0.0

  • Installing
  • Versions
  • 32

macOS for Dart

Dart package for macOS integration.


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


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: [

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

Use this package as a library

1. Depend on it

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

  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 flutter 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


We analyzed this package on Jun 19, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3


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


Detected platforms: Flutter, other

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


  • Maintain

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

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 2 errors 23 hints.

    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'.

    Strong-mode analysis of lib/mac.dart gave the following hint:

    line: 9 col: 8
    Unused import: 'package:crypto/crypto.dart'.

    Similar analysis of the following files failed:

    • lib/record_parser.dart (hint)
    • lib/src/apps.dart (hint)
    • lib/src/common.dart (hint)
    • lib/src/dictation.dart (hint)
    • lib/src/script.dart (hint)
    • lib/src/ui.dart (hint)
    • lib/src/utils/http.dart (hint)
    • lib/src/utils/time.dart (hint)
    • lib/src/where_am_i.dart (hint)
  • Package is getting outdated.

    The package was released 95 weeks ago.

  • 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.


Package Constraint Resolved Available
Direct dependencies
crypto >=0.9.2 <3.0.0 2.0.5
jsonx >=2.0.0 <3.0.0 2.0.2
xml >=2.0.0 <3.0.0 2.6.0 3.0.0
Transitive dependencies
charcode 1.1.1
collection 1.14.10
convert 2.0.1
matcher 0.12.3
path 1.6.1
petitparser 1.7.6
stack_trace 1.9.2
typed_data 1.1.5