DebugStateInspector class
State Inspector manager.
Usage:
// Register a provider to inspect
DebugStateInspector.registerProvider(
id: 'user_provider',
name: 'UserProvider',
stateType: StateManagementType.provider,
initialValue: 'null',
);
// Log a state change
DebugStateInspector.logChange(
providerId: 'user_provider',
newValue: 'User(name: "John")',
);
// Get all changes
final changes = DebugStateInspector.changes;
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
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.
inherited
Static Properties
-
changes
→ List<
StateChange> -
Get all state changes.
no setter
- maxChanges ↔ int
-
Maximum number of changes to keep.
getter/setter pair
-
providers
→ List<
InspectedProvider> -
Get all registered providers.
no setter
Static Methods
-
addListener(
void listener(StateChange)) → void - Add a listener for state changes.
-
clearAll(
) → void - Clear everything.
-
clearChanges(
) → void - Clear all changes.
-
clearProviders(
) → void - Clear all providers.
-
exportJson(
) → String - Export changes as JSON.
-
getChangesByType(
StateManagementType type) → List< StateChange> - Get changes by state management type.
-
getChangesForProvider(
String providerId) → List< StateChange> - Get changes for a specific provider.
-
getProvider(
String id) → InspectedProvider? - Get a specific provider.
-
logChange(
{required String providerId, required String newValue, String? previousValue, String? description}) → void - Log a state change.
-
registerProvider(
{required String id, required String name, required StateManagementType stateType, required String initialValue}) → void - Register a provider for inspection.
-
removeListener(
void listener(StateChange)) → void - Remove a listener.
-
resetChangeCounts(
) → void - Reset all change counts.
-
search(
String query) → List< StateChange> - Search changes by query.
-
unregisterProvider(
String id) → void - Unregister a provider.