Flockhart had joined John Duncan (also from Kinrosshire, who was 28 years his senior), as a partner in 1833, having started as an apprentice surgeon-apothecary and qualifying as a licenciate of the Royal College of Surgeons Edinburgh in 1830, when he was 22 years old. He did not practise as a surgeon, but with Duncan, worked closely with other doctors in Edinburgh on experimental drugs, which they then refined to improve in purity, following the medical experiments results. They were both among the nine founder members of the Northern British Branch of the Pharmaceutical Society (in 1841) and joined the Edinburgh Merchant Company. The second annual dinner of the Pharmaceutical Society included a toast to strangers present by Flockhart, and three years later he was elected president. In his inaugural speech he highlighted the issues on unregulated production, of poisons for example, and the risks from a lack of quality controls, and thus he proposed a Universal Phamacopoeia for Great Britain'. In December 1861, Flockhart was also elected to the Edinburgh Chamber of Commerce.
Duncan and Flockhart had premises at 52 North Bridge, Edinburgh (now the Balmoral Hotel) which has a plaque to the pharmacists, dedicated 1981,  by the International Association for the Study of Pain.
The retail pharmacy business under Flockhart's management flourished and another branch at 139 Princes Street, Edinburgh opened in 1846. From 1855 to 1865, Flockhart managed the business and it moved to 6 North Bridge.  Duncan, Flockhart and Company manufacturing partnership later extended to a factory at 1 Constitution Street, Leith. When Duncan died, Flockhart continued to partner with his son Doctor James Duncan, and the firm extended rapidly and grew its business on the back of the growing demand for chloroform and other drugs or analgesics.
Flockhart died at Annacroich, after sudden onset of severe stomach pains, although medical colleagues came from Edinburgh to his aid, in August 1871, aged 62, and was buried at Warriston Cemetery, Edinburgh, near to where James Young Simpson is also buried. His death announcement appeared in the Stonehaven Journal.
His son (also) William Flockhart took over the business of Duncan, Flockhart and Company Limited with James Duncan and he lived at 4 Gayfield Square, Edinburgh. The chemist company that Duncan and Flockhart had begun continued to operate in various forms in North Bridge, Edinburgh up until 1976, and later merged into large international pharma companies.