72 lines
1.7 KiB
Dart
72 lines
1.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class MenuDrawer extends StatelessWidget {
|
|
const MenuDrawer({
|
|
super.key,
|
|
this.onMenuItemTapped,
|
|
});
|
|
|
|
final ValueChanged<String>? onMenuItemTapped;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
decoration: const BoxDecoration(
|
|
color: Color.fromARGB(255, 30, 31, 35),
|
|
border: Border(
|
|
right: BorderSide(color: Colors.white12, width: 0.5),
|
|
),
|
|
),
|
|
child: Column(
|
|
children: [
|
|
_MenuItemTile(
|
|
icon: Icons.note,
|
|
label: 'Todas mis notas',
|
|
onTap: () => onMenuItemTapped?.call('all_notes'),
|
|
),
|
|
Expanded(
|
|
child: SingleChildScrollView(
|
|
child: Column(
|
|
children: const [
|
|
SizedBox.shrink(),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
const Divider(color: Colors.white12, height: 16),
|
|
_MenuItemTile(
|
|
icon: Icons.settings,
|
|
label: 'Configuración',
|
|
onTap: () => onMenuItemTapped?.call('settings'),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class _MenuItemTile extends StatelessWidget {
|
|
const _MenuItemTile({
|
|
required this.icon,
|
|
required this.label,
|
|
this.onTap,
|
|
});
|
|
|
|
final IconData icon;
|
|
final String label;
|
|
final VoidCallback? onTap;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ListTile(
|
|
leading: Icon(icon, color: Colors.white70),
|
|
title: Text(
|
|
label,
|
|
style: const TextStyle(color: Colors.white70, fontSize: 14),
|
|
),
|
|
onTap: onTap,
|
|
hoverColor: Colors.white.withValues(alpha: 0.1),
|
|
);
|
|
}
|
|
}
|