2

The following error shows up when i'm trying to run the hello world default code when you create a project in with project type: Dart Chrome App

[error] Can't read 'package:chrome/chrome_app.dart' (ChromeService error: Could not resolve reference: package:chrome/chrome_app.dart

the code is as follow:

import 'dart:html';

import 'package:chrome/chrome_app.dart' as chrome;

int boundsChange = 100;
int count = 0;

void main() {
  querySelector('#text_id').onClick.listen(resizeWindow);
}

void resizeWindow(MouseEvent event) {
  chrome.ContentBounds bounds = chrome.app.window.current().getBounds();

  bounds.width += boundsChange;
  bounds.left -= boundsChange ~/ 2;

  chrome.app.window.current().setBounds(bounds);

  boundsChange *= -1;

  querySelector("#count").text = (count++).toString();
}
  • What editor are you using to create the boilerplate project? Please post the pubspec.yaml also. (BTW the dependency to the Chrome package is probably missing from your pubspec.) – Argenti Apparatus Oct 21 '16 at 10:28
  • You may try to install Dart's [command-line tools](https://www.dartlang.org/install) (add Dart's bin dir to PATH variable), open a console at project's root directory and run `pub get` manually, then, reopen the project on `Chrome Dev Editor` and you should be able to run the Hello World. – Gomiero Oct 23 '16 at 01:47

0 Answers0