Not Compatible on Web
offnewman opened this issue · comments
Love this package and the web tag got me excited, however -
renderObject.toImage(pixelRatio: pixelRatio);
doesn't work on web atm.
anyone else got this working ?
Otherwise will fork and send PR back
Error is:
org-dartlang-sdk:///flutter_web_sdk/lib/_engine/engine/html/scene_builder.dart:92:16
matrix4[0] == window.devicePixelRatio &&
matrix4[5] == window.devicePixelRatio
is not true
at Object.throw_ [as throw] (http://localhost:63054/dart_sdk.js:4339:11)
at Object.assertFailed (http://localhost:63054/dart_sdk.js:4282:15)
at _engine.SurfaceSceneBuilder.new.pushTransform
(http://localhost:63054/dart_sdk.js:156899:133)
at layer$.OffsetLayer.new.toImage
(http://localhost:63054/packages/flutter/src/rendering/layer.dart.lib.js:1631:17)
at toImage.next (<anonymous>)
at runBody (http://localhost:63054/dart_sdk.js:37699:34)
at Object._async [as async] (http://localhost:63054/dart_sdk.js:37730:7)
at layer$.OffsetLayer.new.toImage
(http://localhost:63054/packages/flutter/src/rendering/layer.dart.lib.js:1625:20)
at proxy_box.RenderRepaintBoundary.new.toImage
(http://localhost:63054/packages/flutter/src/rendering/proxy_box.dart.lib.js:3222:26)
at screenshot.ScreenshotController.new.<anonymous>
(http://localhost:63054/packages/feedback/src/screenshot.dart.lib.js:82:43)
at Generator.next (<anonymous>)
at runBody (http://localhost:63054/dart_sdk.js:37699:34)
at Object._async [as async] (http://localhost:63054/dart_sdk.js:37730:7)
at http://localhost:63054/packages/feedback/src/screenshot.dart.lib.js:79:70
at http://localhost:63054/dart_sdk.js:32076:33
at internalCallback (http://localhost:63054/dart_sdk.js:23835:11)
Has anyone of you tried this with flutter build web --web-renderer canvaskit
?
I could imagine that it will work, but I haven't tried it, as I am not a user of Flutter for web.
See https://flutter.dev/docs/development/tools/web-renderers for further details.
Flutter for Web is supported in version 1.1.0.