input: Write a function to identify the most common fruit in a given list of fruit names. The function should return the name of the fruit that appears most frequently in the list. If there are multiple fruits with the same highest frequency, return the first one found. If the list is empty, return None.
  
  def most_common_fruit(fruit_list):
      if not fruit_list:
          return None
      
      freq_dict = {}
      
      for fruit in fruit_list:
          if fruit in freq_dict:
              freq_dict[fruit] += 1
          else:
              freq_dict[fruit] = 1
              
      max_freq = max(freq_dict.values())
      
      for fruit in fruit_list:
          if freq_dict[fruit] == max_freq:
              return fruit
  
  assert most_common_fruit(['Apple', 'Orange', 'Apple', 'Pineapple', 'Grape', 'Apple'])=='Apple'
  assert most_common_fruit(['Orange', 'Apple', 'Pineapple', 'Grape', 'Apple'])=='Apple'
  assert most_common_fruit(['Pineapple', 'Grape', 'Orange', 'Apple'])=='Pineapple'
  assert most_common_fruit([])==None
output: def most_common_fruit(fruit_list):
      if not fruit_list:
          return None
      
      freq_dict = {}
      
      for fruit in fruit_list:
          if fruit in freq_dict:
              freq_dict[fruit] += 1
          else:
              freq_dict[fruit] = 1
              
      max_freq = max(freq_dict.values())
      
      for fruit in fruit_list:
          if freq_dict[fruit] == max_freq:
              return fruit