Refactor SettingsScreen and SearchAppBar: remove unused menu logic and enhance navigation features
This commit is contained in:
@@ -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),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user