why dose current flows in the direction opposite to the flow of electrons?
It is a convention used since pre-industrial times and the origin of this convention cannot be pin pointed. It was widely accepted since then and is still in use today.
It probably came about as a result of physicists considering the positive terminal, which is at a higher potential, to be the source of current as electrons weren't discovered back then.