import 'package:flutter/foundation.dart';


class BalanceActionsUiController extends ChangeNotifier {
  int? _hoveredButtonIndex;

  int? get hoveredButtonIndex => _hoveredButtonIndex;

  bool isExpanded(int index) => _hoveredButtonIndex == index;

  void onHoverChanged(int index, bool hovered) {
    final next = hovered
        ? index
        : (_hoveredButtonIndex == index ? null : _hoveredButtonIndex);
    if (next == _hoveredButtonIndex) return;
    _hoveredButtonIndex = next;
    notifyListeners();
  }
}
