API Reference 0.5.1+4rikulo_device

rikulo_device library

Properties

Device device #

Singleton Device.

Device device

Functions

Future<Device> enableDeviceAccess([String serviceUri = "cordova.js"]) #

Enable the device accessibility and pass the singleton device via a Future; throw exception if failed to enable the device.

Future<device> enable = enableDeviceAccess();
enable.then((device) {
   //Access the device
    ...
});
enable.handleException((ex) {
   //Fail to enable the device
    ...
});

This method can be called multiple times, but the second invocation will return the ready singleton device immediately.

  • serviceUri - the URI of the device access service uri;

             default: "cordova.js".
    
Future<Device> enableDeviceAccess([String serviceUri = "cordova.js"])
=> device == null ?
   _doWhenDeviceReady(serviceUri) : new Future.value(device);

Classes