createCanvasElement function
- @Deprecated('Use the HTMLCanvasElement constructor instead.')
Create an HTMLCanvasElement in the current document.
Deprecated in favor of creating the element like other HTML elements:
final canvas = document.createElement('canvas') as HTMLCanvasElement
..width = 256
..height = 256;
Implementation
@Deprecated('Use the HTMLCanvasElement constructor instead.')
HTMLCanvasElement createCanvasElement({int? width, int? height}) {
final result = document.createElement('canvas') as HTMLCanvasElement;
if (width != null) result.width = width;
if (height != null) result.height = height;
return result;
}