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

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

chrome_extension.dart #

pub package Build Status

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

This allows to build Chrome extension with Dart & Flutter and to interop with the native APIs easily with a high-level type-safe interface.

The JS interop is build on top of dart:js_interop (static interop) which make it ready for future WASM compilation.

Using the library #

Example #

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));
}

Available APIs #

Documentation #

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