I want to run flutter method channel every 5 seconds even if app is closed so what I should do?
Depending on the operating system, you can create a background service that periodically calls your MethodChannel. Check this out for Android.
Also, this use case has a straightforward plugin.
Note: on iOS, you can't just call a task always in the background. The App will be suspended 40 seconds after the user goes out of it. There are specific scenarios, e. g. Push notifications where your App will become active, but these are "one time" events and not something you can do every 5 seconds. And if the user completely closes your App, your 5 second scheduler will be killed, no matter what.