debugReassemble method

void debugReassemble()

A life-cycle executed when a hot-reload is performed.

This is equivalent to Flutter's State.reassemble.

This life-cycle is used to check for change in ProviderBase.debugGetCreateSourceHash, and invalidate the provider state on change.

Implementation

void debugReassemble() {
  assert(
    () {
      final previousHash = _debugCurrentCreateHash;
      _debugCurrentCreateHash = provider.debugGetCreateSourceHash?.call();

      if (previousHash != _debugCurrentCreateHash) {
        invalidateSelf();
      }

      return true;
    }(),
    '',
  );
}