canvaskit

How to use Skia / CanvasKit in Flutter Web?

自闭症网瘾萝莉.ら 提交于 2021-02-18 05:33:32
问题 I know that Flutter supports using Skia instead of DomCanvas in Flutter Web using WASM CanvasKit, i.e. "Skia + WebAssembly". I have heard that this provides significant performance improvements, however, I do not know how to enable it. 回答1: You can enable CanvasKit / Skia in Flutter Web by supplying a Dart environment constant: flutter run -d chrome --dart-define=FLUTTER_WEB_USE_SKIA=true The flutter tools now have a good shortcut for it: flutter run -d chrome --web-renderer canvaskit The -