Skip to content

Commit 57b6173

Browse files
committed
[desktop_webview_window] add windows userDataFolderWindows attention to README
1 parent dca815a commit 57b6173

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

packages/desktop_webview_window/README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,15 @@ Show a webview window on your flutter desktop application.
3737
webview.launch("https://example.com");
3838
```
3939

40-
### **linux requirement**
40+
## linux requirement
4141

4242
```shell
4343
sudo apt-get install webkit2gtk-4.1
4444
```
4545

46-
### **Windows requirement**
46+
## Windows
47+
48+
### Requirement
4749

4850
The backend of desktop_webview_window on Windows is WebView2, which requires **WebView2 Runtime** installed.
4951

@@ -54,6 +56,22 @@ See more: https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/dist
5456

5557
For convenience, you can use `WebviewWindow.isWebviewAvailable()` check whether the WebView2 is available.
5658

59+
### Attention
60+
61+
The default user data folder of WebView2 is `your_exe_file\WebView2`, which is not a good place to store user data.
62+
63+
eg. if the application is installed in a read-only directory, the application will crash when WebView2 try to write data.
64+
65+
you can use `WebviewWindow.create()` to create a webview with a custom user data folder.
66+
67+
```dart
68+
final webview = await WebviewWindow.create(
69+
confiruation: CreateConfiguration(
70+
userDataFolderWindows: 'your_custom_user_data_folder',
71+
),
72+
);
73+
```
74+
5775
## License
5876

5977
see [LICENSE](./LICENSE)

0 commit comments

Comments
 (0)