SendLocationNotification class

masterSwitchState will control whether location is sent to any user

locationPromptDialog will be called whenever package is about to send location and masterSwitchState is false.

Make sure that locationPromptDialog is a dialog or a function which can ask the user to turn the masterSwitchState true if needed.

Constructors

SendLocationNotification()
factory

Properties

allAtsignsLocationData Map<String, LocationDataModel>
getter/setter pair
atClient ↔ AtClient?
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isEventDataInitialized bool
getter/setter pair
isEventInUse bool
getter/setter pair
isLocationDataInitialized bool
getter/setter pair
locationKey String
final
locationPromptDialog Function?
getter/setter pair
masterSwitchState bool
getter/setter pair
positionStream StreamSubscription<Position>?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timer Timer?
getter/setter pair

Methods

addMember(LocationDataModel _newLocationDataModel) Future<void>
we are assuming that the _newLocationDataModel has a new share id if it has a same id already in [allAtsignsLocationData_newLocationDataModel.receiver] then we won't add it again
checkForExpiredInvites() → dynamic
checks for expired LocationDataModel and removes from allAtsignsLocationData.
compareForMissingInvites(List<LocationDataModel> _newLocationDataModel) → dynamic
looks for newly added LocationDataModel and adds to allAtsignsLocationData.
deleteAllLocationKey() → void
Deletes all location keys
findAtSignsToShareLocationWith() → void
checks for atsigns to share location with.
getAllLocationShareKeys() → dynamic
gets all 'location-notify' keys sent from the logged in atsign.
getLocationDataModel(String _atsign) LocationDataModel?
ifLocationDataAlreadyExists(LocationDataModel _newLocationDataModel) bool
checks if _newLocationDataModel is already present in allAtsignsLocationData.
init(AtClient? newAtClient) → void
initialises all the variables
initEventData(List<LocationDataModel> locationDataModel) → dynamic
should be called if at_events_flutter package is being used.
locationNotificationModelToLocationDataModel(LocationNotificationModel locationNotificationModel) LocationDataModel
converts LocationNotificationModel to LocationDataModel.
newAtKey(int ttr, String key, String sharedWith, {int? ttl}) → AtKey
Creates a new AtKey with the specified parameters
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
prepareLocationDataAndSend(String receiver, LocationDataModel locationData, LatLng? myLocation) Future<void>
Prepares location data and sends it to the specified receiver
removeMember(String inviteId, List<String> atsignsToRemove, {bool isSharing = false, required bool isExited, required bool isAccepted}) Future<void>
removes a inviteId LocationDataModel from atsignsToRemove of allAtsignsLocationData.
reset() → dynamic
should be called while switching an atsign
sendLocation() → void
sends 'location-notify' to all allAtsignsLocationData on every 100 metre location change.
sendLocationAfterDataUpdate(List<String> atsignsUpdated) → dynamic
sends 'location-notify' key with updated LocationDataModel to atsignsUpdated.
sendNull(List<String> atsigns) Future<bool>
will delete locationKey for the atsign and remove from allAtsignsLocationData
setLocationPrompt(Function _locationPrompt) → void
setMasterSwitchState(bool _state) → void
if state changes then we will send update in next round of location sharing
toString() String
A string representation of this object.
inherited
updateExistingLocationDataModel(List<LocationDataModel> _newLocationDataModel) → dynamic
update [allAtsignsLocationData_newLocationDataModel.receiver] with new values and sends updated location

Operators

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