Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 151b47d

Browse files
committed
Merge branch 'master' into navigation_delegate
2 parents 530d024 + 45cc819 commit 151b47d

File tree

68 files changed

+1512
-662
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1512
-662
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ Tuyển Vũ Xuân <[email protected]>
2525
Sarthak Verma <[email protected]>
2626
Mike Diarmid <[email protected]>
2727
Invertase <[email protected]>
28+
Elliot Hesp <[email protected]>

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Contributing to Flutter
22
=======================
33

4-
[![Build Status](https://travis-ci.org/flutter/plugins.svg)](https://travis-ci.org/flutter/plugins)
4+
[![Build Status](https://api.cirrus-ci.com/github/flutter/plugins.svg)](https://cirrus-ci.com/github/flutter/plugins/master)
55

66
_See also: [Flutter's code of conduct](https://flutter.io/design-principles/#code-of-conduct)_
77

packages/camera/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.4.2
2+
3+
* Add sensor orientation value to `CameraDescription`.
4+
15
## 0.4.1
26

37
* Camera methods are ran in a background thread on iOS.

packages/camera/android/src/main/java/io/flutter/plugins/camera/CameraPlugin.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ public void onMethodCall(MethodCall call, final Result result) {
164164
cameraManager.getCameraCharacteristics(cameraName);
165165
details.put("name", cameraName);
166166
@SuppressWarnings("ConstantConditions")
167+
int sensorOrientation = characteristics.get(CameraCharacteristics.SENSOR_ORIENTATION);
168+
details.put("sensorOrientation", sensorOrientation);
169+
167170
int lensFacing = characteristics.get(CameraCharacteristics.LENS_FACING);
168171
switch (lensFacing) {
169172
case CameraMetadata.LENS_FACING_FRONT:

packages/camera/ios/Classes/CameraPlugin.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,7 @@ - (void)handleMethodCallAsync:(FlutterMethodCall *)call result:(FlutterResult)re
670670
[reply addObject:@{
671671
@"name" : [device uniqueID],
672672
@"lensFacing" : lensFacing,
673+
@"sensorOrientation" : @90,
673674
}];
674675
}
675676
result(reply);

packages/camera/lib/camera.dart

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Future<List<CameraDescription>> availableCameras() async {
5858
return CameraDescription(
5959
name: camera['name'],
6060
lensDirection: _parseCameraLensDirection(camera['lensFacing']),
61+
sensorOrientation: camera['sensorOrientation'],
6162
);
6263
}).toList();
6364
} on PlatformException catch (e) {
@@ -66,11 +67,20 @@ Future<List<CameraDescription>> availableCameras() async {
6667
}
6768

6869
class CameraDescription {
69-
CameraDescription({this.name, this.lensDirection});
70+
CameraDescription({this.name, this.lensDirection, this.sensorOrientation});
7071

7172
final String name;
7273
final CameraLensDirection lensDirection;
7374

75+
/// Clockwise angle through which the output image needs to be rotated to be upright on the device screen in its native orientation.
76+
///
77+
/// **Range of valid values:**
78+
/// 0, 90, 180, 270
79+
///
80+
/// On Android, also defines the direction of rolling shutter readout, which
81+
/// is from top to bottom in the sensor's coordinate system.
82+
final int sensorOrientation;
83+
7484
@override
7585
bool operator ==(Object o) {
7686
return o is CameraDescription &&
@@ -85,7 +95,7 @@ class CameraDescription {
8595

8696
@override
8797
String toString() {
88-
return '$runtimeType($name, $lensDirection)';
98+
return '$runtimeType($name, $lensDirection, $sensorOrientation)';
8999
}
90100
}
91101

packages/camera/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: camera
22
description: A Flutter plugin for getting information about and controlling the
33
camera on Android and iOS. Supports previewing the camera feed, capturing images, capturing video,
44
and streaming image buffers to dart.
5-
version: 0.4.1
5+
version: 0.4.2
66
authors:
77
- Flutter Team <[email protected]>
88
- Luigi Agosti <[email protected]>

packages/cloud_functions/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 0.1.2
2+
3+
* Specifying a version for Cloud Functions CocoaPod dependency to prevent build errors on iOS.
4+
* Fix on iOS when using a null region.
5+
* Upgrade the firebase_core dependency of the example app.
6+
17
## 0.1.1+1
28

39
* Log messages about automatic configuration of the default app are now less confusing.

packages/cloud_functions/example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dependencies:
99
cupertino_icons: ^0.1.2
1010
cloud_functions:
1111
path: ..
12-
firebase_core: 0.3.0
12+
firebase_core: ^0.3.1
1313

1414
dev_dependencies:
1515
flutter_test:

packages/cloud_functions/ios/Classes/CloudFunctionsPlugin.m

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -41,42 +41,42 @@ - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result
4141
NSString *region = call.arguments[@"region"];
4242
FIRApp *app = [FIRApp appNamed:appName];
4343
FIRFunctions *functions;
44-
if (region != nil) {
44+
if (region != nil && region != (id)[NSNull null]) {
4545
functions = [FIRFunctions functionsForApp:app region:region];
4646
} else {
4747
functions = [FIRFunctions functionsForApp:app];
4848
}
49-
[functions callFunction:functionName
50-
withObject:parameters
51-
completion:^(FIRHTTPSCallableResult *callableResult, NSError *error) {
52-
if (error) {
53-
FlutterError *flutterError;
54-
if (error.domain == FIRFunctionsErrorDomain) {
55-
NSDictionary *details = [NSMutableDictionary dictionary];
56-
[details setValue:[self mapFunctionsErrorCodes:error.code] forKey:@"code"];
57-
if (error.localizedDescription != nil) {
58-
[details setValue:error.localizedDescription forKey:@"message"];
59-
}
60-
if (error.userInfo[FIRFunctionsErrorDetailsKey] != nil) {
61-
[details setValue:error.userInfo[FIRFunctionsErrorDetailsKey]
62-
forKey:@"details"];
63-
}
49+
FIRHTTPSCallable *function = [functions HTTPSCallableWithName:functionName];
50+
[function callWithObject:parameters
51+
completion:^(FIRHTTPSCallableResult *callableResult, NSError *error) {
52+
if (error) {
53+
FlutterError *flutterError;
54+
if (error.domain == FIRFunctionsErrorDomain) {
55+
NSDictionary *details = [NSMutableDictionary dictionary];
56+
[details setValue:[self mapFunctionsErrorCodes:error.code] forKey:@"code"];
57+
if (error.localizedDescription != nil) {
58+
[details setValue:error.localizedDescription forKey:@"message"];
59+
}
60+
if (error.userInfo[FIRFunctionsErrorDetailsKey] != nil) {
61+
[details setValue:error.userInfo[FIRFunctionsErrorDetailsKey]
62+
forKey:@"details"];
63+
}
6464

65-
flutterError =
66-
[FlutterError errorWithCode:@"functionsError"
67-
message:@"Firebase function failed with exception."
68-
details:details];
69-
} else {
70-
flutterError = [FlutterError
71-
errorWithCode:[NSString stringWithFormat:@"%ld", error.code]
72-
message:error.localizedDescription
73-
details:nil];
74-
}
75-
result(flutterError);
76-
} else {
77-
result(callableResult.data);
78-
}
79-
}];
65+
flutterError =
66+
[FlutterError errorWithCode:@"functionsError"
67+
message:@"Firebase function failed with exception."
68+
details:details];
69+
} else {
70+
flutterError = [FlutterError
71+
errorWithCode:[NSString stringWithFormat:@"%ld", error.code]
72+
message:error.localizedDescription
73+
details:nil];
74+
}
75+
result(flutterError);
76+
} else {
77+
result(callableResult.data);
78+
}
79+
}];
8080
} else {
8181
result(FlutterMethodNotImplemented);
8282
}

0 commit comments

Comments
 (0)