init static method

Future<void> init(
  1. Map<String, dynamic> defaultValues, {
  2. int expirationTimeInHours = PauloniaRemoteConfConstants.REMOTE_CONF_DEFAULT_EXPIRATION_TIME_IN_HOURS,
  3. int fetchTimeoutInSeconds = PauloniaRemoteConfConstants.REMOTE_CONF_DEFAULT_FETCH_TIMEOUT_IN_SECONDS,
})

Initialize the service

This functions initialize the remote configuration service and set the defaultValues. The function fetch the values from the server if the app is running on release. Set expirationTimeInHours with the time that the functions stores the values in cache (only for mobile). Set fetchTimeoutInSeconds with the time that the functions will wait if there is a network problem during fetch.

Implementation

static Future<void> init(
  Map<String, dynamic> defaultValues, {
  int expirationTimeInHours = PauloniaRemoteConfConstants
      .REMOTE_CONF_DEFAULT_EXPIRATION_TIME_IN_HOURS,
  int fetchTimeoutInSeconds = PauloniaRemoteConfConstants
      .REMOTE_CONF_DEFAULT_FETCH_TIMEOUT_IN_SECONDS,
}) {
  return PauloniaRemoteConfService.initRemoteConf(
    defaultValues,
    expirationTimeInHours: expirationTimeInHours,
    fetchTimeout: fetchTimeoutInSeconds,
  );
}