Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ethan
/
appframe
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit 3f77682b
authored
2026-01-28 14:02:13 +0800
by
tanghuan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
setScreen指令,等待实际处理完成之后再返回结果
1 parent
cf112417
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
lib/data/repositories/message/screen_handler.dart
lib/data/repositories/message/screen_handler.dart
View file @
3f77682
...
@@ -9,28 +9,28 @@ class ScreenHandler extends MessageHandler {
...
@@ -9,28 +9,28 @@ class ScreenHandler extends MessageHandler {
}
}
int
type
=
params
[
'type'
];
int
type
=
params
[
'type'
];
_setOrientation
(
type
);
await
_setOrientation
(
type
);
return
true
;
return
true
;
}
}
void
_setOrientation
(
int
screenType
)
{
Future
<
void
>
_setOrientation
(
int
screenType
)
async
{
if
(
screenType
==
2
)
{
if
(
screenType
==
2
)
{
// 横屏模式
// 横屏模式
SystemChrome
.
setPreferredOrientations
([
await
SystemChrome
.
setPreferredOrientations
([
DeviceOrientation
.
landscapeLeft
,
DeviceOrientation
.
landscapeLeft
,
DeviceOrientation
.
landscapeRight
,
DeviceOrientation
.
landscapeRight
,
]);
]);
// 隐藏状态栏
// 隐藏状态栏
SystemChrome
.
setEnabledSystemUIMode
(
SystemUiMode
.
immersive
);
await
SystemChrome
.
setEnabledSystemUIMode
(
SystemUiMode
.
immersive
);
}
else
{
}
else
{
// 竖屏模式(默认)
// 竖屏模式(默认)
SystemChrome
.
setPreferredOrientations
([
await
SystemChrome
.
setPreferredOrientations
([
DeviceOrientation
.
portraitUp
,
DeviceOrientation
.
portraitUp
,
DeviceOrientation
.
portraitDown
,
DeviceOrientation
.
portraitDown
,
]);
]);
// 显示状态栏
// 显示状态栏
SystemChrome
.
setEnabledSystemUIMode
(
SystemUiMode
.
edgeToEdge
);
await
SystemChrome
.
setEnabledSystemUIMode
(
SystemUiMode
.
edgeToEdge
);
}
}
}
}
}
}
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment