ISpectTheme class

Defines the theme configuration for ISpect, including colors, icons, and log descriptions.

This class allows customization of appearance settings such as:

  • Background and divider colors for light and dark modes.
  • Log-specific colors and icons.
  • Custom descriptions for log levels.

Example Usage:

final theme = ISpectTheme(
  pageTitle: 'Custom Inspector',
  lightBackgroundColor: Colors.white,
  darkBackgroundColor: Colors.black,
  logColors: {'error': Colors.red, 'info': Colors.blue},
  logIcons: {'error': Icons.error, 'info': Icons.info},
  logDescriptions: `LogDescription(name: 'Error', description: 'An error occurred')`,
);
Annotations

Constructors

ISpectTheme({String? pageTitle = 'ISpect', ISpectDynamicColor? background, ISpectDynamicColor? foreground, ISpectDynamicColor? divider, ISpectDynamicColor? primary, ISpectDynamicColor? card, Map<String, Color> logColors = const {}, Map<String, IconData> logIcons = const {}, Map<String, String> logDescriptions = const {}, DraggablePanelTheme? panelTheme})
Creates an ISpectTheme instance with customizable settings.
const
ISpectTheme.fromJson(String source)
factory
ISpectTheme.fromMap(Map<String, dynamic> map)
factory

Properties

background ISpectDynamicColor?
Background color
final
card ISpectDynamicColor?
Card color
final
divider ISpectDynamicColor?
Divider color
final
foreground ISpectDynamicColor?
Foreground color
final
hashCode int
The hash code for this object.
no setteroverride
logColors Map<String, Color>
A map of colors associated with different log types.
final
logDescriptions Map<String, String>
A map of descriptions associated with different log types.
final
logIcons Map<String, IconData>
A map of icons associated with different log types.
final
pageTitle String?
The title displayed on the inspector page.
final
panelTheme DraggablePanelTheme?
Theme settings for draggable panels within ISpect.
final
primary ISpectDynamicColor?
Primary color
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

colors(BuildContext context) Map<String, Color>
Returns a combined map of default and custom log colors based on theme mode.
copyWith({String? pageTitle, ISpectDynamicColor? background, ISpectDynamicColor? foreground, ISpectDynamicColor? divider, ISpectDynamicColor? primary, ISpectDynamicColor? card, Map<String, Color>? logColors, Map<String, IconData>? logIcons, Map<String, String>? logDescriptions, DraggablePanelTheme? panelTheme}) ISpectTheme
Creates a new ISpectTheme instance with updated values while retaining existing ones where not specified.
descriptions(BuildContext context) Map<String, String>
Returns a combined map of default and custom log descriptions.
getColorByLogLevel(BuildContext context, {required String? key}) Color
Retrieves the color associated with a log level.
getTypeColor(BuildContext context, {required String? key}) Color?
Retrieves the color associated with a specific log type.
getTypeDescription(BuildContext context, {required String? key}) String?
getTypeIcon(BuildContext context, {required String? key}) IconData
icons(BuildContext context) Map<String, IconData>
Returns a combined map of default and custom log icons.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() String
toMap() Map<String, dynamic>
toString() String
A string representation of this object.
override

Operators

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