@@ -7,25 +7,25 @@ When running and building apps for the web, you can choose between two different
7
7
renderers. This page describes both renderers and how to choose the best one for
8
8
your needs. The two renderers are:
9
9
10
- ** HTML renderer**
11
- : This renderer, which has a smaller download size than the CanvasKit renderer, uses a combination of
12
- HTML elements, CSS, Canvas elements, and SVG elements.
13
-
14
10
** CanvasKit renderer**
15
11
: This renderer is fully consistent with Flutter mobile and desktop, has faster
16
12
performance with higher widget density, but adds about 1.5MB in download size.
17
13
[ CanvasKit] [ canvaskit ] uses WebGL to render Skia paint commands.
18
14
15
+ ** HTML renderer**
16
+ : This renderer, which has a smaller download size than the CanvasKit renderer, uses a combination of
17
+ HTML elements, CSS, Canvas elements, and SVG elements.
18
+
19
19
## Command line options
20
20
21
- The ` --web-renderer ` command line option takes one of three values, ` auto ` ,
22
- ` html ` , or ` canvaskit ` .
21
+ The ` --web-renderer ` command line option takes one of three values, ` canvaskit ` ,
22
+ ` html ` , or ` auto ` .
23
23
24
- * ` auto ` (default) - automatically chooses which renderer to use. This option
24
+ * ` canvaskit ` (default) - always use the CanvasKit renderer
25
+ * ` html ` - always use the HTML renderer
26
+ * ` auto ` - automatically chooses which renderer to use. This option
25
27
chooses the HTML renderer when the app is running in a mobile browser, and
26
28
CanvasKit renderer when the app is running in a desktop browser.
27
- * ` html ` - always use the HTML renderer
28
- * ` canvaskit ` - always use the CanvasKit renderer
29
29
30
30
This flag can be used with the ` run ` or ` build ` subcommands. For example:
31
31
@@ -86,33 +86,33 @@ check out [Customizing web app initialization][web-app-init].
86
86
87
87
## Choosing which option to use
88
88
89
- Choose the ` auto ` option (default) if you are optimizing for download size on
90
- mobile browsers and optimizing for performance on desktop browsers.
89
+ Choose the ` canvaskit ` option (default) if you are prioritizing performance and
90
+ pixel-perfect consistency on both desktop and mobile browsers.
91
91
92
92
Choose the ` html ` option if you are optimizing download size over performance on
93
93
both desktop and mobile browsers.
94
94
95
- Choose the ` canvaskit ` option if you are prioritizing performance and
96
- pixel-perfect consistency on both desktop and mobile browsers.
95
+ Choose the ` auto ` option if you are optimizing for download size on
96
+ mobile browsers and optimizing for performance on desktop browsers.
97
97
98
98
## Examples
99
99
100
- Run in Chrome using the default renderer option (` auto ` ):
100
+ Run in Chrome using the default renderer option (` canvaskit ` ):
101
101
102
102
``` console
103
103
flutter run -d chrome
104
104
```
105
105
106
- Build your app in release mode, using the default (auto ) option:
106
+ Build your app in release mode, using the default (` canvaskit ` ) option:
107
107
108
108
``` console
109
109
flutter build web --release
110
110
```
111
111
112
- Build your app in release mode, using just the CanvasKit renderer:
112
+ Build your app in release mode, using the ` auto ` renderer option :
113
113
114
114
``` console
115
- flutter build web --web-renderer canvaskit --release
115
+ flutter build web --web-renderer auto --release
116
116
```
117
117
118
118
Run your app in profile mode using the HTML renderer:
0 commit comments