google_apps 0.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 51

Dart APIs for Google Apps Script #

This is not an official Google product. It is not supported by the Dart team.

This package is still in an experimental state.

A library to write Google Apps Script.

This library has been written on a per-need basis. As such it is missing lots of useful functionality that I just hadn't needed yet. Until the API coverage is nearing completeness I recommend to checkout the GIT repository during development and to use this library with a path directive, adding the missing functions when they are encountered.

Consider contributing your changes back to the original repository.

Features and bugs #

Please file feature requests and bugs at the issue tracker.

Changelog #

0.0.2 #

  • Upgrade to Dart 2.
  • Add a few more functions.

0.0.1+3 #

  • Fix the sheet example.

0.0.1+2 #

  • Update README (removing the example and adding the issue tracker).

0.0.1+1 #

  • Rename the example file so it's recognized by

0.0.1 #

  • Initial version.


// Copyright 2018 Google LLC
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.

/// Compile this example with
/// `dart2js --csp -o hello.js example/hello_docs.dart`.
/// See [apps_script_tools](
/// for a description on how to execute the generated program.

library hello_docs;

import 'package:js/js.dart';
import 'package:google_apps/document.dart';

external set sayHello(value);

external set onOpen(value);

void sayHelloDart() {
  DocumentApp.getUi().alert("Hello world");

void onOpenDart(e) {
      .createMenu("from dart")
      .addItem("say hello", "sayHello")

main(List<String> arguments) {
  onOpen = allowInterop(onOpenDart);
  sayHello = allowInterop(sayHelloDart);

Use this package as a library

1. Depend on it

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

  google_apps: ^0.0.2

2. Install it

You can install packages from the command line:

with pub:

$ pub get

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

3. Import it

Now in your Dart code, you can use:

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

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

  • Dart: 2.6.1
  • pana: 0.12.21


Detected platforms: web, other

Primary library: package:google_apps/google_apps.dart with components: js.

Health issues and suggestions

Document public APIs. (-0.06 points)

180 out of 186 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/spreadsheet.dart. (-1 points)

Analysis of lib/spreadsheet.dart reported 2 hints:

line 95 col 3: Prefer using /// for doc comments.

line 109 col 3: Prefer using /// for doc comments.

Format lib/document.dart.

Run dartfmt to format lib/document.dart.

Format lib/drive.dart.

Run dartfmt to format lib/drive.dart.

Maintenance suggestions

The package description is too short. (-13 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
js ^0.6.1 0.6.1+1