BarcodeItems.lines constructor

BarcodeItems.lines(
  1. String text, {
  2. bool unique = false,
})

One item a line of text: lines end with \n, \r\n or \r. Each line is trimmed of spaces; empty lines are left out. With unique, an item that came before is left out too.

BarcodeItems.lines(' A1 \r\nB2\n\nA1', unique: true); // [A1, B2]

Implementation

factory BarcodeItems.lines(String text, {bool unique = false}) =>
    BarcodeItems._(
      _collect(_withoutBom(text).split(_lineBreak), unique: unique),
    );