-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Description
I would like to create a PWA app that's offline available.
To test this feature I have enabled web support flutter config --enable-web, created a default demo app using flutter create pwatest and made it available on my phone through my local network with flutter run -d chrome web-hostname=192.168.43.59 --web-port=80. I succesfully load the webapp on my mobile, 'add to home screen', and open the PWA-app.
Issue: when I tap open my PWA-app on the homescreen, it tries to connect to my local flutter server (192.168.43.59) and cannot find it (which is correct, because it is now offline). When I turn off my phone internet, it just shows a default 'Flutter Demo' screen. Hence, my app is not offline available.
Is this expected behavior and how do I make my PWA app offline available?
Flutter doctor:
[√] Flutter (Channel beta, 1.19.0-4.1.pre, on Microsoft Windows [Version 10.0.18363.900], locale nl-NL)
• Flutter version 1.19.0-4.1.pre at C:\src\flutter
• Framework revision f994b76974 (13 days ago), 2020-06-09 15:53:13 -0700
• Engine revision 9a28c3bcf4
• Dart version 2.9.0 (build 2.9.0-14.1.beta)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\Users\matre\AppData\Local\Android\sdk
• Platform android-29, build-tools 29.0.2
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
[√] Android Studio (version 3.5)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 42.1.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
[√] VS Code (version 1.46.1)
• VS Code at C:\Users\matre\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.11.0
[√] Connected device (2 available)
• Web Server • web-server • web-javascript • Flutter Tools
• Chrome • chrome • web-javascript • Google Chrome 83.0.4103.106
• No issues found!