feat: add send location button to force immediate report
This commit is contained in:
parent
4eade880b1
commit
cd34c8bbf3
5 changed files with 92 additions and 31 deletions
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue