import 'package:flutter/material.dart';
import '../dados_grafico.dart'; 

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, 
    );
    notifyListeners();
  }
  
  void reset() {
    updateData(victories: 0, defeats: 0, draws: 0);
  }
}