NotebookEntry constructor

NotebookEntry({
  1. required List<Object> children,
  2. Key? key,
  3. NotebookStyle? style,
  4. NotebookFit fit = NotebookFit.scaleDown,
  5. double scaleDownContentFraction = _kScaleDownContentFraction,
  6. TextAlignVertical textAlignVertical = TextAlignVertical.center,
  7. int minRows = 1,
  8. bool wrap = true,
  9. TextDirection? direction,
})

Creates a notebook entry from a run of mixed children.

Each element must be a String, a NotebookSpan, or a Widget; any other type throws an ArgumentError. minRows must be at least 1.

Implementation

factory NotebookEntry({
  required List<Object> children,
  Key? key,
  NotebookStyle? style,
  NotebookFit fit = NotebookFit.scaleDown,
  double scaleDownContentFraction = _kScaleDownContentFraction,
  TextAlignVertical textAlignVertical = TextAlignVertical.center,
  int minRows = 1,
  bool wrap = true,
  TextDirection? direction,
}) {
  assert(
    scaleDownContentFraction > 0 && scaleDownContentFraction <= 1,
    'scaleDownContentFraction must be in the range (0, 1].',
  );
  final content = _NotebookContent.parse(children);
  return NotebookEntry._(
    key: key,
    pieces: content.pieces,
    style: style,
    fit: fit,
    scaleDownContentFraction: scaleDownContentFraction,
    textAlignVertical: textAlignVertical,
    minRows: minRows,
    wrap: wrap,
    direction: direction,
    children: content.widgets,
  );
}