GptMarkdownStyleSheet class
Per-component appearance, in one object.
Pass it to GptMarkdown(styleSheet: ...) for a single widget, or to
GptMarkdownThemeData(styleSheet: ...) for the whole app. Values on the
widget win over the theme per field, so a widget that overrides one
thing keeps the theme's answer for everything else.
Every field of every style is optional, and anything still unset resolves to the value the package used before it was configurable — so adding a style sheet never changes how existing content looks.
GptMarkdown(
text,
styleSheet: const GptMarkdownStyleSheet(
blockQuote: BlockQuoteStyle(barWidth: 4),
codeBlock: CodeBlockStyle(showCopyButton: false),
),
)
For structure rather than appearance, use the builders — codeBuilder,
tableBuilder, blockQuoteBuilder and the rest. The rule across the
package is: style object for looks, builder for structure.
- Annotations
Constructors
- GptMarkdownStyleSheet({BlockQuoteStyle? blockQuote, HeadingStyle? heading, LinkStyle? link, InlineCodeStyle? inlineCode, ListStyle? list, CheckboxStyle? checkbox, CodeBlockStyle? codeBlock, TableStyle? table, ImageStyle? image, HrStyle? hr, SourceTagStyle? sourceTag, LatexStyle? latex, AlertStyle? alert, double? blockSpacing})
-
Creates a style sheet. Every field is optional.
const
Properties
- alert → AlertStyle?
-
How alerts — quotes opening with
[!NOTE]and the like — are drawn.final - blockQuote → BlockQuoteStyle?
-
How blockquotes are drawn.
final
- blockSpacing → double?
-
Vertical space between blocks — paragraphs, headings, lists, code, tables
and the rest — in logical pixels at a text scale of 1. It grows with the
text scale, so the gap stays in proportion when a reader enlarges text.
final
- checkbox → CheckboxStyle?
-
How task-list checkboxes and radio buttons are drawn.
final
- codeBlock → CodeBlockStyle?
-
How fenced code blocks are drawn.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- heading → HeadingStyle?
-
How
#headings are drawn.final - hr → HrStyle?
-
How horizontal rules are drawn.
final
- image → ImageStyle?
-
How images are drawn.
final
- inlineCode → InlineCodeStyle?
-
How inline
codeis drawn.final - latex → LatexStyle?
-
How rendered maths are drawn.
final
- link → LinkStyle?
-
How links are drawn.
final
- list → ListStyle?
-
How ordered and unordered lists are drawn.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sourceTag → SourceTagStyle?
-
How
[1]citation chips are drawn.final - table → TableStyle?
-
How tables are drawn.
final
Methods
-
copyWith(
{BlockQuoteStyle? blockQuote, HeadingStyle? heading, LinkStyle? link, InlineCodeStyle? inlineCode, ListStyle? list, CheckboxStyle? checkbox, CodeBlockStyle? codeBlock, TableStyle? table, ImageStyle? image, HrStyle? hr, SourceTagStyle? sourceTag, LatexStyle? latex, AlertStyle? alert, double? blockSpacing}) → GptMarkdownStyleSheet - A copy with the given fields replaced.
-
merge(
GptMarkdownStyleSheet? other) → GptMarkdownStyleSheet -
This sheet, with any unset value taken from
other, field by field. -
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
Static Methods
-
lerp(
GptMarkdownStyleSheet? a, GptMarkdownStyleSheet? b, double t) → GptMarkdownStyleSheet? - Linearly interpolates between two style sheets.