NotebookStyle class

An immutable description of notebook ruling and margins: how the hand-drawn rules look, how far apart they sit, and where content may be written between the page edges.

A NotebookStyle carries these values only. It performs no painting, layout, or widget building — it exists to bundle the values, validate them, and support comparison and overriding via copyWith and value equality.

lineHeight is the row height: the vertical distance from one rule to the next, and the unit content is laid onto. leadingMargin and trailingMargin bound where content is written on each row; the rules are unaffected by them and span the full width beneath. Every other property describes the appearance of the hand-drawn rules.

const style = NotebookStyle(lineHeight: 32, leadingMargin: 24);
final bolder = style.copyWith(strokeWidth: 2.0);
Annotations

Constructors

NotebookStyle({double lineHeight = HandDrawnDefaults.notebookLineHeight, Color lineColor = HandDrawnDefaults.notebookLineColor, double strokeWidth = HandDrawnDefaults.notebookStrokeWidth, int seed = HandDrawnDefaults.seed, bool uniformLines = true, double irregularity = HandDrawnDefaults.notebookIrregularity, int segments = HandDrawnDefaults.notebookSegments, double leadingMargin = HandDrawnDefaults.notebookLeadingMargin, double trailingMargin = HandDrawnDefaults.notebookTrailingMargin})
Creates a notebook style.
const

Properties

hashCode int
The hash code for this object.
no setteroverride
irregularity double
The roughness of the hand-drawn wobble on each ruled line.
final
leadingMargin double
The distance from the leading edge at which content begins, in logical pixels.
final
lineColor Color
The color of the ruled lines.
final
lineHeight double
The row height: the vertical distance between consecutive rules, in logical pixels.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
seed int
The base random seed for deterministic line generation.
final
segments int
The number of linear segments used to draw each ruled line.
final
strokeWidth double
The width of each ruled line stroke in logical pixels.
final
trailingMargin double
The distance from the trailing edge before which content wraps, in logical pixels.
final
uniformLines bool
Whether every ruled line should look identical.
final

Methods

copyWith({double? lineHeight, Color? lineColor, double? strokeWidth, int? seed, bool? uniformLines, double? irregularity, int? segments, double? leadingMargin, double? trailingMargin}) NotebookStyle
Returns a copy of this style with the given fields replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override