getInstance static method

AppFit getInstance(
  1. {String instanceName = "default"}
)

Retrieve the shared instance of the AppFit SDK with the provided instanceName. If no instanceName is provided, the default instance will be returned.

final appfit = AppFit.getInstance();

Note: If an instance is not configured before calling this method, an exception will be thrown. {@category Initialization}

Implementation

static AppFit getInstance({
  String instanceName = "default",
}) {
  _instances ??= <String, AppFit>{};
  return _instances![instanceName]!;
}