No, it's not a virus. Those move from one device to another on their own. You installed it, which makes it a Trojan. A Trojan is software that cannot get on your computer without your help.
What you installed was adware, as evidenced by the sudden proliferation of ads falsely claiming your computer is infected. Which is baloney to start with since there are no viruses that can affect macOS.
If Flash is already installed, you can update it, or check to see if there are updates in the System Preferences as Carolyn noted. If you don't have Flash installed, the one and only place to ever get it is directly from Adobe. Any popup - literally, any - that tells you to download a Flash, Java, codec or other nonsense directly from them is a scam.
You can try to find the installed adware and remove it yourself, but some of it has gotten very difficult to find and remove. Download and run MalwareBytes for Mac. It's main purpose is to find and removing adware, and other unwanted software.