removeAllSavedVehicles function
void
removeAllSavedVehicles()
Deletes all saved vehicles from native platform storage.
This method removes ALL previously saved vehicle associations, effectively resetting the vehicle configuration to a clean state. After calling this method, automatic trip detection will be disabled until new vehicles are saved.
Behavior:
- Removes all saved vehicle devices from native storage
- Clears vehicle-based automatic trip detection rules
- Cannot be undone - all vehicle data is permanently deleted
- Does not affect currently active trips
Platform Communication:
- Method Channel: 'removeAllSavedVehicles'
- Parameters: None
- Side Effects: Clears native vehicle storage completely
Usage Example:
// Typically used with user confirmation
final confirmed = await showConfirmDialog('Delete all vehicles?');
if (confirmed) {
removeAllSavedVehicles();
print('All vehicles deleted - automatic detection disabled');
}
Important Considerations:
- Irreversible Action: All vehicle data is permanently lost
- Trip Detection Impact: Disables automatic trip start/end detection
- User Experience: Users will need to re-scan and save vehicles
- Use Sparingly: Consider removeSavedVehicle for selective removal
When to Use:
- Factory reset scenarios
- Troubleshooting trip detection issues
- User switching to completely different vehicles
- Clean slate setup for new users
- Resolving corrupted vehicle data
Alternative:
- Use
removeSavedVehicle()to remove specific vehicles instead of all
Implementation
void removeAllSavedVehicles() {
platform.invokeMethod('removeAllSavedVehicles');
}