Skip to content

Commit

Permalink
chore!: remove all leftover deprecated symbols (#1730)
Browse files Browse the repository at this point in the history
  • Loading branch information
JaffaKetchup authored Nov 22, 2023
1 parent 0af46c5 commit 832440b
Show file tree
Hide file tree
Showing 15 changed files with 24 additions and 609 deletions.
12 changes: 2 additions & 10 deletions example/lib/pages/tile_loading_error_handle.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import 'dart:ui' as ui;

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_map_example/widgets/drawer.dart';
Expand Down Expand Up @@ -105,14 +102,9 @@ class _SimulateErrorImageProvider
_SimulateErrorImageProvider();

@override
ImageStreamCompleter load(
ImageStreamCompleter loadImage(
_SimulateErrorImageProvider key,
Future<ui.Codec> Function(
Uint8List, {
bool allowUpscaling,
int? cacheHeight,
int? cacheWidth,
}) decode,
ImageDecoderCallback decode,
) =>
_SimulateErrorImageStreamCompleter();

Expand Down
7 changes: 6 additions & 1 deletion example/windows/flutter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ include(${EPHEMERAL_DIR}/generated_config.cmake)
# https://github.com/flutter/flutter/issues/57146.
set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper")

# Set fallback configurations for older versions of the flutter tool.
if (NOT DEFINED FLUTTER_TARGET_PLATFORM)
set(FLUTTER_TARGET_PLATFORM "windows-x64")
endif()

# === Flutter Library ===
set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll")

Expand Down Expand Up @@ -92,7 +97,7 @@ add_custom_command(
COMMAND ${CMAKE_COMMAND} -E env
${FLUTTER_TOOL_ENVIRONMENT}
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat"
windows-x64 $<CONFIG>
${FLUTTER_TARGET_PLATFORM} $<CONFIG>
VERBATIM
)
add_custom_target(flutter_assemble DEPENDS
Expand Down
1 change: 0 additions & 1 deletion lib/flutter_map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export 'package:flutter_map/src/map/options/options.dart';
export 'package:flutter_map/src/map/widget.dart';
export 'package:flutter_map/src/misc/bounds.dart';
export 'package:flutter_map/src/misc/center_zoom.dart';
export 'package:flutter_map/src/misc/fit_bounds_options.dart';
export 'package:flutter_map/src/misc/move_and_rotate_result.dart';
export 'package:flutter_map/src/misc/point_extensions.dart';
export 'package:flutter_map/src/misc/position.dart';
Expand Down
4 changes: 1 addition & 3 deletions lib/src/gestures/flutter_map_interactive_viewer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,7 @@ class FlutterMapInteractiveViewerState
void _onPointerSignal(PointerSignalEvent pointerSignal) {
// Handle mouse scroll events if the enableScrollWheel parameter is enabled
if (pointerSignal is PointerScrollEvent &&
(InteractiveFlag.hasScrollWheelZoom(_interactionOptions.flags) ||
// ignore: deprecated_member_use_from_same_package
_interactionOptions.enableScrollWheel) &&
InteractiveFlag.hasScrollWheelZoom(_interactionOptions.flags) &&
pointerSignal.scrollDelta.dy != 0) {
// Prevent scrolling of parent/child widgets simultaneously. See
// [PointerSignalResolver] documentation for more information.
Expand Down
10 changes: 0 additions & 10 deletions lib/src/layer/tile_layer/tile_error_evict_callback.dart
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
part of 'tile_layer.dart';

@Deprecated(
'Prefer creating a custom `TileProvider` instead. '
'This option has been deprecated as it is out of scope for the `TileLayer`. '
'This option is deprecated since v6.',
)
typedef TemplateFunction = String Function(
String str,
Map<String, String> data,
);

enum EvictErrorTileStrategy {
/// Never evict images for tiles which failed to load.
none,
Expand Down
38 changes: 1 addition & 37 deletions lib/src/layer/tile_layer/tile_layer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,6 @@ class TileLayer extends StatefulWidget {
// Defaults to TileDisplay.fadeIn().
final TileDisplay tileDisplay;

/// Color shown behind the tiles
@Deprecated(
'Prefer `MapOptions.backgroundColor`. '
'This property has been removed simplify interaction when using multiple `TileLayer`s. '
'This property is deprecated since v6.',
)
final Color? backgroundColor;

/// Provider with which to load map tiles
///
/// The default is [NetworkTileProvider] which supports both IO and web
Expand Down Expand Up @@ -199,13 +191,6 @@ class TileLayer extends StatefulWidget {
/// This callback will be executed if an error occurs when fetching tiles.
final ErrorTileCallBack? errorTileCallback;

@Deprecated(
'Prefer creating a custom `TileProvider` instead. '
'This option has been deprecated as it is out of scope for the `TileLayer`. '
'This option is deprecated since v6.',
)
final TemplateFunction? templateFunction;

/// Function which may Wrap Tile with custom Widget
/// There are predefined examples in 'tile_builder.dart'
final TileBuilder? tileBuilder;
Expand Down Expand Up @@ -250,12 +235,6 @@ class TileLayer extends StatefulWidget {
this.subdomains = const ['a', 'b', 'c'],
this.keepBuffer = 2,
this.panBuffer = 1,
@Deprecated(
'Prefer `MapOptions.backgroundColor`. '
'This property has been removed simplify interaction when using multiple `TileLayer`s. '
'This property is deprecated since v6.',
)
this.backgroundColor,
this.errorImage,
final TileProvider? tileProvider,
this.tms = false,
Expand All @@ -267,12 +246,6 @@ class TileLayer extends StatefulWidget {
/// Defaults to `false` when `null`.
final bool? retinaMode,
this.errorTileCallback,
@Deprecated(
'Prefer creating a custom `TileProvider` instead. '
'This option has been deprecated as it is out of scope for the `TileLayer`. '
'This option is deprecated since v6.',
)
this.templateFunction,
this.tileBuilder,
this.evictErrorTileStrategy = EvictErrorTileStrategy.none,
this.reset,
Expand Down Expand Up @@ -570,19 +543,10 @@ class _TileLayerState extends State<TileLayer> with TickerProviderStateMixin {
}

return MobileLayerTransformer(
// ignore: deprecated_member_use_from_same_package
child: _addBackgroundColor(
Stack(children: tiles..sort(renderOrder)),
),
child: Stack(children: tiles..sort(renderOrder)),
);
}

@Deprecated('Remove once `backgroundColor` is removed')
Widget _addBackgroundColor(Widget child) {
final color = widget.backgroundColor;
return color == null ? child : ColoredBox(color: color, child: child);
}

TileImage _createTileImage({
required TileCoordinates coordinates,
required TileBoundsAtZoom tileBoundsAtZoom,
Expand Down
14 changes: 0 additions & 14 deletions lib/src/map/camera/camera.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@ class MapCamera {
/// value in radians.
final double rotation;

@Deprecated(
'Prefer `nonRotatedSize`. '
'This getter has been changed to fix the capitalization. '
'This getter is deprecated since v6.',
)
Point<double> get nonrotatedSize => nonRotatedSize;

/// The size of the map view ignoring rotation. This will be the size of the
/// FlutterMap widget.
final Point<double> nonRotatedSize;
Expand All @@ -63,13 +56,6 @@ class MapCamera {
/// Lazily calculated field
double? _rotationRad;

@Deprecated(
'Prefer `visibleBounds`. '
'This getter has been changed to clarify its meaning. '
'This getter is deprecated since v6.',
)
LatLngBounds get bounds => visibleBounds;

/// This is the [LatLngBounds] corresponding to four corners of this camera.
/// This takes rotation in to account.
LatLngBounds get visibleBounds => _bounds ??= LatLngBounds(
Expand Down
130 changes: 0 additions & 130 deletions lib/src/map/controller/impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@ import 'dart:async';
import 'dart:math';

import 'package:flutter/widgets.dart';
import 'package:flutter_map/src/geo/latlng_bounds.dart';
import 'package:flutter_map/src/gestures/map_events.dart';
import 'package:flutter_map/src/map/camera/camera.dart';
import 'package:flutter_map/src/map/camera/camera_fit.dart';
import 'package:flutter_map/src/map/controller/internal.dart';
import 'package:flutter_map/src/map/controller/map_controller.dart';
import 'package:flutter_map/src/misc/center_zoom.dart';
import 'package:flutter_map/src/misc/fit_bounds_options.dart';
import 'package:flutter_map/src/misc/move_and_rotate_result.dart';
import 'package:flutter_map/src/misc/point_extensions.dart';
import 'package:latlong2/latlong.dart';

/// Implements [MapController] whilst exposing methods for internal use which
Expand Down Expand Up @@ -98,132 +94,6 @@ class MapControllerImpl implements MapController {
@override
MapCamera get camera => _internalController.camera;

@override
@Deprecated(
'Prefer `fitCamera` with a CameraFit.bounds() or CameraFit.insideBounds() instead. '
'This method has been changed to use the new `CameraFit` classes which allows different kinds of fit. '
'This method is deprecated since v6.',
)
bool fitBounds(
LatLngBounds bounds, {
FitBoundsOptions options =
const FitBoundsOptions(padding: EdgeInsets.all(12)),
}) =>
fitCamera(
options.inside
? CameraFit.insideBounds(
bounds: bounds,
padding: options.padding,
maxZoom: options.maxZoom,
forceIntegerZoomLevel: options.forceIntegerZoomLevel,
)
: CameraFit.bounds(
bounds: bounds,
padding: options.padding,
maxZoom: options.maxZoom,
forceIntegerZoomLevel: options.forceIntegerZoomLevel,
),
);

@override
@Deprecated(
'Prefer `CameraFit.bounds(bounds: bounds).fit(controller.camera)` or `CameraFit.insideBounds(bounds: bounds).fit(controller.camera)`. '
'This method is replaced by applying a CameraFit to the MapCamera. '
'This method is deprecated since v6.',
)
CenterZoom centerZoomFitBounds(
LatLngBounds bounds, {
FitBoundsOptions options =
const FitBoundsOptions(padding: EdgeInsets.all(12)),
}) {
final cameraFit = options.inside
? CameraFit.insideBounds(
bounds: bounds,
padding: options.padding,
maxZoom: options.maxZoom,
forceIntegerZoomLevel: options.forceIntegerZoomLevel,
)
: CameraFit.bounds(
bounds: bounds,
padding: options.padding,
maxZoom: options.maxZoom,
forceIntegerZoomLevel: options.forceIntegerZoomLevel,
);

final fittedState = cameraFit.fit(camera);
return CenterZoom(
center: fittedState.center,
zoom: fittedState.zoom,
);
}

@override
@Deprecated(
'Prefer `controller.camera.pointToLatLng()`. '
'This method is now accessible via the camera. '
'This method is deprecated since v6.',
)
LatLng pointToLatLng(Point<num> screenPoint) =>
camera.pointToLatLng(screenPoint);

@override
@Deprecated(
'Prefer `controller.camera.latLngToScreenPoint()`. '
'This method is now accessible via the camera. '
'This method is deprecated since v6.',
)
Point<double> latLngToScreenPoint(LatLng mapCoordinate) =>
camera.latLngToScreenPoint(mapCoordinate);

@override
@Deprecated(
'Prefer `controller.camera.rotatePoint()`. '
'This method is now accessible via the camera. '
'This method is deprecated since v6.',
)
Point<double> rotatePoint(
Point mapCenter,
Point point, {
bool counterRotation = true,
}) =>
camera.rotatePoint(
mapCenter.toDoublePoint(),
point.toDoublePoint(),
counterRotation: counterRotation,
);

@override
@Deprecated(
'Prefer `controller.camera.center`. '
'This getter is now accessible via the camera. '
'This getter is deprecated since v6.',
)
LatLng get center => camera.center;

@override
@Deprecated(
'Prefer `controller.camera.visibleBounds`. '
'This getter is now accessible via the camera. '
'This getter is deprecated since v6.',
)
LatLngBounds? get bounds => camera.visibleBounds;

@override
@Deprecated(
'Prefer `controller.camera.zoom`. '
'This getter is now accessible via the camera. '
'This getter is deprecated since v6.',
)
double get zoom => camera.zoom;

@override
@Deprecated(
'Prefer `controller.camera.rotation`. '
'This getter is now accessible via the camera. '
'This getter is deprecated since v6.',
)
double get rotation => camera.rotation;

@override
void dispose() {
_mapEventStreamController.close();
Expand Down
Loading

0 comments on commit 832440b

Please sign in to comment.