splitByLength static method
ccreate offset for tl
Implementation
static List<String> splitByLength(
String text,
int length, {
bool ignoreEmpty = false,
}) {
final List<String> pieces = [];
for (int i = 0; i < text.length; i += length) {
final int offset = i + length;
String piece = text.substring(
i,
offset >= text.length ? text.length : offset,
);
if (ignoreEmpty) {
piece = piece.replaceAll(RegExp(r'\s+'), '');
}
pieces.add(piece);
}
return pieces;
}