Who invented the nation flag of Portugal?

The shield on the flag was adopted by Afonso Henriques I after he defeated the Moors. The red and green colors where voted. The Portuguese people had two choices, the blue and white colors which were the original colors of the Monarchy, or the red and green colors that represent the Republican party.