needsMigration method

Future<bool> needsMigration(
  1. BoxBaseImpl box,
  2. int targetVersion
)

Checks if migration is needed for the given box.

Returns true if the current schema version of the box differs from the targetVersion.

Implementation

Future<bool> needsMigration(BoxBaseImpl box, int targetVersion) async {
  final currentVersion = await SchemaVersionTracker().getVersion(box);
  return currentVersion != targetVersion;
}