ShikiDualTheme class
A pair of themes that resolve switches between based on brightness, letting a highlighter track light/dark mode without being rebuilt.
- Inheritance
-
- Object
- ShikiThemeBase
- ShikiDualTheme
Constructors
- ShikiDualTheme({required ShikiTheme light, required ShikiTheme dark})
-
Creates a dual theme from its
lightanddarkvariants.const
Properties
- dark → ShikiTheme
-
The theme used when resolve is called with
isDark: true.final - hashCode → int
-
The hash code for this object.
no setterinherited
- light → ShikiTheme
-
The theme used when resolve is called with
isDark: false.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
themes
→ List<
ShikiTheme> -
Every concrete
ShikiThemethis references, for eager loading (seeShikiHighlighter.preload): a single theme yields itself; a ShikiDualTheme yields both its light and dark themes.no setteroverride
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resolve(
{required bool isDark}) → ShikiTheme -
Returns the concrete ShikiTheme to use, choosing
ShikiDualTheme.darkorShikiDualTheme.lightwhenisDarkapplies; a plain ShikiTheme ignoresisDarkand always returns itself.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited