measureText method

int measureText(
  1. CanvasRenderingContext2D ctx,
  2. String text
)

Implementation

int measureText(CanvasRenderingContext2D ctx, String text) {
  return (ctx.measureText(text).width)!.round();
}