Skip to content

Commit 51c25b5

Browse files
committed
Make file input optional for recording methods in platform interface. Update docs.
1 parent 247d9c9 commit 51c25b5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ abstract class CameraPlatform extends PlatformInterface {
6767
throw UnimplementedError('onCameraError() is not implemented.');
6868
}
6969

70-
/// Captures an image and returns the file where it was saved
71-
Future<XFile> takePicture(int cameraId) {
70+
/// Captures an image and returns the file where it was saved.
71+
/// If no [file] parameter is provided, the file returned will be in a temporary location.
72+
Future<XFile> takePicture(int cameraId, { XFile file }) {
7273
throw UnimplementedError('takePicture() is not implemented.');
7374
}
7475

@@ -79,10 +80,12 @@ abstract class CameraPlatform extends PlatformInterface {
7980

8081
/// Starts a video recording
8182
///
83+
/// If no [file] parameter is provided, the recording will be saved to a new file in a temporary location.
84+
///
8285
/// The file is written on the flight as the video is being recorded.
83-
/// If a file already exists at the provided path an error will be thrown.
86+
/// If a file already exists at the path for the provided file instance, an error will be thrown.
8487
/// The file can be read as soon as [stopVideoRecording] returns it.
85-
Future<void> startVideoRecording(int cameraId) {
88+
Future<XFile> startVideoRecording(int cameraId, { XFile file }) {
8689
throw UnimplementedError('startVideoRecording() is not implemented.');
8790
}
8891

0 commit comments

Comments
 (0)