reg static method

dynamic reg(
  1. SyncEaseLogic syncEaseLogic
)

Registers a new instance of SyncEaseLogic.

If an instance with the same type is already registered, disposes the existing instance before registering the new instance.

Implementation

static reg(SyncEaseLogic syncEaseLogic) {
  String typeKey = syncEaseLogic.runtimeType.toString();
  if (Utils.registeredLogics[typeKey] != null) {
    syncEaseLogic.infoLog(
        "A new instance is registered. Disposing the existing instance.");
  }
  Utils.registeredLogics[typeKey] = syncEaseLogic;
  syncEaseLogic.onRegistered(); // Initialize the logic instance
  syncEaseLogic.successLog("Instance registered successfully.");
  return Utils.registeredLogics[typeKey];
}