fetchAppConfig method

Future<PublicAppConfig> fetchAppConfig({
  1. bool forceRefresh = false,
})

Fetches public app configuration.

Implementation

Future<PublicAppConfig> fetchAppConfig({bool forceRefresh = false}) async {
  if (!forceRefresh && _cachedAppConfig != null) {
    return _cachedAppConfig!;
  }
  final json = await _sendJson(
    method: 'GET',
    path: '/api/v1/public/config/${config.appKey}',
  );
  final appConfig = PublicAppConfig.fromJson(json);
  _cachedAppConfig = appConfig;
  return appConfig;
}