Since you have mentioned, you already tried the solutions from this post, here's something I think you can try because I was facing this same problem once and this is what I was missing, and it's overlooked a lot of times.
If you are a Windows user, check your Network and sharing settings, and turn it ON for sharing on a private network. Something like this:

Also, make sure your IP address in the code below is correct (because IP address changes all the time when you connect your laptop/computer over Wi-Fi), so check the current IP by running ipconfig
in cmd right before running your code, not the one you wrote a week ago.
Few changes in the code:
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return "Hello World!"
if __name__ == "__main__":
#app.run(host='0.0.0.0',port=5000) //doesn't work for me
app.run(host='192.168.2.18', port=5000)
And finally, run your code with flask run -h 192.168.X.X
, in the screenshot you shared, you entered flask run --host 192.168.X.X
, I m not sure why, but --h doesn't work for me.
And, I hope you also check you are entering the address properly, like http://192.168.2.18:5000, not https.
Sometimes silly stuff can get in the way too :|