NotebookEntry constructor
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,
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,
);
}