TrackedStateIntegration class abstract
Base for state-management integrations without a global observer (ChangeNotifier, GetX, MobX stores): the app hands each state object to trackObject where it creates it.
A tracked object is keyed <id>#<n> (the n-th object tracked with that
id in the session), records <name>.create and <name>.change events,
is snapshotted into periodic checkpoints when it has a toJson, and is
restored in replay as soon as it is tracked again. Objects are held
weakly: tracking never keeps one alive.
- Inheritance
-
- Object
- BugCapsuleIntegration
- TrackedStateIntegration
- Implementers
Constructors
- TrackedStateIntegration({bool? recordStateData, int maxStateBytes = 64 * 1024})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxStateBytes → int
-
final
- name → String
-
Key of this integration's data in checkpoints, e.g.
bloc.no setterinherited - recordStateData → bool?
-
Include serialized state in change events. Defaults to true except in
production.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- session → BugCapsuleSession?
-
Non-null once set up.
no setter
Methods
-
describeEligibility(
EligibilityBuilder eligibility, RecordedWindow window) → void -
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
restore(
Object? data, BugCapsuleSession session) → Future< void> -
override
-
runRestore(
void body()) → void -
Runs an app
restorecallback, e.g. inside an action. -
setUp(
BugCapsuleSession session) → Future< void> -
override
-
snapshot(
CheckpointKind kind) → Object? -
JSON-safe snapshot for a checkpoint, or null.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
trackObject<
T extends Object> (T object, {required String id, required Object? subscribe(T object, void onChange()), Object? toJson(T object)?, void restore(T object, Map< String, Object?> json)?}) → T -
Starts recording
objectand returns it. -
unsubscribe(
Object object, Object subscription) → void -
Cancels a subscription returned by
subscribe. -
untrack(
Object object) → void -
Stops recording
object(e.g. before disposing it). Objects that are garbage collected are dropped without this.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited