forked from flutter/plugins
-
Notifications
You must be signed in to change notification settings - Fork 9
Updated platform interface to have recording methods return XFile instances #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mvanbeusekom
merged 8 commits into
camera_federated
from
subpr/camera_federated/platform-interface-xfile
Nov 13, 2020
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
613a92b
Updated platform interface to have recording methods return XFile ins…
BeMacized 247d9c9
Update documentation and unit tests to match platform interface changes
BeMacized 51c25b5
Make file input optional for recording methods in platform interface.…
BeMacized 1b06322
Add missing full stop in docs.
BeMacized 8e94057
Run dartfmt. Wrapped docs after max 80 cols. Added missing full stop.
BeMacized 96bccd4
Updated platform interface
BeMacized 79b58c8
Update packages/camera/camera_platform_interface/lib/src/platform_int…
BeMacized 6c32fa9
Update packages/camera/camera_platform_interface/lib/src/platform_int…
BeMacized File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,6 +4,7 @@ | |||||||||||
|
|
||||||||||||
| import 'dart:async'; | ||||||||||||
|
|
||||||||||||
| import 'package:file_selector_platform_interface/file_selector_platform_interface.dart'; | ||||||||||||
| import 'package:flutter/widgets.dart'; | ||||||||||||
| import 'package:plugin_platform_interface/plugin_platform_interface.dart'; | ||||||||||||
| import 'package:camera_platform_interface/src/method_channel/method_channel_camera.dart'; | ||||||||||||
|
|
@@ -66,8 +67,9 @@ abstract class CameraPlatform extends PlatformInterface { | |||||||||||
| throw UnimplementedError('onCameraError() is not implemented.'); | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| /// Captures an image and saves it to [path]. | ||||||||||||
| Future<void> takePicture(int cameraId, String path) { | ||||||||||||
| /// Captures an image and returns the file where it was saved. | ||||||||||||
| /// If no [file] parameter is provided, the file returned will be in a temporary location. | ||||||||||||
| Future<XFile> takePicture(int cameraId, { XFile file }) { | ||||||||||||
| throw UnimplementedError('takePicture() is not implemented.'); | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
|
|
@@ -76,20 +78,19 @@ abstract class CameraPlatform extends PlatformInterface { | |||||||||||
| throw UnimplementedError('prepareForVideoRecording() is not implemented.'); | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| /// Start a video recording and save the file to [path]. | ||||||||||||
| /// Starts a video recording | ||||||||||||
| /// | ||||||||||||
| /// A path can for example be obtained using | ||||||||||||
| /// [path_provider](https://pub.dartlang.org/packages/path_provider). | ||||||||||||
| /// If no [file] parameter is provided, the recording will be saved to a new file in a temporary location. | ||||||||||||
|
||||||||||||
| /// If no [file] parameter is provided, the recording will be saved to a new file in a temporary location. | |
| /// If no [file] parameter is provided, the recording will be saved to a new | |
| /// file in a temporary location. |
Outdated
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Wrap the documentation at 80 characters:
Suggested change
| /// If a file already exists at the path for the provided file instance, an error will be thrown. | |
| /// The file can be read as soon as [stopVideoRecording] returns it. | |
| /// If a file already exists at the path for the provided file instance, an | |
| /// error will be thrown. | |
| /// The file can be read as soon as [stopVideoRecording] returns it. |
BeMacized marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
BeMacized marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: missing a . after the sentence: