Remove unused categoryKeys
This commit is contained in:
@@ -23,20 +23,10 @@ class AIScribeMenu extends StatefulWidget {
|
|||||||
|
|
||||||
class _AIScribeMenuContentState extends State<AIScribeMenu> {
|
class _AIScribeMenuContentState extends State<AIScribeMenu> {
|
||||||
AIScribeMenuCategory? _hoveredCategory;
|
AIScribeMenuCategory? _hoveredCategory;
|
||||||
final Map<AIScribeMenuCategory, GlobalKey> _categoryKeys = {};
|
|
||||||
final GlobalKey _menuKey = GlobalKey();
|
final GlobalKey _menuKey = GlobalKey();
|
||||||
OverlayEntry? _submenuOverlay;
|
OverlayEntry? _submenuOverlay;
|
||||||
Timer? _closeTimer;
|
Timer? _closeTimer;
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
final categories = widget.availableCategories ?? AIScribeMenuCategory.values;
|
|
||||||
for (final category in categories) {
|
|
||||||
_categoryKeys[category] = GlobalKey();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_closeTimer?.cancel();
|
_closeTimer?.cancel();
|
||||||
@@ -119,16 +109,13 @@ class _AIScribeMenuContentState extends State<AIScribeMenu> {
|
|||||||
key: _menuKey,
|
key: _menuKey,
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: categories.map((category) {
|
children: categories.map(_buildCategoryItem).toList(),
|
||||||
return _buildCategoryItem(category);
|
|
||||||
}).toList(),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildCategoryItem(AIScribeMenuCategory category) {
|
Widget _buildCategoryItem(AIScribeMenuCategory category) {
|
||||||
if (category.hasSubmenu) {
|
if (category.hasSubmenu) {
|
||||||
return Container(
|
return Container(
|
||||||
key: _categoryKeys[category],
|
|
||||||
child: _buildMenuItem(
|
child: _buildMenuItem(
|
||||||
label: category.getLabel(context),
|
label: category.getLabel(context),
|
||||||
hasSubmenu: true,
|
hasSubmenu: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user