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

Platformweb

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
160
pub points
77%
popularity

Publisher

verified publisherxaha.dev

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

Repository (GitHub)
View/report issues

Documentation

API reference

Funding

Consider supporting this project:

www.buymeacoffee.com
github.com

License

BSD-2-Clause (license)

More

Packages that depend on chrome_extension