trackState function
Registers a store whose state Capybara records, before or after Capybara.run. Null where Capybara does
nothing: release builds and the web.
library groups stores in the State tab (riverpod, bloc); via says how they were found (observer);
actions says whether changes come with the name of what made them. read gives the current state.
Implementation
CapybaraStateStore? trackState({
required String library,
required String label,
required String via,
required bool actions,
required Object? Function() read,
String? note,
}) {
if (!_enabled || kIsWeb) return null;
return StateRegistry.instance.track(
library: library,
label: label,
via: via,
actions: actions,
read: read,
note: note,
);
}