input: Write a python function to check the winner in a TicTacToe game.
  assert env.check_winner() == None
  env.state = ['X', 'X', 'X', ' ', ' ', ' ', ' ', ' ', ' ']
  assert env.check_winner() == 'X'
  env.state = ['O', 'O', 'O', ' ', ' ', ' ', ' ', ' ', ' ']
  assert env.check_winner() == 'O'
  env.state = ['X', ' ', ' ', 'X', ' ', ' ', 'X', ' ', ' ']
  assert env.check_winner() == 'X'
  env.state = [' ', 'O', ' ', ' ', 'O', ' ', ' ', 'O', ' ']
  assert env.check_winner() == 'O'
  env.state = [' ', ' ', 'O', ' ', 'O', ' ', 'O', ' ', ' ']
  assert env.check_winner() == 'O'
output: def check_winner(self):
      # Define the possible winning combinations
      winning_combinations = [
          [0, 1, 2], [3, 4, 5], [6, 7, 8],  # Rows
          [0, 3, 6], [1, 4, 7], [2, 5, 8],  # Columns
          [0, 4, 8], [2, 4, 6]              # Diagonals
      ]
      
      for combo in winning_combinations:
          if self.state[combo[0]] == self.state[combo[1]] == self.state[combo[2]] != ' ':
              return self.state[combo[0]]
      
      return None