CanvasTerminal constructor

CanvasTerminal(
  1. int width,
  2. int height,
  3. Font font, [
  4. CanvasElement? canvas,
])

Implementation

factory CanvasTerminal(int width, int height, Font font,
    [html.CanvasElement? canvas]) {
  var display = Display(width, height);

  // If not given a canvas, create one and add it to the page.
  if (canvas == null) {
    canvas = html.CanvasElement();
    html.document.body!.append(canvas);
  }

  return CanvasTerminal._(display, font, canvas);
}