import 'package:flutter/material.dart';
import '../dados_grafico.dart'; // Ajusta o caminho se der erro de import

class PieChartController extends ChangeNotifier {
  PieChartData _chartData = const PieChartData(victories: 0, defeats: 0, draws: 0);
  
  PieChartData get chartData => _chartData;
  
  void updateData({int? victories, int? defeats, int? draws}) {
    _chartData = PieChartData(
      victories: victories ?? _chartData.victories,
      defeats: defeats ?? _chartData.defeats,
      draws: draws ?? _chartData.draws, // 👇 AGORA ELE ACEITA OS EMPATES
    );
    notifyListeners();
  }
  
  void reset() {
    updateData(victories: 0, defeats: 0, draws: 0);
  }
}