Above GitHub code is working well. Problem is before the app starts I turn off internet connection(mobile or wifi). but the output is showing Connected. After turn on the internet, showing Connected also and again turn off the internet showing Not-Connected. The first time is not the correct result after working well. How to fix this issue?
This how explains this code
https://stackoverflow.com/a/53855326/8822337
I used this GitHub code
https://github.com/dennmat/flutter-connectiontest-example