Insights constructor

Insights({
  1. required String applicationID,
  2. required String apiKey,
  3. String? region,
})

Implementation

factory Insights({
  required String applicationID,
  required String apiKey,
  String? region,
}) {
  if (_insightsPool.containsKey(applicationID)) {
    return _insightsPool[applicationID]!;
  }
  final insights = Insights.custom(
    AlgoliaEventService(
      applicationID: applicationID,
      apiKey: apiKey,
      region: region,
    ),
    UserTokenStorage(),
  );
  _insightsPool[applicationID] = insights;
  return insights;
}