FMTCTileProviderSettings constructor

FMTCTileProviderSettings({
  1. CacheBehavior behavior = CacheBehavior.cacheFirst,
  2. bool fallbackToAlternativeStore = true,
  3. Duration cachedValidDuration = const Duration(days: 16),
  4. int maxStoreLength = 0,
  5. List<String> obscuredQueryParams = const [],
  6. FMTCBrowsingErrorHandler? errorHandler,
  7. bool setInstance = true,
})

Create new settings for an FMTCTileProvider, and set the instance (if setInstance is true, as default)

To access the existing settings, if any, get instance.

Implementation

factory FMTCTileProviderSettings({
  CacheBehavior behavior = CacheBehavior.cacheFirst,
  bool fallbackToAlternativeStore = true,
  Duration cachedValidDuration = const Duration(days: 16),
  int maxStoreLength = 0,
  List<String> obscuredQueryParams = const [],
  FMTCBrowsingErrorHandler? errorHandler,
  bool setInstance = true,
}) {
  final settings = FMTCTileProviderSettings._(
    behavior: behavior,
    fallbackToAlternativeStore: fallbackToAlternativeStore,
    cachedValidDuration: cachedValidDuration,
    maxStoreLength: maxStoreLength,
    obscuredQueryParams: obscuredQueryParams.map((e) => RegExp('$e=[^&]*')),
    errorHandler: errorHandler,
  );

  if (setInstance) _instance = settings;
  return settings;
}