MBLocationTrigger class
A location trigger that becomes true when the user visits a location, specified by lat, lng and radius.
Constructors
- MBLocationTrigger({required String id, required String address, required double latitude, required double longitude, required double radius, required int afterDays})
- Initializes a location trigger with the data provided.
-
MBLocationTrigger.fromDictionary(Map<
String, dynamic> dictionary) -
Initializes a location trigger with the data of the dictionary returned by the APIs.
factory
-
MBLocationTrigger.fromJsonDictionary(Map<
String, dynamic> dictionary) -
factory
Properties
- address → String
-
The address of the location.
final
- afterDays → int
-
The lookback window to check (in days).
final
- completionDate ↔ DateTime?
-
The date of completion of this trigger.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
The id of the trigger.
finalinherited
- latitude → double
-
The latitude of the location.
final
- longitude → double
-
The longitude of the location.
final
- radius → double
-
The radius to check, in meters.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- triggerType → MBTriggerType
-
The type of trigger.
finalinherited
Methods
-
isValid(
bool fromAppStartup) → Future< bool> -
If the trigger is valid or not.
@param fromAppStartup If the check has been triggered at the app startup
@returns If the trigger is valid or not.
override
-
locationDataUpdated(
{required double latitude, required double longitude, double? lastLatitude, double? lastLongitude}) → bool -
Function called when new location data is available.
@param latitude The new latitude.
@param longitude The new longitude.
@param lastLatitude The last latitude seen by
MBAutomation
. @param lastLongitude The last longitude seen byMBAutomation
. @returns If this trigger has changed. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJsonDictionary(
) → Map< String, dynamic> -
Converts the trigger to a JSON dictionary.
@returns The JSON representation of the trigger.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
updatedTrigger(
MBTrigger newTrigger) → MBTrigger -
Updates the trigger with the new info; by defaults no action is done.
@param newTrigger The new trigger from which info will be copied.
@returns The updated trigger.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited