Last updated:
0 purchases
renderer switcher
renderer_switcher #
Swap Web Renderers in a Flutter Web app at runtime.
Installation #
To use this plugin, add renderer_switcher as a dependency in your pubspec.yaml file.
Then, add this script to the top of the body in your web/index.html file.
<script type="text/javascript">
window.flutterWebRenderer = localStorage.getItem('flutterWebRenderer');
</script>
copied to clipboard
Usage #
// Returns WebRenderer.html, WebRenderer.canvaskit or WebRenderer.auto
final currentRenderer = await RendererSwitcher.getCurrentWebRenderer();
if(currentRenderer == WebRenderer.canvaskit){
// Switches web renderer to canvaskit and reloads the window.
RendererSwitcher.switchWebRenderer(WebRenderer.auto);
}
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.