get<T extends SyncEaseLogic> static method

T get<T extends SyncEaseLogic>()

Retrieves a registered instance of SyncEaseLogic of the specified type T.

Throws an exception if the instance is not registered.

Implementation

static T get<T extends SyncEaseLogic>() {
  String typeKey = T.toString();
  if (Utils.registeredLogics[typeKey] == null) {
    EaseLogger.error(
      tag: "$typeKey:",
      message:
          "Type $typeKey is not registered. Unable to retrieve instance.",
    );
    throw Exception("Type $typeKey is not registered.");
  }

  T instance = Utils.registeredLogics[typeKey] as T;
  instance.onGet();
  return instance;
}