TomlViewerColors class
The colour palette used by the TOML viewer.
Grouping colours here keeps TomlViewerConfig small: the light/dark factories differ only in this one field instead of repeating a dozen colour parameters each.
Use TomlViewerColors.light, TomlViewerColors.dark, or build your own:
TomlViewerConfig(
colors: TomlViewerColors.dark.copyWith(value: Colors.amber),
)
- Annotations
Constructors
- TomlViewerColors({Color value = const Color(0xFFD32F2F), Color type = const Color(0xFF757575), Color symbol = const Color(0xFF9E9E9E), Color nonRootKey = const Color(0xFF1565C0), Color rootKey = const Color(0xFF0D47A1), Color tableKey = const Color(0xFF00796B), Color arrayIndex = const Color(0xFF757575), Color arrayExpandable = const Color(0xFF00897B), Color errorHighlight = const Color(0xFFF44336), Color errorText = const Color(0xFFC62828), Color searchHighlight = const Color(0xFFFFE082), Color lineNumber = const Color(0xFF9E9E9E)})
-
Creates a colour palette. Every colour has a light-mode default.
const
Properties
- arrayExpandable → Color
-
Colour for array element labels that can be expanded.
final
- arrayIndex → Color
-
Colour for array element labels that cannot be expanded.
final
- errorHighlight → Color
-
Background tint for error annotations.
final
- errorText → Color
-
Text colour for error messages.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- lineNumber → Color
-
Colour for line numbers in TomlSourceView.
final
- nonRootKey → Color
-
Colour for keys inside nested tables.
final
- rootKey → Color
-
Colour for top-level keys.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- searchHighlight → Color
-
Background tint applied to text matching the active search query.
final
- symbol → Color
-
Colour for the key/value separator symbol and expand icons.
final
- tableKey → Color
-
Colour for keys whose value is a table.
final
- type → Color
-
Colour for type labels such as
Array of int[3]orTable.final - value → Color
-
Colour for primitive values (strings, numbers, booleans, dates).
final
Methods
-
copyWith(
{Color? value, Color? type, Color? symbol, Color? nonRootKey, Color? rootKey, Color? tableKey, Color? arrayIndex, Color? arrayExpandable, Color? errorHighlight, Color? errorText, Color? searchHighlight, Color? lineNumber}) → TomlViewerColors - Creates a copy with optionally updated colours.
-
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
-
of(
BuildContext context) → TomlViewerColors - Returns dark for a dark Theme, otherwise light.
Constants
- dark → const TomlViewerColors
- The dark-mode palette.
- light → const TomlViewerColors
- The light-mode palette.