API Reference 0.5.1+4rikulo_connectionConnection

Connection class

Network connection information of this device.

class Connection {
 static const String UNKNOWN = "unknown";
 static const String ETHERNET = "ethernet";
 static const String WIFI = "wifi";
 static const String CELL_2G = "2g";
 static const String CELL_3G = "3g";
 static const String CELL_4G = "4g";
 static const String NONE =  "none";

 js.Proxy _connection;

 factory Connection() => connection;

 Connection._internal() {
   if (device == null)
     throw new StateError('device is not ready yet.');
   js.scoped(() {
     _connection = js.context.navigator.network.connection;
     js.retain(_connection);
   });
 }

 /** connection type */
 String get type => js.scoped(() => _connection.type);
}

Static Properties

const String CELL_2G #

static const String CELL_2G = "2g"

const String CELL_3G #

static const String CELL_3G = "3g"

const String CELL_4G #

static const String CELL_4G = "4g"

const String ETHERNET #

static const String ETHERNET = "ethernet"

const String NONE #

static const String NONE =  "none"

const String UNKNOWN #

static const String UNKNOWN = "unknown"

const String WIFI #

static const String WIFI = "wifi"

Constructors

factory Connection() #

factory Connection() => connection;

Properties

final String type #

connection type

String get type => js.scoped(() => _connection.type);