Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove the caching of _cancelledImage #3

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions lib/flutter_map_cancellable_tile_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ class CancellableNetworkTileProvider extends TileProvider {
CancellableNetworkTileProvider({super.headers}) : _dio = Dio();

final Dio _dio;
// ignore: use_late_for_private_fields_and_variables
ImmutableBuffer? _cancelledImage;

@override
bool get supportsCancelLoading => true;
Expand Down Expand Up @@ -144,9 +142,7 @@ class _CNTPImageProvider extends ImageProvider<_CNTPImageProvider> {
} on DioException catch (err) {
if (CancelToken.isCancel(err)) {
return decode(
tileProvider._cancelledImage ??= await ImmutableBuffer.fromUint8List(
TileProvider.transparentImage,
),
await ImmutableBuffer.fromUint8List(TileProvider.transparentImage),
);
}
if (useFallback || fallbackUrl == null) rethrow;
Expand Down
Loading