Migrate to 2.24.0
This guide outlines the breaking changes introduced in SDK version 2.24.0. Required updates may vary depending on your use case.
Additionally, new features and bugfixes have been introduced and are not documented here. For a comprehensive list of changes, please refer to the changelog.
This release introduces new camera support and rendering behavior updates, deprecates some legacy fields and methods, and improves consistency in return types across several APIs.
Several fields and methods have been deprecated and replaced
To provide more clarity and consistency across the SDK, several methods and parameters have been deprecated and replaced with newer alternatives. Ensure you update your code accordingly, as deprecated members may be removed in a future release.
onCompleteCallBack
parameter replaced with onComplete
The onCompleteCallBack
parameter has been deprecated across all classes and replaced with onComplete
.
Before:
someSdkMethod(onCompleteCallBack: () {
// Callback logic
});
After:
someSdkMethod(onComplete: () {
// Callback logic
});
This change aligns with common Dart naming conventions and enhances clarity.
headingInDegrees
replaced with mapAngle
in MapView
The headingInDegrees
method has been deprecated. Use mapAngle
from MapView
instead.
Before:
double heading = mapView.headingInDegrees();
After:
double heading = mapView.mapAngle;
pitchInDegrees
replaced with viewAngle
in MapView
The pitchInDegrees
method has been deprecated. Use viewAngle
instead.
Before:
double pitch = mapView.pitchInDegrees();
After:
double pitch = mapView.viewAngle;
angle
parameter of setMapRotationMode
replaced with mapAngle
in FollowPositionPreferences
The angle
parameter has been deprecated in favor of mapAngle
.
Before:
prefs.setMapRotationMode(mode, angle: 45.0);
After:
prefs.setMapRotationMode(mode, mapAngle: 45.0);
rotationAngle
replaced with mapAngle
in FollowPositionPreferences
and MapViewPreferences
The rotationAngle
getter/setter has been deprecated. Use mapAngle
instead.
Before:
double angle = prefs.rotationAngle;
prefs.rotationAngle = 90.0;
After:
double angle = prefs.mapAngle;
prefs.mapAngle = 90.0;
isEmpty
replaced with isDefault
in all GeographicArea
classes
To better reflect intent, the isEmpty
getter is now replaced with isDefault
.
Before:
bool empty = area.isEmpty;
After:
bool isDefault = area.isDefault;
Return types in RouteBookmarks
changed to nullable
To improve robustness and null safety, return types of multiple methods in the RouteBookmarks
class have been changed from non-nullable to nullable.
Method | Old Return Type | New Return Type |
---|---|---|
getWaypoints | List<Landmark> | List<Landmark>? |
getName | String | String? |
getTimestamp | DateTime | DateTime? |
Before:
final name = bookmarks.getName();
print(name.length); // Unsafe if null
After:
final name = bookmarks.getName();
if (name != null) {
print(name.length);
} else {
// Handle null
}
Removed members related to manual rendering
Manual rendering is no longer required. The following members have been removed:
RenderRule
enumrender
,markNeedsRender
,renderingRule
from theGemView
classrender
,markNeedsRender
from theGemMapController
class
If you were manually invoking rendering logic, you can now safely remove these calls.
The accurateResult
parameter has been removed from timezone methods
The optional accurateResult
parameter has been removed from:
Timezone.getTimezoneInfoFromCoordinates
Timezone.getTimezoneInfoFromTimezoneId
Before:
timezone.getTimezoneInfoFromCoordinates(coords, accurateResult: true);
After:
timezone.getTimezoneInfoFromCoordinates(coords);
The method now always returns the best available result automatically.
This version brings improved API consistency, null-safety, and better use of Dart conventions. Update your project accordingly to ensure compatibility and benefit from these enhancements.