device 0.2.0

Flutter Android iOS

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

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
2
likes
90
pub points
71%
popularity

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

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

ansterj@gmail.com

License

MIT (LICENSE)

Dependencies

extra_pedantic, geodf, geopoint, meta, pedantic

More

Packages that depend on device