Refactor SettingsScreen and SearchAppBar: remove unused menu logic and enhance navigation features

This commit is contained in:
2026-05-14 16:39:48 +02:00
parent 94fdfe51eb
commit ca8399dbc9
2 changed files with 35 additions and 122 deletions
+9 -4
View File
@@ -4,6 +4,9 @@ class SearchAppBar extends StatefulWidget {
const SearchAppBar({
super.key,
this.onMenuPressed,
this.onLeadingPressed,
this.leadingIcon = Icons.menu,
this.leadingTooltip = 'Menú',
this.onSearchChanged,
this.searchHint = 'Buscar notas...',
this.showSearch = true,
@@ -11,6 +14,9 @@ class SearchAppBar extends StatefulWidget {
});
final VoidCallback? onMenuPressed;
final VoidCallback? onLeadingPressed;
final IconData leadingIcon;
final String leadingTooltip;
final ValueChanged<String>? onSearchChanged;
final String searchHint;
final bool showSearch;
@@ -50,11 +56,10 @@ class _SearchAppBarState extends State<SearchAppBar> {
padding: const EdgeInsets.only(left: 16, right: 16, top: 7, bottom: 7),
child: Row(
children: [
// Menu button (fixed on left)
IconButton(
onPressed: widget.onMenuPressed,
icon: const Icon(Icons.menu, color: Colors.white70, size: 20),
tooltip: 'Menú',
onPressed: widget.onLeadingPressed ?? widget.onMenuPressed,
icon: Icon(widget.leadingIcon, color: Colors.white70, size: 20),
tooltip: widget.leadingTooltip,
splashRadius: 18,
constraints: const BoxConstraints(minWidth: 40, minHeight: 40),
),