refactor: Move to upstream geolocator
This commit is contained in:
parent
b66c2ca8ff
commit
6d4cc45d07
7 changed files with 49 additions and 26 deletions
|
|
@ -57,13 +57,17 @@ class SendLocationDialogState extends State<SendLocationDialog> {
|
|||
Position position;
|
||||
try {
|
||||
position = await Geolocator.getCurrentPosition(
|
||||
desiredAccuracy: LocationAccuracy.best,
|
||||
timeLimit: const Duration(seconds: 30),
|
||||
locationSettings: const LocationSettings(
|
||||
accuracy: LocationAccuracy.best,
|
||||
timeLimit: Duration(seconds: 30),
|
||||
),
|
||||
);
|
||||
} on TimeoutException {
|
||||
position = await Geolocator.getCurrentPosition(
|
||||
desiredAccuracy: LocationAccuracy.medium,
|
||||
timeLimit: const Duration(seconds: 30),
|
||||
locationSettings: const LocationSettings(
|
||||
accuracy: LocationAccuracy.medium,
|
||||
timeLimit: Duration(seconds: 30),
|
||||
),
|
||||
);
|
||||
}
|
||||
setState(() => this.position = position);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue