Skip to content
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

【bug!!】ExtendSliverAppBar嵌套PageView时,会重建 #17

Open
onism0106 opened this issue Jun 12, 2023 · 0 comments
Open

【bug!!】ExtendSliverAppBar嵌套PageView时,会重建 #17

onism0106 opened this issue Jun 12, 2023 · 0 comments
Assignees

Comments

@onism0106
Copy link

Content

ExtendedSliverAppbar(
leading: Row(children: [
Visibility(
child: InkWell(
child: Container(
child: Image(
image: AssetImage(
'res/images/idee536ecd91c3436f94a19bbb2fb5f133.png'),
width: 30.0,
height: 30.0,
fit: BoxFit.fill,
),
margin: EdgeInsets.only(left: 16.0),
),
onTap: () {
ActionAssetImage_984c8ff982174315a305c926987f5335()
.onTap(
context,
);
},
),
visible: true,
),
SizedBox(width: 45.0),
]),
title: Obx(() {
return Text(
vm.headerTitle.value,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.w700,
color: Color(0xff1f1f1f),
),
);
}),
background: AspectRatio(
aspectRatio: 375 / 281,
child: EasyRefresh(
controller: vm.refreshController,
child: Stack(
alignment: AlignmentDirectional.bottomEnd,
children: [
Obx(() {
return PageView(
children:
_build1d6dc7c0c2764a5090ebe6702a68d105PageViewChildren(
context,
),
controller: vm.bannerController,
onPageChanged: (pageIndex) {
ActionPageView_1d6dc7c0c2764a5090ebe6702a68d105()
.onPageChanged(context, pageIndex);
},
);
}),
Obx(() {
return Visibility(
child: Container(
child: Obx(() {
return ToggleSwitch(
initialLabelIndex: vm.pageViewPosition.value,
minWidth: 50.0,
minHeight: 18.0,
cornerRadius: 14.0,
radiusStyle: true,
inactiveBgColor: Color(0x80e0e0e0),
inactiveFgColor: Color(0xff1f1f1f),
activeFgColor: Color(0xffffffff),
fontSize: 12.0,
activeBgColor: [Color(0xffff6644)],
labels: [
'直播',
'图片',
],
onToggle: (toggleIndex) {
ActionToggleSwitch_9ea5049cd0d74da0b1046ee3e6fce0a0()
.onToggle(context, toggleIndex);
},
);
}),
margin: EdgeInsets.only(
right: 20.0,
bottom: 15.0,
),
),
visible: vm.showToggleSwitch.value,
);
}),
],
),
onLoad: () {
ActionRefresh_97927526f84646b1a8958b759320409a().onLoad(
context,
);
},
),
),
actions: Row(children: [
Container(
child: Image(
image: AssetImage(
'res/images/idb69528cd0292479ea5088ac9d3d77f60.png'),
width: 30.0,
height: 30.0,
fit: BoxFit.fill,
),
margin: EdgeInsets.only(right: 15.0),
),
Container(
child: Image(
image: AssetImage(
'res/images/id43e8a5b5ca234d6a8f4aeadbe026b301.png'),
width: 30.0,
height: 30.0,
fit: BoxFit.fill,
),
margin: EdgeInsets.only(right: 12.0),
),
]),
toolBarColor: Color(0xffffffff),
),

调用PageView的controller去改变页面时,会报异常:一个controller绑定到了多个PageView上,经检查是PageView重建了,用系统的SliverAppBar无此问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants