  import 'package:flutter/material.dart';
  import 'package:playmaker/grafico%20de%20pizza/dados_grafico.dart';

  class PieChartController extends ChangeNotifier {
    PieChartData _chartData = PieChartData(victories: 25, defeats: 10);
    
    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 incrementVictories() {
      updateData(victories: _chartData.victories + 1);
    }
    
    void incrementDefeats() {
      updateData(defeats: _chartData.defeats + 1);
    }
    
    void reset() {
      updateData(victories: 0, defeats: 0, draws: 0);
    }
  }