Reputation: 307
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
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
Reputation: 5662
import 'package:chrome/chrome_app.dart' as chrome;
void main() {
print(chrome.runtime.getManifest()['version']);
}
Upvotes: 4