Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ - (NSString*)convertCLAuthorizationStatusToString:(CLAuthorizationStatus)status
case kCLAuthorizationStatusAuthorizedWhenInUse: {
return @"authorizedWhenInUse";
}
default: { return @"unknown"; }
default: {
return @"unknown";
}
}
}

Expand Down
4 changes: 4 additions & 0 deletions packages/google_maps_flutter/google_maps_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.5.25

* Add an optional param `mipmaps` for BitmapDescriptor.fromAssetImage.

## 0.5.24+1

* Make the pedantic dev_dependency explicit.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -823,4 +823,22 @@ void main() {
iwVisibleStatus = await controller.isMarkerInfoWindowShown(marker.markerId);
expect(iwVisibleStatus, false);
});

testWidgets("fromAssetImage", (WidgetTester tester) async {
final Iterable<Future<bool>> futures =
<double>[1, 2, 3].map((double pixelRatio) async {
final ImageConfiguration imageConfiguration =
ImageConfiguration(devicePixelRatio: pixelRatio);
final BitmapDescriptor mip = await BitmapDescriptor.fromAssetImage(
imageConfiguration, 'red_square.png');
final BitmapDescriptor scaled = await BitmapDescriptor.fromAssetImage(
imageConfiguration, 'red_square.png',
mipmaps: false);
mip.toJson().forEach((dynamic x) => print(x));
scaled.toJson().forEach((dynamic x) => print(x));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@duzenko forgot to ask, what is this test testing for? It seems to print stuff but never actually test anything?

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see, thanks. Do you want to try to make it work? I have resolved all the conflicts in this PR, it should be easier to work with now.

return Future<bool>.value(true);
});

Future.wait(futures);
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,15 @@ class BitmapDescriptor {
/// https://flutter.dev/docs/development/ui/assets-and-images#declaring-resolution-aware-image-assets
/// This method takes into consideration various asset resolutions
/// and scales the images to the right resolution depending on the dpi.
/// Set `mipmaps` to false to load the exact dpi version of the image, `mipmap` is true by default.
static Future<BitmapDescriptor> fromAssetImage(
ImageConfiguration configuration,
String assetName, {
AssetBundle bundle,
String package,
bool mipmaps = true,
}) async {
if (configuration.devicePixelRatio != null) {
if (!mipmaps && configuration.devicePixelRatio != null) {
return BitmapDescriptor._(<dynamic>[
'fromAssetImage',
assetName,
Expand All @@ -104,5 +106,8 @@ class BitmapDescriptor {

final dynamic _json;

@visibleForTesting
dynamic toJson() => _json;

dynamic _toJson() => _json;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: google_maps_flutter
description: A Flutter plugin for integrating Google Maps in iOS and Android applications.
homepage: https://github.com/flutter/plugins/tree/master/packages/google_maps_flutter/google_maps_flutter
version: 0.5.24+1
version: 0.5.25

dependencies:
flutter:
Expand Down
4 changes: 2 additions & 2 deletions packages/in_app_purchase/ios/Tests/Stubs.m
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ - (instancetype)initWithMap:(NSDictionary *)map {
if (self) {
[self setValue:map[@"transactionIdentifier"] forKey:@"transactionIdentifier"];
[self setValue:map[@"transactionState"] forKey:@"transactionState"];
if (map[@"originalTransaction"] && !
[map[@"originalTransaction"] isKindOfClass:[NSNull class]]) {
if (map[@"originalTransaction"] &&
![map[@"originalTransaction"] isKindOfClass:[NSNull class]]) {
[self setValue:[[SKPaymentTransactionStub alloc] initWithMap:map[@"originalTransaction"]]
forKey:@"originalTransaction"];
}
Expand Down