mirror of
https://github.com/we-promise/sure.git
synced 2026-04-21 13:04:18 +00:00
Move debug logs button from Home to Settings page, remove refresh/logout from Home AppBar (#1146)
- Remove Debug Logs, Refresh, and Sign Out buttons from DashboardScreen AppBar - Add Debug Logs ListTile entry in SettingsScreen under app info section - Remove unused _handleLogout method from DashboardScreen - Remove unused log_viewer_screen.dart import from DashboardScreen https://claude.ai/code/session_017XQZdaEwUuRS75tJMcHzB9 Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -12,7 +12,6 @@ import '../widgets/net_worth_card.dart';
|
||||
import '../widgets/currency_filter.dart';
|
||||
import 'transaction_form_screen.dart';
|
||||
import 'transactions_list_screen.dart';
|
||||
import 'log_viewer_screen.dart';
|
||||
|
||||
class DashboardScreen extends StatefulWidget {
|
||||
const DashboardScreen({super.key});
|
||||
@@ -339,34 +338,6 @@ class DashboardScreenState extends State<DashboardScreen> {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _handleLogout() async {
|
||||
final confirmed = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: const Text('Sign Out'),
|
||||
content: const Text('Are you sure you want to sign out?'),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context, false),
|
||||
child: const Text('Cancel'),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context, true),
|
||||
child: const Text('Sign Out'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
if (confirmed == true && mounted) {
|
||||
final authProvider = Provider.of<AuthProvider>(context, listen: false);
|
||||
final accountsProvider = Provider.of<AccountsProvider>(context, listen: false);
|
||||
|
||||
accountsProvider.clearAccounts();
|
||||
await authProvider.logout();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colorScheme = Theme.of(context).colorScheme;
|
||||
@@ -387,30 +358,6 @@ class DashboardScreenState extends State<DashboardScreen> {
|
||||
),
|
||||
),
|
||||
),
|
||||
Semantics(
|
||||
label: 'Open debug logs',
|
||||
button: true,
|
||||
child: IconButton(
|
||||
icon: const Icon(Icons.bug_report),
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => const LogViewerScreen()),
|
||||
);
|
||||
},
|
||||
tooltip: 'Debug Logs',
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.refresh),
|
||||
onPressed: _handleRefresh,
|
||||
tooltip: 'Refresh',
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.logout),
|
||||
onPressed: _handleLogout,
|
||||
tooltip: 'Sign Out',
|
||||
),
|
||||
],
|
||||
),
|
||||
body: Column(
|
||||
|
||||
@@ -7,6 +7,7 @@ import '../services/offline_storage_service.dart';
|
||||
import '../services/log_service.dart';
|
||||
import '../services/preferences_service.dart';
|
||||
import '../services/user_service.dart';
|
||||
import 'log_viewer_screen.dart';
|
||||
|
||||
class SettingsScreen extends StatefulWidget {
|
||||
const SettingsScreen({super.key});
|
||||
@@ -354,6 +355,22 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||
onTap: () => _launchContactUrl(context),
|
||||
),
|
||||
|
||||
Semantics(
|
||||
label: 'Open debug logs',
|
||||
button: true,
|
||||
child: ListTile(
|
||||
leading: const Icon(Icons.bug_report),
|
||||
title: const Text('Debug Logs'),
|
||||
subtitle: const Text('View app diagnostic logs'),
|
||||
onTap: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => const LogViewerScreen()),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
|
||||
const Divider(),
|
||||
|
||||
// Display Settings Section
|
||||
|
||||
Reference in New Issue
Block a user