Energy flow is unidirectional because energy flows from one trophic level to the next higher one and when there is energy flow, some energy is always lost as heat at each step.
Energy flow is linear / unidirectional in an ecosystem because:-

Only 1% of solar energy falling on leaves of producers get converted into food energy through photosynthesis and is made available to the next tropic level of consumers.

After consumers eat producers a lot of energy is lost to the environment in the form of heat. Energy used is also used by the consumer for digestion, growth, reproduction and other activities.

Only 10% of energy is turned into into its own body and is made available for the next level of consumers[10% Law]

Once energy is taken up by producers from solar energy it cannot be reverted back into solar energy.

Once energy enters a trophic level, it is then not available to the previous trophic level. So little energy is available after every trophic level, and the energy can only go to a higher consumer and not previous consumer.

Solar Energy ⇒ Grass ⇒ Deer ⇒ Lion / Tiger.

Thank you.....!!!!
Mark as brainliest of helpful..
Yours, Jahnavi.