showLoginRequiredDialog function
- BuildContext context
Shows a dialog prompting user to login.
Implementation
Future<void> showLoginRequiredDialog(BuildContext context) async {
await showDialog(
context: context,
builder: (ctx) => AlertDialog(
title: const Text('Login Required'),
content: const Text('Please log in to add places to your collection.'),
actions: [
TextButton(
onPressed: () => Navigator.of(ctx).pop(),
child: const Text('Cancel'),
),
ElevatedButton(
onPressed: () {
Navigator.of(ctx).pop();
SolidAuthHandler.instance.handleLogin(ctx);
},
child: const Text('Login'),
),
],
),
);
}