TextBlock.fromTextBlock constructor

TextBlock.fromTextBlock(
  1. TextBlock textBlock,
  2. Size imageSize
)

Returns an instance of TextBlock from a given textBlock.

Implementation

factory TextBlock.fromTextBlock(
  ml_kit.TextBlock textBlock,
  Size imageSize,
) {
  List<TextLine> lines = [];
  for (var line in textBlock.lines) {
    lines.add(TextLine.fromTextLine(
      line,
      imageSize,
    ));
  }
  return TextBlock(
    lines: lines,
  );
}