feat: add send location button to force immediate report

This commit is contained in:
fiatcode 2026-04-30 13:23:07 +07:00
parent 4eade880b1
commit cd34c8bbf3
No known key found for this signature in database
5 changed files with 92 additions and 31 deletions

View file

@ -55,6 +55,16 @@ class LocationBridge {
}
}
static Future<bool> reportLocation() async {
try {
final result = await _methodChannel.invokeMethod<bool>('reportLocation');
return result ?? false;
} on PlatformException catch (e) {
debugPrint('Failed to report location: ${e.message}');
return false;
}
}
static Stream<Map<String, dynamic>> get locationUpdates {
_locationStream ??= _eventChannel.receiveBroadcastStream().map(
(event) => Map<String, dynamic>.from(event as Map),