mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-08-19 01:17:12 +02:00
upload working
This commit is contained in:
@@ -21,8 +21,11 @@ class SettingsScreen extends StatelessWidget {
|
||||
color: appState.isLoggedIn ? Colors.green : null,
|
||||
),
|
||||
title: Text(appState.isLoggedIn
|
||||
? 'Logged in as ${appState.username}'
|
||||
: 'Log in to OpenStreetMap'),
|
||||
? 'Logged in as ${appState.username}'
|
||||
: 'Log in to OpenStreetMap'),
|
||||
subtitle: appState.isLoggedIn
|
||||
? const Text('Tap to logout')
|
||||
: const Text('Tap to login'),
|
||||
onTap: () async {
|
||||
if (appState.isLoggedIn) {
|
||||
await appState.logout();
|
||||
@@ -31,6 +34,41 @@ class SettingsScreen extends StatelessWidget {
|
||||
}
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.refresh),
|
||||
title: const Text('Refresh Login Status'),
|
||||
subtitle: const Text('Check if you\'re already logged in'),
|
||||
onTap: () async {
|
||||
await appState.refreshAuthState();
|
||||
if (context.mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(appState.isLoggedIn
|
||||
? 'Logged in as ${appState.username}'
|
||||
: 'Not logged in'),
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.login_outlined),
|
||||
title: const Text('Force Fresh Login'),
|
||||
subtitle: const Text('Clear stored tokens and login again'),
|
||||
onTap: () async {
|
||||
await appState.forceLogin();
|
||||
if (context.mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(appState.isLoggedIn
|
||||
? 'Fresh login successful: ${appState.username}'
|
||||
: 'Fresh login failed'),
|
||||
backgroundColor: appState.isLoggedIn ? Colors.green : Colors.red,
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
if (appState.isLoggedIn)
|
||||
ListTile(
|
||||
leading: const Icon(Icons.cloud_upload),
|
||||
|
||||
Reference in New Issue
Block a user