forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Refactor PlatformChannel #163
Merged
swift-kim
merged 1 commit into
flutter-tizen:flutter-2.2.1-tizen
from
swift-kim:refactor-platform-channel
Aug 4, 2021
Merged
Refactor PlatformChannel #163
swift-kim
merged 1 commit into
flutter-tizen:flutter-2.2.1-tizen
from
swift-kim:refactor-platform-channel
Aug 4, 2021
Conversation
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
The test code I used for testing: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
ElevatedButton(
onPressed: () async {
var data = await Clipboard.getData(Clipboard.kTextPlain);
print(data?.text ?? 'null');
},
child: Text('Clipboard.getData'),
),
ElevatedButton(
onPressed: () async {
await Clipboard.setData(
ClipboardData(text: 'Counter: $_counter'));
_counter++;
},
child: Text('Clipboard.setData'),
),
ElevatedButton(
onPressed: () async {
await SystemSound.play(SystemSoundType.alert);
},
child: Text('SystemSound.play (alert)'),
),
ElevatedButton(
onPressed: () async {
await SystemSound.play(SystemSoundType.click);
},
child: Text('SystemSound.play (click)'),
),
ElevatedButton(
onPressed: () async {
await HapticFeedback.vibrate();
print('brrr!');
},
child: Text('HapticFeedback.vibrate'),
),
ElevatedButton(
onPressed: () async {
await SystemNavigator.pop();
},
child: Text('SystemNavigator.pop'),
),
ElevatedButton(
onPressed: () async {
_landscape = !_landscape;
await SystemChrome.setPreferredOrientations(<DeviceOrientation>[
if (_landscape) DeviceOrientation.landscapeLeft,
]);
print('landscape = $_landscape');
},
child: Text('SystemChrome.setPreferredOrientations'),
),
],
), |
bbrto21
approved these changes
Aug 3, 2021
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.
LGTM
Closed
bwikbs
approved these changes
Aug 4, 2021
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.
Goooood!! 👍
918d4c5
to
4c2cbf0
Compare
swift-kim
added a commit
that referenced
this pull request
Sep 27, 2021
swift-kim
added a commit
that referenced
this pull request
Nov 14, 2021
swift-kim
added a commit
that referenced
this pull request
Dec 9, 2021
swift-kim
added a commit
that referenced
this pull request
Dec 17, 2021
swift-kim
added a commit
that referenced
this pull request
Feb 7, 2022
swift-kim
added a commit
that referenced
this pull request
Feb 11, 2022
swift-kim
added a commit
that referenced
this pull request
May 12, 2022
swift-kim
added a commit
that referenced
this pull request
Aug 5, 2022
swift-kim
pushed a commit
that referenced
this pull request
Sep 1, 2022
swift-kim
added a commit
that referenced
this pull request
Sep 1, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Before:
platform_channel.cc
&platform_channel_stub.cc
After:
platform_channel.cc
: Common code that processes arguments and sends results.platform_channel_tizen.cc
: Tizen-specific implementation.platform_channel_linux.cc
: Linux desktop implementation.Notable changes:
PlatformChannel
class. Thus,clipboard::GetData
andclipboard::SetData
are no longer required.FeedbackManager
has been refactored for simplicity and readability.SystemSound
andHapticFeedback
no longer throw exceptions. Errors are logged to the console viaFT_LOG(Error)
.