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 f3b50cf6
authored
2026-05-08 11:17:02 +0800
by
tanghuan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
setTitlebar指令,隐藏标题栏时,将状态栏设为透明背景
1 parent
f5e5ece6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
lib/ui/pages/web_page.dart
lib/ui/pages/web_page.dart
View file @
f3b50cf
...
@@ -5,6 +5,7 @@ import 'package:appframe/config/env_config.dart';
...
@@ -5,6 +5,7 @@ import 'package:appframe/config/env_config.dart';
import
'package:appframe/config/locator.dart'
;
import
'package:appframe/config/locator.dart'
;
import
'package:appframe/config/routes.dart'
;
import
'package:appframe/config/routes.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
import
'package:flutter_bloc/flutter_bloc.dart'
;
import
'package:flutter_bloc/flutter_bloc.dart'
;
import
'package:go_router/go_router.dart'
;
import
'package:go_router/go_router.dart'
;
import
'package:shared_preferences/shared_preferences.dart'
;
import
'package:shared_preferences/shared_preferences.dart'
;
...
@@ -118,9 +119,20 @@ class WebPage extends StatelessWidget {
...
@@ -118,9 +119,20 @@ class WebPage extends StatelessWidget {
:
null
,
:
null
,
);
);
final
child
=
state
.
showAppBar
?
scaffold
:
AnnotatedRegion
<
SystemUiOverlayStyle
>(
value:
const
SystemUiOverlayStyle
(
statusBarColor:
Colors
.
transparent
,
// 设置状态栏背景透明
statusBarIconBrightness:
Brightness
.
dark
,
statusBarBrightness:
Brightness
.
light
,
),
child:
scaffold
,
);
// ios 不使用 PopScope
// ios 不使用 PopScope
if
(
Platform
.
isIOS
)
{
if
(
Platform
.
isIOS
)
{
return
scaffo
ld
;
return
chi
ld
;
}
}
return
PopScope
(
return
PopScope
(
...
@@ -131,7 +143,7 @@ class WebPage extends StatelessWidget {
...
@@ -131,7 +143,7 @@ class WebPage extends StatelessWidget {
}
}
ctx
.
read
<
WebCubit
>().
handleBack
();
ctx
.
read
<
WebCubit
>().
handleBack
();
},
},
child:
scaffo
ld
,
child:
chi
ld
,
);
);
},
},
listener:
(
context
,
state
)
{
listener:
(
context
,
state
)
{
...
...
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