device 0.1.0 copy "device: ^0.1.0" to clipboard
device: ^0.1.0 copied to clipboard

outdated

Data model for a device with various fields and geographical positions data

Device #

Build Status

Data structure for a device.

// data properties
int id,
String uniqueId,
int groupId,
String name,
GeoPoint position,
double batteryLevel,
GeoDataFrame df,
Map<String, dynamic> properties,
// state properties
bool isVisible = true,
bool isDisabled = false,
Duration keepAlive = const Duration(minutes: 1),
Duration sleepingTimeout = const Duration(minutes: 10),
bool isFollowed = false,
bool isTraced = false

Position #

The device position is a GeoPoint

final GeoPoint lastPosition = device.position;
final DateTime lastPositionDate = device.lastPositionDate;

Speed #

final double speed = device.speed;
/// The speed of the device

Network status #

final DeviceNetworkStatus networkStatus = device.networkStatus;
/// One of [DeviceNetworkStatus.online], [DeviceNetworkStatus.sleeping],
/// [DeviceNetworkStatus.offline] or [DeviceNetworkStatus.unknown]

final bool isConnected = device.isAlive;
/// Has the device been seen on the network before [keepAlive] timeout

final bool hasJustDisconnected = device.isSleeping;
/// Has the device been seen on the network before [sleepingTimeout] timeout

final bool isDisconnected = device.isOffline;
/// Last time the device was seen on the network is before [sleepingTimeout] timeout

final bool hasNeverBeenSeen = device.isUnknown;
/// The device has never been seen on the network

Info #

final device.describe();
/// Print device info
6
likes
0
pub points
49%
popularity

Publisher

unverified uploader

Data model for a device with various fields and geographical positions data

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

extra_pedantic, geodf, geopoint, meta, pedantic

More

Packages that depend on device