You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This demo illustrates the JSRuntime management in WebF with different threading modes. There are three threading models:
4
4
5
-
## Getting Started
5
+
1. Flutter UI Thread.
6
+
2. Different dedicated Thread (Different Dedicated threads are used for different WebFPage).
7
+
3. Same dedicated Thread (Same Dedicated threads are used for different WebFPage).
6
8
7
-
This project is a starting point for a Flutter application.
9
+
For more information about `Dedicated Thread Mode`, see the [documentation](https://openwebf.com/docs/tutorials/performance_optimization/multiple_thread_mode/#sharing-a-single-thread-across-multiple-webf-instances).
8
10
9
-
A few resources to get you started if this is your first Flutter project:
11
+
And the demo can test two ways to launch a new FlutterEngine:
10
12
11
-
-[Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
1. Create a FlutterEngine using FlutterEngineGroup.
14
+
2. Create a FlutterEngine directly.
13
15
14
-
For help getting started with Flutter development, view the
15
-
[online documentation](https://docs.flutter.dev/), which offers tutorials,
16
-
samples, guidance on mobile development, and a full API reference.
16
+
17
+
# How to use
18
+
19
+
Just run it like a normal flutter project.
20
+
21
+
# How to debug
22
+
23
+
1. Change the webf dependency in `pubspec.yaml` to a local path.
24
+
2. View the creation and destruction logs of JSRuntime on different threads. (Refer to [the test code](https://github.com/openwebf/webf/commit/1b30372558b4b7d4556a0451618dbf3e2250955e))
25
+
26
+
If we use the webf test code above, interact with the test page as follows:
27
+
28
+
1. On the home page click the button "FlutterEngineGroup (supported iOS/Android) ".
29
+
2. Click the button "Different dedicated thread" on the new page.
30
+
3. The Webf test page loads successfully Back to the home page.
31
+
32
+
We can see the following Log:
33
+
34
+
35
+
```
36
+
[JSRuntime Lifecycle] threadId 0x16c8e3000 DartIsolateContext construction
37
+
[JSRuntime Lifecycle] threadId 0x3090cb000 InitializeJSRuntime Begin
0 commit comments