Praise be to Allah, the Lord of the Worlds; and may His blessings and peace be upon our Prophet Muhammad and upon all his Family and Companions.
Flu is not an excuse for not joining congregational prayers, fearing that it could cause harm to other people. A person who has flu does not necessarily harm other people except if he has a very severe flu and an unpleasant smell, or that this flu is indeed contagious.
The law-maker forbade whoever eats garlic or onion to go to the mosque because that causes harm to the people in the mosque. The same thing applies to anybody who has a bad smell which harms the people who pray and the angels.
The Prophet (Sallallahu Alaihi wa Sallam) said: "Whoever eats garlic should not come to the mosque until its smell is over." Reported by Bukari and Muslim.
In the narration reported by Muslim "The angels are harmed by that which harms human beings."
A contagious illness indeed harms the people in the mosque. The Fuqaha stated that the lepers should not attend congregational prayers because they may infect other people.
Al-Dardeer, a scholar from the Maliki school of thought, stated when mentioning the disliked characteristics of an Imam: "And the 'leper', i.e. affected by leprosy, 'if he is severely affected' to an extent that he causes harm to other people, then he should be dismissed by obligation from the position of an Imam and from the community."
Al-Dusooqi said commenting on the above: "If he refuses, he will be removed from his position by force, in order to prevent harm."
It is only doctors who could determine whether the flu you are affected with is contagious or not.
Allah knows best.