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

Commit 94caf49

Browse files
committed
Merged with master
2 parents e7faef3 + 2919660 commit 94caf49

File tree

204 files changed

+3315
-2170
lines changed

Some content is hidden

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

204 files changed

+3315
-2170
lines changed

.cirrus.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ task:
1414
- flutter channel master
1515
- flutter upgrade
1616
- git fetch origin master
17+
submodules_script:
18+
- git submodule init
19+
- git submodule update
1720
matrix:
1821
- name: publishable
1922
script:
@@ -121,6 +124,9 @@ task:
121124
- flutter channel master
122125
- flutter upgrade
123126
- git fetch origin master
127+
submodules_script:
128+
- git submodule init
129+
- git submodule update
124130
matrix:
125131
- name: build-linux+drive-examples
126132
install_script:
@@ -145,6 +151,9 @@ task:
145151
- flutter channel master
146152
- flutter upgrade
147153
- git fetch origin master
154+
submodules_script:
155+
- git submodule init
156+
- git submodule update
148157
create_simulator_script:
149158
- xcrun simctl list
150159
- xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-11 com.apple.CoreSimulator.SimRuntime.iOS-14-3 | xargs xcrun simctl boot
@@ -198,6 +207,9 @@ task:
198207
- flutter channel master
199208
- flutter upgrade
200209
- git fetch origin master
210+
submodules_script:
211+
- git submodule init
212+
- git submodule update
201213
create_simulator_script:
202214
- xcrun simctl list
203215
- xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-X com.apple.CoreSimulator.SimRuntime.iOS-13-3 | xargs xcrun simctl boot
@@ -227,6 +239,9 @@ task:
227239
- flutter channel master
228240
- flutter upgrade
229241
- git fetch origin master
242+
submodules_script:
243+
- git submodule init
244+
- git submodule update
230245
matrix:
231246
- name: build_all_plugins_app
232247
script:

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "script/plugin_tools"]
2+
path = script/plugin_tools
3+
url = https://github.com/flutter/plugin_tools.git

CODEOWNERS

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,12 @@
44
# These names are just suggestions. It is fine to have your changes
55
# reviewed by someone else.
66

7-
packages/android_alarm_manager/** @bkonyi
8-
packages/android_intent/** @mklim @matthew-carroll
9-
packages/battery/** @matthew-carroll
7+
108
packages/camera/** @bparrishMines
11-
packages/connectivity/** @matthew-carroll
129
packages/cross_file/** @ditman @mvanbeusekom
13-
packages/device_info/** @matthew-carroll
14-
packages/espresso/** @collinjackson @adazh
1510
packages/file_selector/** @ditman
1611
packages/google_maps_flutter/** @cyanglaz
17-
packages/google_sign_in/** @mehmetf
1812
packages/image_picker/** @cyanglaz
1913
packages/integration_test/** @dnfield
20-
packages/in_app_purchase/** @mklim @cyanglaz @LHLL
14+
packages/in_app_purchase/** @cyanglaz @LHLL
2115
packages/ios_platform_images/** @gaaclarke
22-
packages/package_info/** @matthew-carroll
23-
packages/path_provider/** @matthew-carroll
24-
packages/shared_preferences/** @matthew-carroll
25-
packages/url_launcher/** @mklim
26-
packages/video_player/** @iskakaushik

CONTRIBUTING.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,25 @@
55

66
_See also: [Flutter's code of conduct](https://github.com/flutter/flutter/blob/master/CODE_OF_CONDUCT.md)_
77

8+
## Important note
9+
10+
As of January 2021, we are no longer accepting non-critical PRs for plugins
11+
for which there is a corresponding [Flutter Community Plus
12+
Plugin](https://plus.fluttercommunity.dev/), as we hope in time to be able
13+
to transition users to those versions of the plugins. If you have a PR for
14+
something other than a critical issue (crashes, build failures, null safety, etc.)
15+
for any of the following plugins, we encourage you to submit it
16+
[there](https://github.com/fluttercommunity/plus_plugins/pulls) instead:
17+
- `android_alarm_manager`
18+
- `android_intent`
19+
- `battery`
20+
- `connectivity`
21+
- `device_info`
22+
- `package_info`
23+
- `sensors`
24+
- `share`
25+
- `wifi_info_flutter` (corresponds to `network_info_plus`)
26+
827
## Things you will need
928

1029

packages/camera/camera/CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
# 0.7.0+3
1+
## 0.7.0+3
22

3-
* Revert compileSdkVersion back to 29 (from 30) as this is causing problems with add-to-app configurations.
3+
* Clockwise rotation of focus point in android
44

55
## 0.7.0+2
66

77
* Fix example reference in README.
8+
* Revert compileSdkVersion back to 29 (from 30) as this is causing problems with add-to-app configurations.
89

910
## 0.7.0+1
1011

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ public void setExposurePoint(@NonNull final Result result, Double x, Double y)
786786
}
787787
// Set the metering rectangle
788788
if (x == null || y == null) cameraRegions.resetAutoExposureMeteringRectangle();
789-
else cameraRegions.setAutoExposureMeteringRectangleFromPoint(x, y);
789+
else cameraRegions.setAutoExposureMeteringRectangleFromPoint(y, 1 - x);
790790
// Apply it
791791
updateExposure(exposureMode);
792792
refreshPreviewCaptureSession(
@@ -838,7 +838,7 @@ public void setFocusPoint(@NonNull final Result result, Double x, Double y)
838838
if (x == null || y == null) {
839839
cameraRegions.resetAutoFocusMeteringRectangle();
840840
} else {
841-
cameraRegions.setAutoFocusMeteringRectangleFromPoint(x, y);
841+
cameraRegions.setAutoFocusMeteringRectangleFromPoint(y, 1 - x);
842842
}
843843

844844
// Apply the new metering rectangle

packages/camera/camera_platform_interface/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
- Migrate to null safety.
44

5+
## 1.6.0
6+
7+
- Added VideoRecordedEvent to support ending a video recording in the native implementation.
8+
59
## 1.5.0
610

711
- Introduces interface methods for locking and unlocking the capture orientation.

packages/camera/camera_platform_interface/lib/src/events/camera_event.dart

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,3 +235,49 @@ class CameraErrorEvent extends CameraEvent {
235235
@override
236236
int get hashCode => super.hashCode ^ description.hashCode;
237237
}
238+
239+
/// An event fired when a video has finished recording.
240+
class VideoRecordedEvent extends CameraEvent {
241+
/// XFile of the recorded video.
242+
final XFile file;
243+
244+
/// Maximum duration of the recorded video.
245+
final Duration? maxVideoDuration;
246+
247+
/// Build a VideoRecordedEvent triggered from the camera with the `cameraId`.
248+
///
249+
/// The `file` represents the file of the video.
250+
/// The `maxVideoDuration` shows if a maxVideoDuration shows if a maximum
251+
/// video duration was set.
252+
VideoRecordedEvent(int cameraId, this.file, this.maxVideoDuration)
253+
: super(cameraId);
254+
255+
/// Converts the supplied [Map] to an instance of the [VideoRecordedEvent]
256+
/// class.
257+
VideoRecordedEvent.fromJson(Map<String, dynamic> json)
258+
: file = XFile(json['path']),
259+
maxVideoDuration = json['maxVideoDuration'] != null
260+
? Duration(milliseconds: json['maxVideoDuration'] as int)
261+
: null,
262+
super(json['cameraId']);
263+
264+
/// Converts the [VideoRecordedEvent] instance into a [Map] instance that can be
265+
/// serialized to JSON.
266+
Map<String, dynamic> toJson() => {
267+
'cameraId': cameraId,
268+
'path': file.path,
269+
'maxVideoDuration': maxVideoDuration?.inMilliseconds
270+
};
271+
272+
@override
273+
bool operator ==(Object other) =>
274+
identical(this, other) ||
275+
super == other &&
276+
other is VideoRecordedEvent &&
277+
runtimeType == other.runtimeType &&
278+
maxVideoDuration == other.maxVideoDuration;
279+
280+
@override
281+
int get hashCode =>
282+
super.hashCode ^ file.hashCode ^ maxVideoDuration.hashCode;
283+
}

packages/camera/camera_platform_interface/lib/src/method_channel/method_channel_camera.dart

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class MethodChannelCamera extends CameraPlatform {
5959
@override
6060
Future<List<CameraDescription>> availableCameras() async {
6161
try {
62-
final cameras = await _channel
62+
final List<Map<dynamic, dynamic>>? cameras = await _channel
6363
.invokeListMethod<Map<dynamic, dynamic>>('availableCameras');
6464

6565
if (cameras == null) {
@@ -82,7 +82,7 @@ class MethodChannelCamera extends CameraPlatform {
8282
Future<int> createCamera(
8383
CameraDescription cameraDescription,
8484
ResolutionPreset? resolutionPreset, {
85-
bool enableAudio = true,
85+
bool enableAudio = false,
8686
}) async {
8787
try {
8888
final reply = await _channel
@@ -163,6 +163,11 @@ class MethodChannelCamera extends CameraPlatform {
163163
return _cameraEvents(cameraId).whereType<CameraErrorEvent>();
164164
}
165165

166+
@override
167+
Stream<VideoRecordedEvent> onVideoRecordedEvent(int cameraId) {
168+
return _cameraEvents(cameraId).whereType<VideoRecordedEvent>();
169+
}
170+
166171
@override
167172
Stream<DeviceOrientationChangedEvent> onDeviceOrientationChanged() {
168173
return deviceEventStreamController.stream
@@ -480,6 +485,15 @@ class MethodChannelCamera extends CameraPlatform {
480485
cameraId,
481486
));
482487
break;
488+
case 'video_recorded':
489+
cameraEventStreamController.add(VideoRecordedEvent(
490+
cameraId,
491+
XFile(call.arguments['path']),
492+
call.arguments['maxVideoDuration'] != null
493+
? Duration(milliseconds: call.arguments['maxVideoDuration'])
494+
: null,
495+
));
496+
break;
483497
case 'error':
484498
cameraEventStreamController.add(CameraErrorEvent(
485499
cameraId,

packages/camera/camera_platform_interface/lib/src/platform_interface/camera_platform.dart

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ abstract class CameraPlatform extends PlatformInterface {
4444
}
4545

4646
/// Completes with a list of available cameras.
47+
///
48+
/// This method returns an empty list when no cameras are available.
4749
Future<List<CameraDescription>> availableCameras() {
4850
throw UnimplementedError('availableCameras() is not implemented.');
4951
}
@@ -52,7 +54,7 @@ abstract class CameraPlatform extends PlatformInterface {
5254
Future<int> createCamera(
5355
CameraDescription cameraDescription,
5456
ResolutionPreset? resolutionPreset, {
55-
bool enableAudio = true,
57+
bool enableAudio = false,
5658
}) {
5759
throw UnimplementedError('createCamera() is not implemented.');
5860
}
@@ -89,6 +91,11 @@ abstract class CameraPlatform extends PlatformInterface {
8991
throw UnimplementedError('onCameraError() is not implemented.');
9092
}
9193

94+
/// The camera finished recording a video
95+
Stream<VideoRecordedEvent> onVideoRecordedEvent(int cameraId) {
96+
throw UnimplementedError('onCameraTimeLimitReached() is not implemented.');
97+
}
98+
9299
/// The device orientation changed.
93100
///
94101
/// Implementations for this:
@@ -125,7 +132,8 @@ abstract class CameraPlatform extends PlatformInterface {
125132
/// The length of the recording can be limited by specifying the [maxVideoDuration].
126133
/// By default no maximum duration is specified,
127134
/// meaning the recording will continue until manually stopped.
128-
/// The video is returned as a [XFile] after calling [stopVideoRecording].
135+
/// With [maxVideoDuration] set the video is returned in a [VideoRecordedEvent]
136+
/// through the [onVideoRecordedEvent] stream when the set duration is reached.
129137
Future<void> startVideoRecording(int cameraId, {Duration? maxVideoDuration}) {
130138
throw UnimplementedError('startVideoRecording() is not implemented.');
131139
}

0 commit comments

Comments
 (0)