restorationId property

  1. @override
String? get restorationId
override

The restoration ID used for the RestorationBucket in which the mixin will store the restoration data of all registered properties.

The restoration ID is used to claim a child RestorationScope from the surrounding RestorationScope (accessed via RestorationScope.of) and the ID must be unique in that scope (otherwise an exception is triggered in debug mode).

State restoration for this mixin is turned off when this getter returns null or when there is no surrounding RestorationScope available. When state restoration is turned off, the values of the registered properties cannot be restored.

Whenever the value returned by this getter changes, didUpdateRestorationId must be called unless the (unless the change already triggered a call to didUpdateWidget).

The restoration ID returned by this getter is often provided in the constructor of the StatefulWidget that this State object is associated with.

Implementation

@override
String? get restorationId => widget.restorationId;