This repository has been archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[camera] Switch to internal method channels #5943
Merged
fluttergithubbot
merged 10 commits into
flutter:main
from
stuartmorgan:camera-internal-method-channels
Jun 13, 2022
Merged
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c814bea
Direct copy of platform interface files
stuartmorgan 4ab4362
Renaming, fixing up imports
stuartmorgan 6f87d8e
Remove unnecessary test group (mostly whitespace change)
stuartmorgan cdd5a13
Rename channels, add registration
stuartmorgan 634d9d9
Fix CODEOWNERS
stuartmorgan 5dfb4bc
Version bumps
stuartmorgan 942f863
Clean up unnecessary platform checks
stuartmorgan 0a40ef4
Merge branch 'main' into camera-internal-method-channels
stuartmorgan d30f0be
Missing dependencies
stuartmorgan 23e9a5d
Register for integration tests
stuartmorgan 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 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 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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## 0.9.8 | ||
|
||
* Switches to internal method channel implementation. | ||
|
||
## 0.9.7+1 | ||
|
||
* Splits from `camera` as a federated implementation. |
This file contains 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 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 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
export 'src/android_camera.dart'; |
Oops, something went wrong.
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.
is it part of the effort that move logic from platform to dart?
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.
Renaming the method channels is to prevent a mistake I made in one early case where I didn't actually set up Dart registration correctly, but didn't notice because the platform-specific and shared method channels were still identical, so everything (temporarily) worked. That would have cause problems later as the implementations started to diverge, but it would have been very hard to debug. This causes any such mistake to be obvious immediately.
It's also proved useful for some edge cases. E.g., debugging issues with people running plugins in isolates, where there's no Dart auto-registration. This means they fail with an error message that we can easily see a root cause for, rather than having subtle breakage like a mismatch in arguments as channel implementations start to diverge.
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.
Gotcha. Are we moving towards a world where ideally the platform native code simply one-line adapts native API, so channel method names and params likely diverge across multiple platforms in that world?
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.
That's a direction we're exploring (currently with webview), but it's not the only outcome where this is useful. The design doc linked from the associated bug has a discussion of the the benefits here.
Recent examples of places where just having flexibility helped us include: