OnVersionChangedFunction typedef Null safety

OnVersionChangedFunction = FutureOr Function(Database db, int oldVersion, int newVersion)

Callback interface called when the existing version differs from the one expected.

Allow to perform migration or data change. Can return a future or not.

Implementation

typedef OnVersionChangedFunction = FutureOr<dynamic> Function(
    Database db, int oldVersion, int newVersion);