width method
Columns s takes when drawn (Canvas.text) with this segmenter: as
stringWidth measures it in mode, East Asian Ambiguous characters
ambiguousWidth columns each. Layout that measures with the
segmenter of the canvas (PipelineOwner.segmenter) gets the columns
the terminal draws, │ and … two of them where it takes those as
wide.
print(TextSegmenter().width('a │ b')); // 5
print(TextSegmenter(ambiguousWidth: 2).width('a │ b')); // 6
Implementation
int width(String s) => _columns(this, s);