chrome_extension 0.3.0 copy "chrome_extension: ^0.3.0" to clipboard
chrome_extension: ^0.3.0 copied to clipboard

A library for accessing the `chrome.*` APIs available in Chrome extensions.

example/example.dart

import 'package:chrome_extension/alarms.dart';
import 'package:chrome_extension/power.dart';
import 'package:chrome_extension/storage.dart';

void main() async {
  // Use the chrome.power API
  chrome.power.requestKeepAwake(Level.display);

  // Use the chrome.storage API
  await chrome.storage.local.set({'mykey': 'value'});
  var values = await chrome.storage.local.get(null /* all */);
  print(values['mykey']);

  // Use the chrome.alarms API
  await chrome.alarms.create('MyAlarm', AlarmCreateInfo(delayInMinutes: 2));
}
48
likes
0
pub points
77%
popularity

Publisher

verified publisherxaha.dev

A library for accessing the `chrome.*` APIs available in Chrome extensions.

Repository (GitHub)
View/report issues

License

unknown (license)

More

Packages that depend on chrome_extension