DatabaseHelper class

Constructors

DatabaseHelper()
factory

Properties

database Future<Database>
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clearLocations() Future<void>
countLocations() Future<int>
countPendingUploads() Future<int>
deleteBatchLocations(List<int> ids) Future<void>
deletePendingUpload(int id) Future<void>
getBatchLocation(int limit) Future<List<LocationDataModel>>
getLocationsByDateRange({DateTime? from, DateTime? to, int limit = 500}) Future<List<LocationDataModel>>
getPendingUploads(DateTime now, int maxRetries) Future<List<Map<String, dynamic>>>
Returns pending uploads whose next_retry_at <= now and attempts < maxRetries.
incrementRetryAttempt(int id, int currentAttempts, int maxRetries) Future<void>
Increments retry count and schedules next attempt using exponential backoff. Deletes the record if currentAttempts + 1 >= maxRetries.
insertLocation(LocationDataModel location) Future<void>
insertPendingUpload({required String payload, required String url, String? accessToken, Map<String, String>? customHeaders}) Future<void>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

resetForTesting() Future<void>
Closes, deletes, and resets the database. For use in tests only.