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

Draft: add-set-padding-function #267

Closed
wants to merge 9 commits into from
Closed

Draft: add-set-padding-function #267

wants to merge 9 commits into from

Conversation

JulianBissekkou
Copy link
Collaborator

No description provided.

Comment on lines 341 to 344


mapView.contentInset = UIEdgeInsets(top: CGFloat(top), left: CGFloat(left), bottom: CGFloat(bottom), right: CGFloat(right))
result(nil)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once you did the open todos you will eventually adjust this line of code and call this method with the provided animation duration. Keep in mind 2 things:

  • most iOS apis treat animation durations as seconds (where others use ms)
  • Add a completion handler to the call and only invoke result(nil) once the animation is done

@JulianBissekkou
Copy link
Collaborator Author

#258

@@ -276,6 +276,11 @@ class MaplibreMapController extends ChangeNotifier {
return _mapboxGlPlatform.animateCamera(cameraUpdate, duration: duration);
}

Future<bool?> setPadding({required EdgeInsets edgeInsets}) async {
//TODO(tapped-matthias): don't animate by default = Duration.zero
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@huberm88
Can you take a look. If you have questions let me know 👍🏽

@@ -276,6 +276,11 @@ class MaplibreMapController extends ChangeNotifier {
return _mapboxGlPlatform.animateCamera(cameraUpdate, duration: duration);
}

Future<bool?> setPadding({required EdgeInsets edgeInsets}) async {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small rename to be consistent with the framework 👍🏽

Suggested change
Future<bool?> setPadding({required EdgeInsets edgeInsets}) async {
Future<bool?> setPadding({required EdgeInsets padding}) async {

Comment on lines 188 to 195
TextButton(
onPressed: () {
mapController.setPadding(
edgeInsets: const EdgeInsets.only(right: 300.0),
);
},
child: const Text('addRightPadding'),
),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should create a new example screen that shows the padding feature in more detail, otherwise its quite hard to debug and test

@stefanschaller stefanschaller deleted the add-set-padding-function branch August 16, 2023 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants