Media playback is not supported on this device
The 36-year-old led her team to a first Olympic gold medal as they beat defending champions the Netherlands in a penalty shootout.
"If you could write a movie script with a fairytale ending then this would be it," said the four-time Olympian.
The ceremony was held in wind and rain at the Maracana Stadium on Sunday.
Andy Murray, who won gold in the men's tennis, carried the British flag at the opening ceremony.
Britain finished second in the medal table ahead of China, with their best medal return at any Games since 1908.
It is also the first time since the modern Olympic era began in 1896 that a country has increased its medal tally at the summer Games immediately following one it hosted.
Subscribe to the BBC Sport newsletter to get our pick of news, features and video sent to your inbox.
Women's hockey captain Kate Richardson-Walsh carried the flag for Great Britain at the closing ceremony of the Rio 2016 Olympics.