Skip to content

Commit d009ba7

Browse files
committed
Prepare for v10.0.0-dev.2 prerelease
1 parent 2db92df commit d009ba7

File tree

9 files changed

+41
-30
lines changed

9 files changed

+41
-30
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@ Additionally, vector tiles are now supported in theory, as the internal caching/
2727

2828
* Improvements to the browse caching logic and customizability
2929
* Added support for using multiple stores simultaneously in the `FMTCTileProvider`, and exposed constructor directly
30-
* Added more `CacheBehavior` options
30+
* Added `StoreReadWriteBehavior` for increased control over caching behaviour
3131
* Added toggle for hit/miss stat recording, to improve performance where these statistics are never read
32+
* Added Tile Loading Debug system (`FMTCTileProvider.tileLoadingDebugger`) to provide a method to debug internal tile loading mechanisms and perform advanced custom logging
3233
* Replaced `FMTCTileProviderSettings.maxStoreLength` with a `maxLength` property on each store individually
3334
* Refactored and exposed tile provider logic into seperate `getBytes` method
35+
* Replaced `obscureQueryParams` with more flexible `urlTransformer` (and static `urlTransformerOmitKeyValues` utility method to provide old behaviour)
3436
* Removed deprecated remnants from v9.*
3537
* Other generic improvements
3638

example/lib/src/screens/home/config_view/forms/bottom_sheet/components/contents.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
part of '../bottom_sheet.dart';
22

33
class _ContentPanels extends StatefulWidget {
4-
const _ContentPanels({
5-
super.key,
6-
required this.bottomSheetOuterController,
7-
});
4+
const _ContentPanels({required this.bottomSheetOuterController});
85

96
final DraggableScrollableController bottomSheetOuterController;
107

example/lib/src/screens/store_editor/store_editor.dart

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
import 'package:flutter/material.dart';
2-
import 'package:flutter/services.dart';
3-
import 'package:flutter_map/flutter_map.dart';
42
import 'package:flutter_map_tile_caching/flutter_map_tile_caching.dart';
5-
import 'package:http/http.dart' as http;
63
import 'package:provider/provider.dart';
7-
import 'package:validators/validators.dart' as validators;
84

9-
import '../../shared/components/loading_indicator.dart';
5+
import '../../shared/components/url_selector.dart';
106
import '../../shared/misc/store_metadata_keys.dart';
117
import '../../shared/state/general_provider.dart';
12-
import '../../shared/components/url_selector.dart';
138

149
class StoreEditorPopup extends StatefulWidget {
1510
const StoreEditorPopup({super.key});

example/pubspec.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ dependencies:
1414
auto_size_text: ^3.0.0
1515
badges: ^3.1.2
1616
better_open_file: ^3.6.5
17-
collection: ^1.18.0
17+
collection: ^1.19.0
1818
dart_earcut: ^1.1.0
19-
file_picker: ^8.0.3
19+
file_picker: ^8.0.6
2020
flutter:
2121
sdk: flutter
22-
flutter_map: ^7.0.1
22+
flutter_map: ^7.0.2
2323
flutter_map_animations: ^0.7.0
2424
flutter_map_tile_caching:
2525
google_fonts: ^6.2.1
@@ -39,8 +39,6 @@ dependencies:
3939
dependency_overrides:
4040
flutter_map_tile_caching:
4141
path: ../
42-
flutter_map:
43-
path: D:/flutter_map
4442

4543
flutter:
4644
uses-material-design: true

lib/src/providers/image_provider/browsing_errors.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class FMTCBrowsingError implements Exception {
3333
FMTCBrowsingError({
3434
required this.type,
3535
required this.networkUrl,
36-
required this.matcherUrl,
36+
required this.storageSuitableUID,
3737
this.request,
3838
this.response,
3939
this.originalError,
@@ -52,12 +52,12 @@ class FMTCBrowsingError implements Exception {
5252
/// [FMTCBrowsingErrorType.explanation] & [FMTCBrowsingErrorType.resolution].
5353
final String message;
5454

55-
/// Generated network URL at which the tile was requested from
55+
/// The requested URL of the tile (based on the [TileLayer.urlTemplate])
5656
final String networkUrl;
5757

58-
/// Generated URL that was used to find potential existing cached tiles,
59-
/// taking into account [FMTCTileProviderSettings.obscuredQueryParams].
60-
final String matcherUrl;
58+
/// The storage-suitable UID of the tile: the result of
59+
/// [FMTCTileProviderSettings.urlTransformer] on [networkUrl]
60+
final String storageSuitableUID;
6161

6262
/// If available, the attempted HTTP request
6363
///

lib/src/providers/image_provider/internal_get_bytes.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Future<Uint8List> _internalGetBytes({
9898
throw FMTCBrowsingError(
9999
type: FMTCBrowsingErrorType.missingInCacheOnlyMode,
100100
networkUrl: networkUrl,
101-
matcherUrl: matcherUrl,
101+
storageSuitableUID: matcherUrl,
102102
);
103103

104104
/*if (tileExistsInUnspecifiedStoresOnly) {
@@ -134,7 +134,7 @@ Future<Uint8List> _internalGetBytes({
134134
? FMTCBrowsingErrorType.noConnectionDuringFetch
135135
: FMTCBrowsingErrorType.unknownFetchException,
136136
networkUrl: networkUrl,
137-
matcherUrl: matcherUrl,
137+
storageSuitableUID: matcherUrl,
138138
request: request,
139139
originalError: e,
140140
);
@@ -153,7 +153,7 @@ Future<Uint8List> _internalGetBytes({
153153
throw FMTCBrowsingError(
154154
type: FMTCBrowsingErrorType.negativeFetchResponse,
155155
networkUrl: networkUrl,
156-
matcherUrl: matcherUrl,
156+
storageSuitableUID: matcherUrl,
157157
request: request,
158158
response: response,
159159
);
@@ -205,7 +205,7 @@ Future<Uint8List> _internalGetBytes({
205205
throw FMTCBrowsingError(
206206
type: FMTCBrowsingErrorType.invalidImageData,
207207
networkUrl: networkUrl,
208-
matcherUrl: matcherUrl,
208+
storageSuitableUID: matcherUrl,
209209
request: request,
210210
response: response,
211211
originalError: isValidImageData,

lib/src/providers/tile_provider/tile_provider.dart

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,22 @@ class FMTCTileProvider extends TileProvider {
145145

146146
/// {@macro fmtc.imageProvider.getBytes}
147147
Future<Uint8List> getBytes({
148-
required TileCoordinates coordinates,
148+
required TileCoordinates coords,
149149
required TileLayer options,
150+
Object? key,
150151
StreamController<ImageChunkEvent>? chunkEvents,
151-
bool requireValidImage = true,
152+
void Function()? startedLoading,
153+
void Function()? finishedLoadingBytes,
154+
bool requireValidImage = false,
152155
}) =>
153156
_FMTCImageProvider.getBytes(
154-
provider: this,
157+
coords: coords,
155158
options: options,
156-
coords: coordinates,
159+
provider: this,
160+
key: key,
157161
chunkEvents: chunkEvents,
162+
startedLoading: startedLoading,
163+
finishedLoadingBytes: finishedLoadingBytes,
158164
requireValidImage: requireValidImage,
159165
);
160166

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: flutter_map_tile_caching
22
description: Plugin for 'flutter_map' providing advanced caching functionality,
33
with ability to download map regions for offline use.
4-
version: 10.0.0-dev.1
4+
version: 10.0.0-dev.2
55

66
repository: https://github.com/JaffaKetchup/flutter_map_tile_caching
77
issue_tracker: https://github.com/JaffaKetchup/flutter_map_tile_caching/issues

test/general_test.dart

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ void main() {
312312
() async {
313313
await FMTCBackendAccess.internal.writeTile(
314314
storeNames: ['store1'],
315+
writeAllNotIn: null,
315316
url: tileA64.url,
316317
bytes: tileA64.bytes,
317318
);
@@ -335,6 +336,7 @@ void main() {
335336
() async {
336337
await FMTCBackendAccess.internal.writeTile(
337338
storeNames: ['store1'],
339+
writeAllNotIn: null,
338340
url: tileA64.url,
339341
bytes: tileA64.bytes,
340342
);
@@ -358,6 +360,7 @@ void main() {
358360
() async {
359361
await FMTCBackendAccess.internal.writeTile(
360362
storeNames: ['store1'],
363+
writeAllNotIn: null,
361364
url: tileA128.url,
362365
bytes: tileA128.bytes,
363366
);
@@ -381,6 +384,7 @@ void main() {
381384
() async {
382385
await FMTCBackendAccess.internal.writeTile(
383386
storeNames: ['store1'],
387+
writeAllNotIn: null,
384388
url: tileB64.url,
385389
bytes: tileB64.bytes,
386390
);
@@ -404,6 +408,7 @@ void main() {
404408
() async {
405409
await FMTCBackendAccess.internal.writeTile(
406410
storeNames: ['store1'],
411+
writeAllNotIn: null,
407412
url: tileB128.url,
408413
bytes: tileB128.bytes,
409414
);
@@ -427,6 +432,7 @@ void main() {
427432
() async {
428433
await FMTCBackendAccess.internal.writeTile(
429434
storeNames: ['store1'],
435+
writeAllNotIn: null,
430436
url: tileB64.url,
431437
bytes: tileB64.bytes,
432438
);
@@ -472,6 +478,7 @@ void main() {
472478
() async {
473479
await FMTCBackendAccess.internal.writeTile(
474480
storeNames: ['store2'],
481+
writeAllNotIn: null,
475482
url: tileA64.url,
476483
bytes: tileA64.bytes,
477484
);
@@ -505,6 +512,7 @@ void main() {
505512
() async {
506513
await FMTCBackendAccess.internal.writeTile(
507514
storeNames: ['store2'],
515+
writeAllNotIn: null,
508516
url: tileA128.url,
509517
bytes: tileA128.bytes,
510518
);
@@ -565,6 +573,7 @@ void main() {
565573
() async {
566574
await FMTCBackendAccess.internal.writeTile(
567575
storeNames: ['store2'],
576+
writeAllNotIn: null,
568577
url: tileB64.url,
569578
bytes: tileB64.bytes,
570579
);
@@ -598,6 +607,7 @@ void main() {
598607
() async {
599608
await FMTCBackendAccess.internal.writeTile(
600609
storeNames: ['store2'],
610+
writeAllNotIn: null,
601611
url: tileA64.url,
602612
bytes: tileA64.bytes,
603613
);
@@ -651,6 +661,7 @@ void main() {
651661
() async {
652662
await FMTCBackendAccess.internal.writeTile(
653663
storeNames: ['store1', 'store2'],
664+
writeAllNotIn: null,
654665
url: tileA64.url,
655666
bytes: tileA64.bytes,
656667
);
@@ -684,6 +695,7 @@ void main() {
684695
() async {
685696
await FMTCBackendAccess.internal.writeTile(
686697
storeNames: ['store1', 'store2'],
698+
writeAllNotIn: null,
687699
url: tileA128.url,
688700
bytes: tileA128.bytes,
689701
);
@@ -717,6 +729,7 @@ void main() {
717729
() async {
718730
await FMTCBackendAccess.internal.writeTile(
719731
storeNames: ['store1', 'store2'],
732+
writeAllNotIn: null,
720733
url: tileB128.url,
721734
bytes: tileB128.bytes,
722735
);

0 commit comments

Comments
 (0)