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 501d7919
authored
2026-06-05 13:52:08 +0800
by
tanghuan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
setBartitle指令增加控制setting的参数
1 parent
aa0eb17a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
9 deletions
lib/bloc/web_cubit.dart
lib/data/repositories/message/title_bar_handler.dart
lib/ui/pages/web_page.dart
lib/bloc/web_cubit.dart
View file @
501d791
...
@@ -40,6 +40,7 @@ class WebState extends Equatable {
...
@@ -40,6 +40,7 @@ class WebState extends Equatable {
final
int
titleColor
;
final
int
titleColor
;
final
int
bgColor
;
final
int
bgColor
;
final
String
opIcon
;
final
String
opIcon
;
final
bool
setting
;
final
bool
showAppBar
;
final
bool
showAppBar
;
final
bool
showBottomNavBar
;
final
bool
showBottomNavBar
;
...
@@ -81,6 +82,7 @@ class WebState extends Equatable {
...
@@ -81,6 +82,7 @@ class WebState extends Equatable {
this
.
titleColor
=
0xFFFFFFFF
,
this
.
titleColor
=
0xFFFFFFFF
,
this
.
bgColor
=
0xFF7691FA
,
this
.
bgColor
=
0xFF7691FA
,
this
.
opIcon
=
'none'
,
this
.
opIcon
=
'none'
,
this
.
setting
=
true
,
this
.
showAppBar
=
true
,
this
.
showAppBar
=
true
,
this
.
showBottomNavBar
=
false
,
this
.
showBottomNavBar
=
false
,
this
.
loginOpFlag
=
false
,
this
.
loginOpFlag
=
false
,
...
@@ -109,6 +111,7 @@ class WebState extends Equatable {
...
@@ -109,6 +111,7 @@ class WebState extends Equatable {
int
?
titleColor
,
int
?
titleColor
,
int
?
bgColor
,
int
?
bgColor
,
String
?
opIcon
,
String
?
opIcon
,
bool
?
setting
,
bool
?
showAppBar
,
bool
?
showAppBar
,
bool
?
showBottomNavBar
,
bool
?
showBottomNavBar
,
bool
?
loginOpFlag
,
bool
?
loginOpFlag
,
...
@@ -136,6 +139,7 @@ class WebState extends Equatable {
...
@@ -136,6 +139,7 @@ class WebState extends Equatable {
titleColor:
titleColor
??
this
.
titleColor
,
titleColor:
titleColor
??
this
.
titleColor
,
bgColor:
bgColor
??
this
.
bgColor
,
bgColor:
bgColor
??
this
.
bgColor
,
opIcon:
opIcon
??
this
.
opIcon
,
opIcon:
opIcon
??
this
.
opIcon
,
setting:
setting
??
this
.
setting
,
showAppBar:
showAppBar
??
this
.
showAppBar
,
showAppBar:
showAppBar
??
this
.
showAppBar
,
showBottomNavBar:
showBottomNavBar
??
this
.
showBottomNavBar
,
showBottomNavBar:
showBottomNavBar
??
this
.
showBottomNavBar
,
loginOpFlag:
loginOpFlag
??
this
.
loginOpFlag
,
loginOpFlag:
loginOpFlag
??
this
.
loginOpFlag
,
...
@@ -166,6 +170,7 @@ class WebState extends Equatable {
...
@@ -166,6 +170,7 @@ class WebState extends Equatable {
titleColor
,
titleColor
,
bgColor
,
bgColor
,
opIcon
,
opIcon
,
setting
,
showAppBar
,
showAppBar
,
showBottomNavBar
,
showBottomNavBar
,
sessionCode
,
sessionCode
,
...
@@ -610,11 +615,11 @@ class WebCubit extends Cubit<WebState> with WidgetsBindingObserver {
...
@@ -610,11 +615,11 @@ class WebCubit extends Cubit<WebState> with WidgetsBindingObserver {
_sendResponse
(
resp
);
_sendResponse
(
resp
);
}
}
bool
setTitleBar
(
bool
hidden
,
String
title
,
String
color
,
String
bgColor
,
String
icon
)
{
bool
setTitleBar
(
bool
hidden
,
String
title
,
String
color
,
String
bgColor
,
String
icon
,
bool
setting
)
{
int
parsedTitleColor
=
_hexStringToInt
(
color
);
int
parsedTitleColor
=
_hexStringToInt
(
color
);
int
parsedBgColor
=
_hexStringToInt
(
bgColor
);
int
parsedBgColor
=
_hexStringToInt
(
bgColor
);
emit
(
state
.
copyWith
(
showAppBar:
!
hidden
,
title:
title
,
titleColor:
parsedTitleColor
,
bgColor:
parsedBgColor
,
opIcon:
icon
));
emit
(
state
.
copyWith
(
showAppBar:
!
hidden
,
title:
title
,
titleColor:
parsedTitleColor
,
bgColor:
parsedBgColor
,
opIcon:
icon
,
setting:
setting
));
return
true
;
return
true
;
}
}
...
...
lib/data/repositories/message/title_bar_handler.dart
View file @
501d791
...
@@ -25,8 +25,9 @@ class TitleBarHandler extends MessageHandler {
...
@@ -25,8 +25,9 @@ class TitleBarHandler extends MessageHandler {
final
String
color
=
params
[
'color'
]
as
String
;
final
String
color
=
params
[
'color'
]
as
String
;
final
String
bgColor
=
params
[
'bgColor'
]
as
String
;
final
String
bgColor
=
params
[
'bgColor'
]
as
String
;
final
String
icon
=
params
[
'icon'
]
as
String
;
final
String
icon
=
params
[
'icon'
]
as
String
;
final
bool
setting
=
params
[
'setting'
]
as
bool
?
??
true
;
return
_webCubit
!.
setTitleBar
(
hidden
,
title
,
color
,
bgColor
,
icon
);
return
_webCubit
!.
setTitleBar
(
hidden
,
title
,
color
,
bgColor
,
icon
,
setting
);
}
finally
{
}
finally
{
_unfollowCubit
();
_unfollowCubit
();
}
}
...
...
lib/ui/pages/web_page.dart
View file @
501d791
...
@@ -202,12 +202,14 @@ class WebPage extends StatelessWidget {
...
@@ -202,12 +202,14 @@ class WebPage extends StatelessWidget {
)
)
:
null
),
:
null
),
actions:
[
actions:
[
IconButton
(
state
.
setting
icon:
const
Icon
(
Icons
.
settings
),
?
IconButton
(
onPressed:
()
{
icon:
const
Icon
(
Icons
.
settings
),
router
.
push
(
'/setting'
);
onPressed:
()
{
},
router
.
push
(
'/setting'
);
),
},
)
:
const
SizedBox
.
shrink
(),
],
],
toolbarHeight:
40.0
,
toolbarHeight:
40.0
,
);
);
...
...
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