UCJava
UCJava

Reputation: 307

Reading Version from manifest.json in a Chrome Packaged App

I want to display my apps version number dynamically on a page, so was wondering if there is a way to read it from the manifest.json in a Chrome Packaged App written in DART language ?

Upvotes: 1

Views: 249

Answers (2)

Xan
Xan

Reputation: 77523

I can't provide a DART-specific answer, but appropriate Chrome API is chrome.runtime.getManifest().

It returns a string an object representing your manifest file; extract the version number with .version.

Upvotes: 2

Robert
Robert

Reputation: 5662

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

void main() {
  print(chrome.runtime.getManifest()['version']);
}

Upvotes: 4

Related Questions