-
Notifications
You must be signed in to change notification settings - Fork 110
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
Conversation
|
||
|
||
mapView.contentInset = UIEdgeInsets(top: CGFloat(top), left: CGFloat(left), bottom: CGFloat(bottom), right: CGFloat(right)) | ||
result(nil) |
There was a problem hiding this comment.
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
lib/src/controller.dart
Outdated
@@ -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 |
There was a problem hiding this comment.
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 👍🏽
lib/src/controller.dart
Outdated
@@ -276,6 +276,11 @@ class MaplibreMapController extends ChangeNotifier { | |||
return _mapboxGlPlatform.animateCamera(cameraUpdate, duration: duration); | |||
} | |||
|
|||
Future<bool?> setPadding({required EdgeInsets edgeInsets}) async { |
There was a problem hiding this comment.
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 👍🏽
Future<bool?> setPadding({required EdgeInsets edgeInsets}) async { | |
Future<bool?> setPadding({required EdgeInsets padding}) async { |
example/lib/animate_camera.dart
Outdated
TextButton( | ||
onPressed: () { | ||
mapController.setPadding( | ||
edgeInsets: const EdgeInsets.only(right: 300.0), | ||
); | ||
}, | ||
child: const Text('addRightPadding'), | ||
), |
There was a problem hiding this comment.
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
No description provided.