showAddPlaceDialogIfLoggedIn function
- required BuildContext context,
- double? latitude,
- double? longitude,
Shows the add place dialog and returns the result. Returns null if user is not logged in or cancels. Returns AddPlaceResult with place and encryption flag.
Implementation
Future<AddPlaceResult?> showAddPlaceDialogIfLoggedIn({
required BuildContext context,
double? latitude,
double? longitude,
}) async {
final webId = await getWebId();
if (webId == null || webId.isEmpty) {
if (!context.mounted) return null;
await showLoginRequiredDialog(context);
return null;
}
if (!context.mounted) return null;
final result = await showDialog<AddPlaceResult>(
context: context,
builder: (_) => AddPlaceForm(
initialLatitude: latitude,
initialLongitude: longitude,
returnWidget: const GeoMapWidget(),
),
);
return result;
}