get method
Future<LocationResult>
get({
- LocationProfile? profile,
- bool withAddress = false,
- bool handlePermission = true,
- bool handleServices = true,
- LocationAccuracy? accuracy,
- Duration? maxAge,
- Duration? timeout,
- Locale? locale,
- BuildContext? context,
override
One location, with everything around it handled:
- Permission — runs the
baaba_permission_handlerflow (rationale, prompt, Settings with steps) unlesshandlePermissionisfalse. - Services — if location is off, shows Android's in-app "turn on
location" dialog (or a dialog that opens location settings) and
waits, unless
handleServicesisfalse. - Precision — if the profile needs precise location and only
approximate is allowed, asks once; otherwise carries on with
isApproximate: true. - Fix — reuses a fix younger than
maxAge, otherwise requests one. - Fallback — if none arrives in time, returns the last known
location up to
LocationConfig.maxFallbackAgeold, as a success. - Address — with
withAddress; a geocoding failure only setsaddressFailure.
accuracy, maxAge and timeout override the profile's.
Concurrent calls share one flow and one set of dialogs.
Implementation
@override
Future<LocationResult> get({
LocationProfile? profile,
bool withAddress = false,
bool handlePermission = true,
bool handleServices = true,
LocationAccuracy? accuracy,
Duration? maxAge,
Duration? timeout,
Locale? locale,
BuildContext? context,
}) => _record(
'get',
{
'profile': profile,
'withAddress': withAddress,
'handlePermission': handlePermission,
'handleServices': handleServices,
'accuracy': accuracy,
'maxAge': maxAge,
'timeout': timeout,
'locale': locale,
},
() => _impl.get(
profile: profile,
withAddress: withAddress,
handlePermission: handlePermission,
handleServices: handleServices,
accuracy: accuracy,
maxAge: maxAge,
timeout: timeout,
locale: locale,
context: context,
),
);