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}) -
constfactory
-
Locator.fromJson(Map<
String, dynamic> json) -
factory
Properties
-
assets
→ List<
Asset> ? -
assetsis the list of assets associated with the locatorno setterinherited -
assetsIds
→ List<
String> ? -
assetsIdsis the list of assets associated with the locatorno setterinherited -
copyWith
→ $LocatorCopyWith<
Locator> -
Create a copy of Locator
with the given fields replaced by the non-null parameter values.
no setterinherited
- createdAt → DateTime
-
createdAtis the creation date of the locatorno setterinherited - createdBy → User?
-
createdByis the user who created the locatorno setterinherited - createdById → String?
-
createdByIdis the ID of the user who created the locatorno setterinherited - customization → RegisteredApp?
-
customizationis the registered app that will act as a customization for this locatorno setterinherited - customizationId → String?
-
customizationIdis the ID of the registered app that will act as a customization for this locatorno setterinherited - expiredBy → User?
-
expiredByis the user who expired the locator, can be null if not expiredno setterinherited - expiredById → String?
-
expiredByIdis the ID of the user who expired the locator, can be null if not expiredno setterinherited - expiresAt → DateTime?
-
expiresAtis the expiration date of the locator, can be null for non-expiring locatorsno setterinherited -
geofences
→ List<
Geofence> ? -
geofencesis the list of geofences associated with the locatorno setterinherited -
geofencesIds
→ List<
String> ? -
geofencesIdsis the list of geofences associated with the locatorno setterinherited - hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
idis the UUIDv4 identifier of the locatorno setterinherited - isExpired → bool?
-
isExpiredindicates if the locator is expiredno setterinherited - link → String
-
no setter
- mqttConfig → LocatorMqttConfig?
-
mqttConfigis the MQTT configuration for the locatorno setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- token → String
-
tokenis the token used to access the locatorno setterinherited -
triggers
→ List<
Trigger> ? -
triggersis the list of triggers associated with the locatorno setterinherited -
triggersIds
→ List<
String> ? -
triggersIdsis the list of triggers associated with the locatorno setterinherited - updatedAt → DateTime
-
updatedAtis the last update date of the locatorno setterinherited - updatedBy → User?
-
updatedByis the user who last updated the locatorno setterinherited - updatedById → String?
-
updatedByIdis the ID of the user who last updated the locatorno 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
Aswitch-like method, using callbacks. -
mapOrNull<
TResult extends Object?> (TResult? $default(_Locator value)?) → TResult? -
Available on Locator, provided by the LocatorPatterns extension
A variant ofmapthat fallback to returningnull. -
maybeMap<
TResult extends Object?> (TResult $default(_Locator value)?, {required TResult orElse()}) → TResult -
Available on Locator, provided by the LocatorPatterns extension
A variant ofmapthat fallback to returningorElse. -
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 ofwhenthat fallback to anorElsecallback. -
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
Aswitch-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 ofwhenthat fallback to returningnull
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
basicUserFieldsto get the user data It does not use the Locator.graphqlFragment to reduce the amount of datano 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
basicUserFieldsto get the user datano 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