44
55import 'dart:async' ;
66
7+ import 'package:camera_platform_interface/src/method_channel/method_channel_camera.dart' ;
8+ import 'package:file_selector_platform_interface/file_selector_platform_interface.dart' ;
79import 'package:flutter/widgets.dart' ;
810import 'package:plugin_platform_interface/plugin_platform_interface.dart' ;
9- import 'package:camera_platform_interface/src/method_channel/method_channel_camera.dart' ;
1011
1112import '../../camera_platform_interface.dart' ;
1213
@@ -66,8 +67,8 @@ abstract class CameraPlatform extends PlatformInterface {
6667 throw UnimplementedError ('onCameraError() is not implemented.' );
6768 }
6869
69- /// Captures an image and saves it to [path] .
70- Future <void > takePicture (int cameraId, String path ) {
70+ /// Captures an image and returns the file where it was saved .
71+ Future <XFile > takePicture (int cameraId) {
7172 throw UnimplementedError ('takePicture() is not implemented.' );
7273 }
7374
@@ -76,19 +77,19 @@ abstract class CameraPlatform extends PlatformInterface {
7677 throw UnimplementedError ('prepareForVideoRecording() is not implemented.' );
7778 }
7879
79- /// Start a video recording and save the file to [path] .
80- ///
81- /// A path can for example be obtained using
82- /// [path_provider] (https://pub.dartlang.org/packages/path_provider).
80+ /// Starts a video recording and returns the file where it will be saved.
8381 ///
8482 /// The file is written on the flight as the video is being recorded.
85- /// If a file already exists at the provided path an error will be thrown.
8683 /// The file can be read as soon as [stopVideoRecording] returns.
87- Future <void > startVideoRecording (int cameraId, String path ) {
84+ Future <XFile > startVideoRecording (int cameraId) {
8885 throw UnimplementedError ('startVideoRecording() is not implemented.' );
8986 }
9087
91- /// Stop the video recording.
88+ /// Stops the video recording.
89+ ///
90+ /// When the [stopVideoRecording] method completes successfully the recorded
91+ /// video can be accessed through the file returned by the
92+ /// [startVideoRecording] method.
9293 Future <void > stopVideoRecording (int cameraId) {
9394 throw UnimplementedError ('stopVideoRecording() is not implemented.' );
9495 }
0 commit comments