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

Prevent crash when move() is called before FlutterMap has been built #827

Merged
merged 1 commit into from Mar 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/src/map/map.dart
Expand Up @@ -133,7 +133,7 @@ class MapState {
// Extended size of the map where rotation is calculated
CustomPoint _size;

CustomPoint get size => _size;
CustomPoint get size => _size ?? CustomPoint(0.0, 0.0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

You could also initialize the _size field

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@johnpryan That would have made more sense!


void _updateSizeByOriginalSizeAndRotation() {
final originalWidth = _originalSize.x;
Expand Down