Book Image

DART Cookbook

By : Ivo Balbaert
Book Image

DART Cookbook

By: Ivo Balbaert

Overview of this book

Table of Contents (18 chapters)
Dart Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating a Chrome app


You can build native-like apps with the Dart web technology through Chrome apps. Such apps can be large for some browsers and appear to be part of the surrounding operating system; they run offline by default, and you can make them available from the Chrome Web Store. This recipe will show you how to start working with this type of app.

How to do it...

Perform the following steps to create a Chrome app. The code for this recipe can be found in the project chrome_pack:

  1. Start with creating a new Dart project and choose the Chrome packaged application template.

  2. The Pub Get command starts automatically, and installs the Chrome package from the pub.

  3. The first thing you will notice is the presence of a new file manifest.json, with the following initial content:

    {
      "name": "Chrome pack",
      "version": "1",
      "manifest_version": 2,
      "icons": {"128": "dart_icon.png"},
      "app": {
        "background": {
          "scripts": ["background.js"]
        }
      }
    }

    We don't have to change anything here...