VietmapTrackingController class

Main controller for Vietmap Tracking Plugin

Mixed-in types

Properties

currentSmartBatteryProfile SmartBatteryProfile
Profile hiện tại đang được Smart Battery Manager áp dụng.
no setter
hashCode int
The hash code for this object.
no setterinherited
isConfigured bool
no setter
onFakeGpsDetected Stream<FakeGpsEvent>
Stream of fake GPS detection events. Native debounces at 30s. Listen to this after calling setFakeGpsPolicy.
no setter
onLocationUpdate Stream<LocationData>
no setter
onSmartBatteryProfileChanged Stream<SmartBatteryProfile>
Stream thông báo mỗi lần Smart Battery thay đổi profile.
no setter
onTrackingStatusChanged Stream<TrackingStatus>
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clearCachedLocations() Future<bool>
Delete all cached location records from local storage.
configure(String apiKey, {String? baseURL}) Future<bool>
Configure VietmapTrackingSDK with API key
configureAlertAPI(String apiKey, String apiID) Future<bool>
Configure Alert API for speed monitoring
configureCacheLimits({int maxRecords = 0, int maxDbSizeBytes = 0, int batchSize = 0}) Future<bool>
Configure SQLite cache limits.
configureVehicle({required String vehicleId, required int vehicleType, required int seats, required double weight, int? maxProvision}) Future<bool>
Configure vehicle parameters for speed-zone calculations.
didChangeAccessibilityFeatures() → void
Called when the system changes the set of currently active accessibility features.
inherited
didChangeAppLifecycleState(AppLifecycleState state) → void
Called when the system puts the app in the background or returns the app to the foreground.
override
didChangeLocales(List<Locale>? locales) → void
Called when the system tells the app that the user's locale has changed. For example, if the user changes the system language settings.
inherited
didChangeMetrics() → void
Called when the application's dimensions change. For example, when a phone is rotated.
inherited
didChangePlatformBrightness() → void
Called when the platform brightness changes.
inherited
didChangeTextScaleFactor() → void
Called when the platform's text scale factor changes.
inherited
didChangeViewFocus(ViewFocusEvent event) → void
Called whenever the PlatformDispatcher receives a notification that the focus state on a view has changed.
inherited
didHaveMemoryPressure() → void
Called when the system is running low on memory.
inherited
didPopRoute() Future<bool>
Called when the system tells the app to pop the current route, such as after a system back button press or back gesture.
inherited
didPushRoute(String route) Future<bool>
Called when the host tells the application to push a new route onto the navigator.
inherited
didPushRouteInformation(RouteInformation routeInformation) Future<bool>
Called when the host tells the application to push a new RouteInformation and a restoration state onto the router.
inherited
didRequestAppExit() Future<AppExitResponse>
Called when a request is received from the system to exit the application.
inherited
disableSmartBatteryOptimization() → void
Deprecated: Smart Battery tự động tắt cùng stopTracking.
enableSmartBatteryOptimization({SmartBatteryProfile preferredMovingProfile = SmartBatteryProfile.general}) Future<void>
Deprecated: Smart Battery tự động bật cùng startTracking. Dùng setSmartBatteryPreferredProfile để đổi profile ưu tiên.
feedLocationSpeedToSmartBattery(double speedMs) → void
Truyền speed (m/s) từ mỗi GPS update vào SmartBatteryManager để phát hiện xe đứng yên. Gọi trong callback onLocationUpdate.
feedLocationToSmartBattery(double speedMs, {double? heading}) → void
Truyền speed (m/s) và heading (°) từ mỗi GPS update vào SmartBatteryManager để phát hiện xe đứng yên và góc cua (cornering → navigation).
getCachedLocationsCount() Future<int>
Get number of location records waiting to be uploaded.
getCurrentLocation() Future<LocationData>
getDatabaseSizeBytes() Future<int>
Get current SQLite database file size in bytes.
getDriverId() Future<String?>
Get current driver ID (iOS only; returns null on Android).
getTrackingHealthStatus() Future<Map<String, dynamic>>
getTrackingHistory({required String userId, required int fromTimestamp, required int toTimestamp, int pageNumber = 1, int pageSize = 100, String sortBy = 'timestamp', bool sortDescending = false}) Future<List<GpsLocation>>
getTrackingStatus() Future<TrackingStatus>
getVehicleId() Future<String?>
Get current vehicle ID (iOS only; returns null on Android).
handleCancelBackGesture() → void
Called when a predictive back gesture is canceled, indicating that no navigation should occur.
inherited
handleCommitBackGesture() → void
Called when a predictive back gesture is finished successfully, indicating that the current route should be popped.
inherited
handleStartBackGesture(PredictiveBackEvent backEvent) bool
Called at the start of a predictive back gesture.
inherited
handleStatusBarTap() → void
Called when the user taps the status bar on iOS, to scroll a scroll view to the top.
inherited
handleUpdateBackGestureProgress(PredictiveBackEvent backEvent) → void
Called when a predictive back gesture moves.
inherited
hasLocationPermissions() Future<PermissionResult>
initializeTracking(String apiKey, {String? baseURL}) Future<void>
Validate the tracking API key against the server and initialize the SDK.
isNetworkConnected() Future<bool>
Check if device has active internet connectivity.
isSpeedAlertActive() Future<bool>
Check whether speed alert is currently active.
isTrackingActive() Future<bool>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
processExternalLocation({required double lat, required double lng, required double speed, required double heading, double? accuracy, double? altitude, int? timestamp}) Future<bool>
Inject an external GPS fix into the SDK (e.g. from a hardware GPS device).
registerLifecycleObserver() → void
Call once after configure() to enable automatic background/foreground notifications to the native SDK.
requestAlwaysLocationPermissions() Future<String>
requestLocationPermissions() Future<PermissionResult>
setAutoUpload(bool enabled) Future<bool>
Enable or disable automatic upload of cached locations.
setDriverId(String driverId) Future<bool>
Set driver ID directly.
setFakeGpsPolicy(String policy) Future<void>
Set the policy for handling detected fake GPS locations.
setMetadata(Map<String, dynamic> metadata) Future<void>
Attach arbitrary metadata to every GPS post under the "metadata" key.
setSmartBatteryPreferredProfile(SmartBatteryProfile profile) → void
Smart Battery Optimization tự động bật khi startTracking thành công và tự động tắt khi stopTracking được gọi. Không cần enable/disable thủ công.
setVehicleId(String vehicleId) Future<bool>
Set vehicle ID directly (without restarting tracking).
startTracking(LocationTrackingConfig config) Future<bool>
stopTracking() Future<bool>
toString() String
A string representation of this object.
inherited
turnOffAlert() Future<bool>
turnOnAlert() Future<bool>
unregisterLifecycleObserver() → void
updateTrackingConfig(LocationTrackingConfig config) Future<bool>
uploadCachedLocationsManually() Future<bool>
Manually trigger upload of all cached location records.

Operators

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

Static Properties

instance VietmapTrackingController
final