Skip to content

Commit

Permalink
✨ feat(flutter_map_cache): add policy option
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateo MARTINEZ committed Feb 19, 2024
1 parent 2cad8bc commit f9f84c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion flutter_map_cache/lib/src/cached_tile_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import 'package:flutter/rendering.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_map_cache/src/cached_image_provider.dart';

export 'package:dio_cache_interceptor/dio_cache_interceptor.dart'
show CachePolicy;

/// TileProvider with additional caching functionality
class CachedTileProvider extends TileProvider {
/// dio http client
Expand All @@ -14,6 +17,7 @@ class CachedTileProvider extends TileProvider {
/// Create a new [CachedTileProvider]
CachedTileProvider({
required CacheStore store,
cachePolicy = CachePolicy.forceCache,
Dio? dio,
@Deprecated(
'''
Expand All @@ -40,7 +44,7 @@ class CachedTileProvider extends TileProvider {
options: CacheOptions(
store: store,
allowPostMethod: true,
policy: CachePolicy.forceCache,
policy: cachePolicy,
maxStale: maxStale,
keyBuilder: keyBuilder ?? CacheOptions.defaultCacheKeyBuilder,
hitCacheOnErrorExcept: hitCacheOnErrorExcept,
Expand Down

0 comments on commit f9f84c3

Please sign in to comment.