Infospect class

Infospect is a utility class designed to facilitate monitoring and debugging activities, such as logging network calls, navigating within the app, managing multi-window actions, and handling application logs.

Properties

breakpointManager → InfospectBreakpointManager
Proxyman-style endpoint breakpoints (request / response editing).
final
breakpoints → List<InfospectNetworkBreakpoint>
Breakpoints
no setter
brightness → Brightness
no setter
context → BuildContext?
no setter
dioInterceptor → InfospectDioInterceptor
interceptors
no setter
getNavigatorKey → GlobalKey<NavigatorState>?
get the navigator key
no setter
hashCode → int
The hash code for this object.
no setterinherited
infospectLogger → InfospectLogger
final
isInfospectOpened ↔ ValueNotifier<bool>
getter/setter pair
maxCallsCount → int
parameters
final
networkCallsSubject → BehaviorSubject<List<InfospectNetworkCall>>
final
onShareAllLogs → void Function(String path)?
final
onShareAllNetworkCalls → void Function(String path)?
final
poppedOutDesktopTabs → ValueListenable<Set<InfospectDesktopTab>>
Tabs currently shown in their own desktop windows (removed from the main Infospect sidebar until those windows close).
no setter
preferInAppBreakpointDialogs ↔ bool
When true, breakpoint editors always use in-app dialogs instead of desktop secondary windows. Useful for widget / integration tests.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

addBreakpoint(InfospectNetworkBreakpoint breakpoint) → void
addCall(InfospectNetworkCall call) → void
Network calls
addEndpointBreakpoint({required String endpoint, String? method, bool breakOnRequest = true, bool breakOnResponse = true, bool enabled = true, List<InfospectBreakpointCondition> conditions = const <InfospectBreakpointCondition>[]}) → InfospectNetworkBreakpoint
Adds a breakpoint for endpoint, optionally scoped to method.
addError(InfospectNetworkError error, int requestId) → void
addHttpCall(InfospectNetworkCall httpCall) → void
addLog(InfospectLog log) → void
Logs an instance of InfospectLog.
addLogs(List<InfospectLog> logs) → void
addResponse(InfospectNetworkResponse response, int requestId) → void
applyRequestBreakpointEdit({required int requestId, required InfospectBreakpointEdit edit}) → void
Stores original + edited request data and updates the live logged request.
applyResponseBreakpointEdit({required int requestId, required InfospectBreakpointEdit edit}) → void
Stores original + edited response data for a breakpoint.
clearAllLogs() → void
clearAllNetworkCalls() → void
clearBreakpoints() → void
dispose() → void
Dispose subjects and subscriptions
focusPoppedOutDesktopTab(InfospectDesktopTab tab) → Future<void>
Focuses an already-open popped-out tab window, if any.
handleMainWindowReceiveData() → void
handleMultiWindowReceivedData(BuildContext context) → void
httpClientInterceptor({required Client client}) → InfospectHttpClientInterceptor
infospectLaunchScreen({required NetworksListNotifier networksListNotifier, required LogsListNotifier logsListNotifier}) → Widget
get the launch screen widget
interceptRequestIfNeeded({required String method, required String endpoint, required String uri, required Map<String, dynamic> headers, required Map<String, dynamic> queryParameters, required dynamic body, int? requestId}) → Future<InfospectBreakpointResult?>
Pauses for request editing when a matching breakpoint rule exists.
interceptResponseIfNeeded({required String method, required String endpoint, required String uri, required Map<String, dynamic> headers, required dynamic body, int? statusCode, int? requestId, Map<String, dynamic> requestHeaders = const <String, dynamic>{}, Map<String, dynamic> queryParameters = const <String, dynamic>{}, dynamic requestBody}) → Future<InfospectBreakpointResult?>
Pauses for response editing when a matching breakpoint rule exists.
markBreakpointTrace({required int requestId, bool requestHit = false, bool responseHit = false, bool requestEdited = false, bool responseEdited = false}) → void
Records that a breakpoint interacted with requestId.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openInspectorInNewWindow() → Future<void>
Navigates to the interceptor.
openNetworkBodyInNewWindow({required InfospectNetworkCall call, required NetworkBodyKind kind, bool detailsInitiallyExpanded = false}) → Future<void>
Opens a network call body with request metadata in a new desktop window.
openRawDataInNewWindow({required Map<String, dynamic> data, String title = 'Body', bool beautificationRequired = true}) → Future<void>
Opens JSON / raw data (e.g. headers) in a new desktop window.
popOutDesktopTab(InfospectDesktopTab tab) → Future<void>
Opens tab in a separate desktop window and removes it from the main Infospect window sidebar.
removeBreakpoint(String id) → void
run(List<String> args, {required Widget myApp}) → void
Boots myApp via bootstrapMultiViewApp (Multiview on desktop, runApp elsewhere). Prefer this or Infospect.bootstrapMultiViewApp over plain runApp whenever Multiview native runners are wired.
sendLogs([List<InfospectLog>? logs]) → void
sendNetworkCalls() → void
No-ops kept for API compatibility with 0.1.x.
sendThemeMode({required bool isDarkTheme}) → void
toString() → String
A string representation of this object.
inherited
updateBreakpoint(InfospectNetworkBreakpoint breakpoint) → void

Operators

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

Static Properties

instance → Infospect
no setter
requiresMultiViewDesktopBootstrap → bool
Whether desktop entry must use Multiview (runMultiApp) instead of runApp. See isMultiViewDesktopBootstrapRequired.
no setter

Static Methods

bootstrapDesktopApp(Widget app, {MultiAppConfig? config}) → void
Alias for bootstrapMultiViewApp.
bootstrapMultiViewApp(Widget app, {MultiAppConfig? config}) → void
Desktop-safe entry that does not require ensureInitialized.
checkInstance(Infospect? instance) → Infospect
Checks if the Infospect instance is initialized and throws an error
ensureInitialized({int maxCallsCount = 1000, GlobalKey<NavigatorState>? navigatorKey, bool logAppLaunch = false, void onShareAllNetworkCalls(String path)?, void onShareAllLogs(String path)?}) → Infospect
Ensures the Infospect instance is initialized. If it's not initialized, it will initialize it with the provided arguments.