restore static method

void restore(
  1. ChartRegistrySnapshot snapshot
)

Restores a previously captured registry snapshot.

Implementation

static void restore(ChartRegistrySnapshot snapshot) {
  _byType
    ..clear()
    ..addEntries(
      snapshot.registrations.map(
        (registration) => MapEntry(registration.type, registration),
      ),
    );
  _rebuildStringIndexes();
  _bumpGeneration();
}