Enhance navigation and structure: integrate SettingsScreen into main app flow, update HomeScreen to open settings, and improve UI elements for better user experience.
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:notas/widgets/app_title_bar.dart';
|
||||
import 'package:notas/widgets/search_app_bar.dart';
|
||||
|
||||
class SettingsScreen extends StatefulWidget {
|
||||
const SettingsScreen({
|
||||
super.key,
|
||||
required this.onDeleteAllData,
|
||||
required this.onBackToHome,
|
||||
});
|
||||
|
||||
final Future<void> Function() onDeleteAllData;
|
||||
final VoidCallback onBackToHome;
|
||||
|
||||
@override
|
||||
State<SettingsScreen> createState() => _SettingsScreenState();
|
||||
@@ -44,8 +45,6 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Todos los datos locales han sido eliminados.')),
|
||||
);
|
||||
|
||||
Navigator.of(context).pop();
|
||||
} catch (error) {
|
||||
if (!mounted) return;
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
@@ -77,9 +76,8 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||
child: SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
const AppTitleBar(),
|
||||
SearchAppBar(
|
||||
onLeadingPressed: () => Navigator.of(context).pop(),
|
||||
onLeadingPressed: widget.onBackToHome,
|
||||
leadingIcon: Icons.arrow_back,
|
||||
leadingTooltip: 'Atrás',
|
||||
showSearch: false,
|
||||
|
||||
Reference in New Issue
Block a user