ISpectOptions class final

A configuration class for ISpect, defining various options including locale settings, feature toggles, action items, and panel configurations.

This class allows customization of ISpect through parameters such as:

  • Language settings (locale).
  • Feature toggles (isLogPageEnabled, isPerformanceEnabled, etc.).
  • Action items (actionItems).
  • Custom panel items (panelItems).
  • Additional panel buttons (panelButtons).
  • Custom log card builder (logBuilder).

Example Usage:

final options = ISpectOptions(
  locale: const Locale('en'),
  isLogPageEnabled: true,
  isPerformanceEnabled: false,
  actionItems: [
    ISpectActionItem(
      title: 'Clear Logs',
      icon: Icons.clear_all,
      onTap: (context) => clearLogs(),
    ),
  ],
  panelItems: [
    PanelAction(
      icon: Icons.bug_report,
      badge: PanelBadge.dot(),
      onPressed: showBugReport,
    ),
  ],
  panelButtons: [
    PanelActionButton(
      icon: Icons.settings,
      label: 'Settings',
      onPressed: openSettings,
    ),
  ],
);
Annotations

Constructors

ISpectOptions({Locale locale = const Locale('en'), NavigatorObserver? observer, bool isLogPageEnabled = true, bool isPerformanceEnabled = true, bool enableJankLogging = false, double severeJankFactor = 2.0, bool isInspectorEnabled = true, bool isColorPickerEnabled = true, List<ISpectActionItem> actionItems = const [], List<PanelAction> panelItems = const [], List<PanelActionButton> panelButtons = const [], ISpectPanelBuilder? panelBuilder, List<InspectorPlugin> plugins = const [], ISpectLogDataBuilder? logBuilder, ISpectShareCallback? onShare, ISpectOpenFileCallback? onOpenFile, ISpectLoadLogContentCallback? onLoadLogContent, ISpectSettingsChangedCallback? onSettingsChanged, ISpectSettingsState? initialSettings, ISpectMetadataProvider? metadataProvider, ISpectComposerFilePicker? onPickComposerFile})
const

Properties

actionItems → List<ISpectActionItem>
A list of custom action items that can be triggered in ISpect.
final
enableJankLogging → bool
Routes frames where totalSpan > target × severeJankFactor through ISpect.logger under `performanceCategory`. Off by default to avoid log spam; enable when you want jank entries in the log viewer.
final
hashCode → int
The hash code for this object.
no setteroverride
initialSettings → ISpectSettingsState?
Initial settings state to restore from local storage.
final
isColorPickerEnabled → bool
Controls visibility of the color picker tool.
final
isInspectorEnabled → bool
Controls visibility of the widget inspector.
final
isLogPageEnabled → bool
Controls visibility of the log viewer page.
final
isPerformanceEnabled → bool
Controls visibility of performance monitoring tools.
final
locale → Locale
The locale setting for ISpect, defining the language and region preferences.
final
logBuilder → ISpectLogDataBuilder?
Custom builder for log card widget. If null, uses default card.
final
metadataProvider → ISpectMetadataProvider?
Supplies environment metadata (app version, device, OS, …) embedded into the header of exported/shared log files.
final
observer → NavigatorObserver?
A navigator observer to track navigation events within the app.
final
onLoadLogContent → ISpectLoadLogContentCallback?
Custom loader invoked when the log viewer needs raw content from a file.
final
onOpenFile → ISpectOpenFileCallback?
Custom handler for file opening actions triggered inside ISpect.
final
onPickComposerFile → ISpectComposerFilePicker?
Supplies files for multipart bodies in the HTTP composer.
final
onSettingsChanged → ISpectSettingsChangedCallback?
Called when ISpect settings change (logger options, enabled log types, etc.).
final
onShare → ISpectShareCallback?
Custom handler for share actions triggered inside ISpect.
final
panelBuilder → ISpectPanelBuilder?
Builds the entire draggable diagnostics panel, replacing ISpect's default DraggableActionPanel.
final
panelButtons → List<PanelActionButton>
A list of panel buttons for additional controls in the ISpect interface.
final
panelItems → List<PanelAction>
A list of panel items displayed in the ISpect interface.
final
plugins → List<InspectorPlugin>
A list of plugins that extend the inspector panel with custom screens.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
severeJankFactor → double
Multiplier applied to the frame-time budget when deciding whether a frame counts as severe jank. 2.0 matches "visible hitch" on 60Hz. Ignored unless enableJankLogging is true.
final

Methods

copyWith({Locale? locale, NavigatorObserver? observer, bool? isLogPageEnabled, bool? isPerformanceEnabled, bool? enableJankLogging, double? severeJankFactor, bool? isInspectorEnabled, bool? isColorPickerEnabled, List<ISpectActionItem>? actionItems, List<PanelAction>? panelItems, List<PanelActionButton>? panelButtons, ISpectPanelBuilder? panelBuilder, List<InspectorPlugin>? plugins, ISpectLogDataBuilder? logBuilder, ISpectShareCallback? onShare, ISpectOpenFileCallback? onOpenFile, ISpectLoadLogContentCallback? onLoadLogContent, ISpectSettingsChangedCallback? onSettingsChanged, ISpectSettingsState? initialSettings, ISpectMetadataProvider? metadataProvider, ISpectComposerFilePicker? onPickComposerFile}) → ISpectOptions
Creates a new ISpectOptions instance with updated values while retaining existing ones where not specified.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

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