Skip to content
This repository has been archived by the owner on May 7, 2023. It is now read-only.
/ device Public archive

Data structure representing a device for Dart

License

Notifications You must be signed in to change notification settings

synw/device

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Device

pub package 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

About

Data structure representing a device for Dart

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages