LoadingState class

Tracks and records the loading state across the WebFController lifecycle

Constructors

LoadingState()

Properties

errors List<LoadingError>
Gets all recorded errors
no setter
failedScriptsCount int
Gets count of failed scripts
no setter
hasErrors bool
Checks if there are any errors
no setter
hashCode int
The hash code for this object.
no setterinherited
networkRequests List<LoadingNetworkRequest>
Gets all network requests
no setter
phases List<LoadingPhase>
Gets all recorded phases
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scriptElements List<LoadingScriptElement>
Gets all script elements
no setter
successfulScriptsCount int
Gets count of successful scripts
no setter
totalDuration Duration?
Gets the total duration from start to the last recorded phase
no setter

Methods

addAnyPhaseListener(PhaseEventCallback callback) → void
Registers a listener for all phases
addPhaseListener(String phaseName, PhaseEventCallback callback) → void
Registers a listener for a specific phase
clearAllListeners() → void
Clears all listeners
dump({LoadingStateDumpOptions? options}) LoadingStateDump
Dumps the loading state as a LoadingStateDump object that can be formatted as text or JSON
dumpAsString({LoadingStateDumpOptions? options}) String
Legacy method for backward compatibility - returns formatted string
finalizeLCP() → void
Finalizes the LCP phase, marking the last candidate as final
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onAnyLoadingError(LoadingErrorCallback callback) → void
Convenience method to listen for all loading errors
onAnyLoadingErrorOnce(LoadingErrorCallback callback, {Duration debounce = const Duration(milliseconds: 250), bool perLoad = true, Set<LoadingErrorType>? types, String? grep, bool caseSensitive = false, bool invert = false}) → void
Convenience method: listen to any loading error once, with optional debounce and per-load reset.
onAttachToFlutter(PhaseEventCallback callback) → void
onBuildRootView(PhaseEventCallback callback) → void
onConstructor(PhaseEventCallback callback) → void
onDetachFromFlutter(PhaseEventCallback callback) → void
onDispose(PhaseEventCallback callback) → void
onDOMContentLoaded(PhaseEventCallback callback) → void
onEvaluateComplete(PhaseEventCallback callback) → void
onEvaluateScripts(PhaseEventCallback callback) → void
onEvaluateStart(PhaseEventCallback callback) → void
onFetchError(PhaseEventCallback callback) → void
onFinalLargestContentfulPaint(PhaseEventCallback callback) → void
onFirstContentfulPaint(PhaseEventCallback callback) → void
onFirstPaint(PhaseEventCallback callback) → void
onInit(PhaseEventCallback callback) → void
onLargestContentfulPaint(PhaseEventCallback callback) → void
onLoadingError(Set<LoadingErrorType> types, LoadingErrorCallback callback) → void
Register a callback for loading errors of specific types @param types Set of error types to listen for. If empty, listens to all error types. @param callback The callback to invoke when matching errors occur
onLoadingErrorOnce(Set<LoadingErrorType> types, LoadingErrorCallback callback, {Duration debounce = const Duration(milliseconds: 250), bool perLoad = true}) → void
Register a callback that fires only once upon the first matching loading error. Multiple errors in a short burst are coalesced using debounce. If perLoad is true (default), the one-time state resets when reset() is called.
onLoadStart(PhaseEventCallback callback) → void
onNetworkError(PhaseEventCallback callback) → void
onParseHTML(PhaseEventCallback callback) → void
onParseHTMLEnd(PhaseEventCallback callback) → void
onParseHTMLStart(PhaseEventCallback callback) → void
onPreload(PhaseEventCallback callback) → void
onPreloadEnd(PhaseEventCallback callback) → void
onPreloadError(PhaseEventCallback callback) → void
onResolveEntrypoint(PhaseEventCallback callback) → void
onResolveEntrypointEnd(PhaseEventCallback callback) → void
onResolveEntrypointStart(PhaseEventCallback callback) → void
onScriptError(PhaseEventCallback callback) → void
onScriptExecuteComplete(PhaseEventCallback callback) → void
onScriptExecuteStart(PhaseEventCallback callback) → void
onScriptLoadComplete(PhaseEventCallback callback) → void
onScriptLoadStart(PhaseEventCallback callback) → void
onScriptQueue(PhaseEventCallback callback) → void
onWindowLoad(PhaseEventCallback callback) → void
recordCSSError(String url, String error, {Map<String, dynamic>? metadata}) → void
Records a CSS loading error
recordCurrentPhaseError(Object error, {StackTrace? stackTrace, Map<String, dynamic>? context}) → void
Records an error with the current phase context
recordEntrypointError(String url, String error, {Map<String, dynamic>? metadata}) → void
Records an entrypoint loading error
recordError(String phase, Object error, {StackTrace? stackTrace, Map<String, dynamic>? context}) → void
Records an error that occurred during a specific phase
recordImageError(String url, String error, {Map<String, dynamic>? metadata}) → void
Records an image loading error
recordNetworkRequestCacheInfo(String url, {required bool cacheHit, String? cacheType, DateTime? cacheEntryTime, Duration? cacheAge, Map<String, String>? cacheHeaders, int? cacheSize}) → void
Records cache information for a network request
recordNetworkRequestComplete(String url, {int? statusCode, int? responseSize, String? contentType, Map<String, String>? responseHeaders, String? finalUrl}) → void
Records the completion of a network request
recordNetworkRequestError(String url, String error, {bool isXHR = false}) → void
Records a network request error
recordNetworkRequestRedirect(String originalUrl, String redirectUrl, {int? statusCode}) → void
Records a redirect for a network request
recordNetworkRequestStage(String url, String stageName, {Map<String, dynamic>? metadata}) → void
Records a network request stage
recordNetworkRequestStart(String url, {String method = 'GET', Map<String, String>? headers, bool isXHR = false, String? protocol, String? remoteAddress, int? remotePort}) → void
Records the start of a network request
recordPhase(String phaseName, {Map<String, dynamic>? parameters, String? parentPhase}) → void
Records a loading phase with optional parameters
recordPhaseStart(String phaseName, {Map<String, dynamic>? parameters}) VoidCallback
Records the start of a phase and returns a function to record its completion
recordScriptElementError(String source, String error) → void
Records a script loading error
recordScriptElementExecuteComplete(String source) → void
Records the completion of script execution
recordScriptElementExecuteStart(String source) → void
Records the start of script execution
recordScriptElementLoadComplete(String source, {int? dataSize}) → void
Records the completion of script loading
recordScriptElementLoadStart(String source) → void
Records the start of script loading
recordScriptElementQueue({required String source, required bool isInline, required bool isModule, required bool isAsync, required bool isDefer}) → LoadingScriptElement
Records a script element being queued for loading
removeAnyPhaseListener(PhaseEventCallback callback) → void
Removes a listener for all phases
removePhaseListener(String phaseName, PhaseEventCallback callback) → void
Removes a listener for a specific phase
reset() → void
Resets the dumper to start recording from scratch
toString() String
A string representation of this object.
inherited

Operators

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