Locator class abstract

Available extensions
Annotations
  • @freezed

Constructors

Locator({required String id, required String token, LocatorMqttConfig? mqttConfig, List<Asset>? assets, List<String>? assetsIds, List<Geofence>? geofences, List<String>? geofencesIds, List<Trigger>? triggers, List<String>? triggersIds, @TimestampOrNullConverter() DateTime? expiresAt, User? expiredBy, String? expiredById, bool? isExpired, @TimestampConverter() required DateTime createdAt, User? createdBy, String? createdById, @TimestampConverter() required DateTime updatedAt, User? updatedBy, String? updatedById, RegisteredApp? customization, String? customizationId})
const
factory
Locator.fromJson(Map<String, dynamic> json)
factory

Properties

assets List<Asset>?
assets is the list of assets associated with the locator
no setterinherited
assetsIds List<String>?
assetsIds is the list of assets associated with the locator
no setterinherited
copyWith → $LocatorCopyWith<Locator>
Create a copy of Locator with the given fields replaced by the non-null parameter values.
no setterinherited
createdAt DateTime
createdAt is the creation date of the locator
no setterinherited
createdBy User?
createdBy is the user who created the locator
no setterinherited
createdById String?
createdById is the ID of the user who created the locator
no setterinherited
customization RegisteredApp?
customization is the registered app that will act as a customization for this locator
no setterinherited
customizationId String?
customizationId is the ID of the registered app that will act as a customization for this locator
no setterinherited
expiredBy User?
expiredBy is the user who expired the locator, can be null if not expired
no setterinherited
expiredById String?
expiredById is the ID of the user who expired the locator, can be null if not expired
no setterinherited
expiresAt DateTime?
expiresAt is the expiration date of the locator, can be null for non-expiring locators
no setterinherited
geofences List<Geofence>?
geofences is the list of geofences associated with the locator
no setterinherited
geofencesIds List<String>?
geofences Idsis the list of geofences associated with the locator
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
id String
id is the UUIDv4 identifier of the locator
no setterinherited
isExpired bool?
isExpired indicates if the locator is expired
no setterinherited
no setter
mqttConfig LocatorMqttConfig?
mqttConfig is the MQTT configuration for the locator
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
token String
token is the token used to access the locator
no setterinherited
triggers List<Trigger>?
triggers is the list of triggers associated with the locator
no setterinherited
triggersIds List<String>?
triggers Idsis the list of triggers associated with the locator
no setterinherited
updatedAt DateTime
updatedAt is the last update date of the locator
no setterinherited
updatedBy User?
updatedBy is the user who last updated the locator
no setterinherited
updatedById String?
updatedById is the ID of the user who last updated the locator
no setterinherited

Methods

expire({required String apiToken, required Uri uri, void onResponse(String statusCode)?}) Future<bool>
expire expires the locator It returns true if the locator was successfully expired
fetch({required String apiToken, required Uri uri, void onResponse(String statusCode)?}) Future<Locator?>
fetch fetches a single locator from the server by its ID It returns a list of Locator with the required contextual information
map<TResult extends Object?>(TResult $default(_Locator value)) → TResult

Available on Locator, provided by the LocatorPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(_Locator value)?) → TResult?

Available on Locator, provided by the LocatorPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(_Locator value)?, {required TResult orElse()}) → TResult

Available on Locator, provided by the LocatorPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>(TResult $default(String id, String token, LocatorMqttConfig? mqttConfig, List<Asset>? assets, List<String>? assetsIds, List<Geofence>? geofences, List<String>? geofencesIds, List<Trigger>? triggers, List<String>? triggersIds, DateTime? expiresAt, User? expiredBy, String? expiredById, bool? isExpired, DateTime createdAt, User? createdBy, String? createdById, DateTime updatedAt, User? updatedBy, String? updatedById, RegisteredApp? customization, String? customizationId)?, {required TResult orElse()}) → TResult

Available on Locator, provided by the LocatorPatterns extension

A variant of when that fallback to an orElse callback.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes this Locator to a JSON map.
inherited
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>(TResult $default(String id, String token, LocatorMqttConfig? mqttConfig, List<Asset>? assets, List<String>? assetsIds, List<Geofence>? geofences, List<String>? geofencesIds, List<Trigger>? triggers, List<String>? triggersIds, DateTime? expiresAt, User? expiredBy, String? expiredById, bool? isExpired, DateTime createdAt, User? createdBy, String? createdById, DateTime updatedAt, User? updatedBy, String? updatedById, RegisteredApp? customization, String? customizationId)) → TResult

Available on Locator, provided by the LocatorPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>(TResult? $default(String id, String token, LocatorMqttConfig? mqttConfig, List<Asset>? assets, List<String>? assetsIds, List<Geofence>? geofences, List<String>? geofencesIds, List<Trigger>? triggers, List<String>? triggersIds, DateTime? expiresAt, User? expiredBy, String? expiredById, bool? isExpired, DateTime createdAt, User? createdBy, String? createdById, DateTime updatedAt, User? updatedBy, String? updatedById, RegisteredApp? customization, String? customizationId)?) → TResult?

Available on Locator, provided by the LocatorPatterns extension

A variant of when that fallback to returning null

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

expireGraphqlMutation String
expireGraphqlMutation is the GraphQL mutation to expire one or more locators by their IDs
no setter
fetchAllGraphqlQuery String
fetchAllGraphqlQuery is the GraphQL query to fetch all locators It includes the basic user fields fragment basicUserFields to get the user data It does not use the Locator.graphqlFragment to reduce the amount of data
no setter
fetchSingleQuery String
fetchSingleQuery is the GraphQL query to fetch a single locator by its ID It uses the Locator.graphqlFragment to get the locator data
no setter
graphqlFragment String
graphqlFragment is the GraphQL fragment to fetch the locator data It includes the basic user fields fragment basicUserFields to get the user data
no setter

Static Methods

expireMultiple({required String apiToken, required Uri uri, required List<String> ids, void onResponse(String statusCode)?}) Future<bool>
expireMultiple expires multiple locators by their IDs
fetchAll({required String apiToken, required Uri uri, void onResponse(String statusCode)?}) Future<List<Locator>>
fetchAll fetches all locators from the server It returns a list of Locator with the required contextual information