I am developing a web application using Flet and am facing challenges: Offline Operation with CanvasKit Renderer: I would like to operate my web application in a completely offline environment. However, when I use the CanvasKit renderer, it attempts to download canvaskit.js and Roboto fonts from the internet, preventing the startup screen from launching. Is there a way to avoid these downloads and run the application fully offline?
I tried to run the fullter offline on the following page, but could not apply it with flet.
I had the same problem. When there is no network, meaning neither a hotspot created by the device nor a connection to a router, it can be resolved by placing the relevant files into an assets folder. Depending on the file type, additional subfolders may need to be created, such as fonts. Flet will then use the files from these folders.
Structure example for the folders:
assets
fonts
myFontName
myFont.ttf
canvaskit
myCanvasKit.js
However, in my case, when a hotspot is created by the device (which is not connected to the internet), it no longer works. I would appreciate a better solution for this scenario.
I solved that issue by set environment variable FLET_WEB_RENDERER to html and included the default font via page.fonts(). However, with this solution i can not use canvaskit.