import 'package:flutter/material.dart';

import 'panel_toggle_affordance.dart';

class FitButton extends StatelessWidget {
  final BoxFit currentFit;
  final bool isPanelOpen;
  final VoidCallback onTogglePanel;

  const FitButton({
    super.key,
    required this.currentFit,
    required this.isPanelOpen,
    required this.onTogglePanel,
  });

  static const options = [
    (fit: BoxFit.contain, label: '适应屏幕', subtitle: 'Contain'),
    (fit: BoxFit.fill, label: '拉伸', subtitle: 'Stretch'),
    (fit: BoxFit.cover, label: '裁剪', subtitle: 'Crop'),
  ];

  @override
  Widget build(BuildContext context) {
    return PanelToggleAffordance(
      isOpen: isPanelOpen,
      onTap: onTogglePanel,
      tooltip: '画面比例',
      child: const Icon(Icons.aspect_ratio, color: Colors.white, size: 28),
    );
  }
}
