isDeviceReady method

Future<bool> isDeviceReady ()

future of deviceready event

Implementation

Future<bool> isDeviceReady() {
  if (_isDeviceReady) {
    return Future.value(true);
  }
  Completer<bool> completer = new Completer();
  document.on['deviceready'].take(1).listen((Event event) {
    _isDeviceReady = true;
    completer.complete();
  });
  return completer.future;
}