@@ -10,22 +10,28 @@ class _FMTCImageProvider extends ImageProvider<_FMTCImageProvider> {
1010 /// Create a specialised [ImageProvider] that uses FMTC internals to enable
1111 /// browse caching
1212 const _FMTCImageProvider ({
13- required this .provider,
14- required this .options,
13+ required this .networkUrl,
1514 required this .coords,
15+ required this .provider,
1616 required this .startedLoading,
1717 required this .finishedLoadingBytes,
1818 });
1919
20- /// An instance of the [FMTCTileProvider] in use
21- final FMTCTileProvider provider;
22-
23- /// An instance of the [TileLayer] in use
24- final TileLayer options;
20+ /// The network URL of the tile at [coords] , determined by
21+ /// [FMTCTileProvider.getTileUrl]
22+ final String networkUrl;
2523
2624 /// The coordinates of the tile to be fetched
25+ ///
26+ /// Must be set when using the image provider - acts as a key for
27+ /// [FMTCTileProvider.tileLoadingInterceptor] , and is used for some debug
28+ /// info. Optional when [provideTile] is used directly, if
29+ /// `tileLoadingInterceptor` functionality is not used.
2730 final TileCoordinates coords;
2831
32+ /// An instance of the [FMTCTileProvider] in use
33+ final FMTCTileProvider provider;
34+
2935 /// Function invoked when the image starts loading (not from cache)
3036 ///
3137 /// Used with [finishedLoadingBytes] to safely dispose of the `httpClient`
@@ -46,7 +52,7 @@ class _FMTCImageProvider extends ImageProvider<_FMTCImageProvider> {
4652 MultiFrameImageStreamCompleter (
4753 codec: provideTile (
4854 coords: coords,
49- networkUrl: provider. getTileUrl (coords, options) ,
55+ networkUrl: networkUrl ,
5056 provider: provider,
5157 key: key,
5258 finishedLoadingBytes: finishedLoadingBytes,
@@ -55,19 +61,15 @@ class _FMTCImageProvider extends ImageProvider<_FMTCImageProvider> {
5561 ).then (ImmutableBuffer .fromUint8List).then ((v) => decode (v)),
5662 scale: 1 ,
5763 debugLabel: coords.toString (),
58- informationCollector: () {
59- final tileUrl = provider.getTileUrl (coords, options);
60-
61- return [
62- DiagnosticsProperty ('Stores' , provider.stores),
63- DiagnosticsProperty ('Tile coordinates' , coords),
64- DiagnosticsProperty ('Tile URL' , tileUrl),
65- DiagnosticsProperty (
66- 'Tile storage-suitable UID' ,
67- provider.urlTransformer? .call (tileUrl) ?? tileUrl,
68- ),
69- ];
70- },
64+ informationCollector: () => [
65+ DiagnosticsProperty ('Stores' , provider.stores),
66+ DiagnosticsProperty ('Tile coordinates' , coords),
67+ DiagnosticsProperty ('Tile URL' , networkUrl),
68+ DiagnosticsProperty (
69+ 'Tile storage-suitable UID' ,
70+ provider.urlTransformer? .call (networkUrl) ?? networkUrl,
71+ ),
72+ ],
7173 );
7274
7375 /// {@macro fmtc.tileProvider.provideTile}
@@ -149,6 +151,7 @@ class _FMTCImageProvider extends ImageProvider<_FMTCImageProvider> {
149151 bool operator == (Object other) =>
150152 identical (this , other) ||
151153 (other is _FMTCImageProvider &&
154+ other.networkUrl == networkUrl &&
152155 other.coords == coords &&
153156 other.provider == provider);
154157
0 commit comments