Flutter 强制屏幕顶部';当向下滚动列表视图时,控件将继续显示
请问,当我向下滚动listview时,如何强制屏幕顶部不消失? 正如你在这张照片中看到的 当我向下滚动ListView时,包含播放器小部件的顶部将消失 那么,当我向下滚动Listview时,我该如何强制顶部的小部件继续显示呢Flutter 强制屏幕顶部';当向下滚动列表视图时,控件将继续显示,flutter,listview,dart,Flutter,Listview,Dart,请问,当我向下滚动listview时,如何强制屏幕顶部不消失? 正如你在这张照片中看到的 当我向下滚动ListView时,包含播放器小部件的顶部将消失 那么,当我向下滚动Listview时,我该如何强制顶部的小部件继续显示呢 Scaffold( body: Container( child: ListView( shrinkWrap: true, children: <Widget>[
Scaffold(
body: Container(
child: ListView(
shrinkWrap: true,
children: <Widget>[
Center(
child: Container(
width: 200.0,
height: 150.0,
child: Stack(
children: <Widget>[
Container(
decoration: BoxDecoration(
color:Color(0xff193451).withOpacity(.5),
shape: BoxShape.circle),
child: Padding(
padding: const EdgeInsets.all(.0),
child: _buildRadialSeekBar(),
),
),
Center(
child: Container(
width: 150.0,
height: 150.0,
child: Padding(
padding: const EdgeInsets.all(5.0),
child: ClipOval(
clipper: MClipper(),
child: Image.asset(
"assets/justine.jpg",
fit: BoxFit.cover,
),
),
),
),
)
],
),
),
),
Container(
// color: Colors.blue,
width: 350.0,
height: 100.0,
child: Stack(
children: <Widget>[
Center(
child: Container(
height: 65.0,
width: 290.0,
decoration: BoxDecoration(
border: Border.all(
color: Color(0xff193451), width: 3.0),
borderRadius: BorderRadius.circular(40.0)),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 25.0),
child: Row(
children: <Widget>[
Icon(Icons.fast_rewind,
size: 55.0, color: Color(0xff193451)),
Expanded(
child: Container(),
),
Icon(Icons.fast_forward,
size: 55.0, color: Color(0xff193451))
],
),
),
),
),
Align(
alignment: Alignment.center,
child: Container(
width: 92.0,
height: 92.0,
decoration: BoxDecoration(
color: Color(0xff193451), shape: BoxShape.circle),
child: IconButton(
icon: Icon(
Icons.play_arrow,
size: 45.0,
color: Colors.white,
),
onPressed: () {},
),
),
)
],
),
),
ListView(
shrinkWrap: true,
physics: ClampingScrollPhysics(),
children: [
if(LocalUrl == "http://local") Container(child: ParseLocall(),),
if(LocalUrl == "http://music") Container(child: ParseMusicc(),),
if(LocalUrl == "http://talk") Container(child: ParseTalkk(),),
if(LocalUrl == "http://sports") Container(child: ParseSportss(),),
if(LocalUrl == "http://id=r0") Container(child: ParseByLocationn(),),
if(LocalUrl == "http://lang") Container(child: ParseLanguagess(),),
if(LocalUrl == "http://podcast") Container(child: ParseProdcastss(),),
],
),
],
),
));
脚手架(
主体:容器(
子:ListView(
收缩膜:对,
儿童:[
居中(
子:容器(
宽度:200.0,
高度:150.0,
子:堆栈(
儿童:[
容器(
装饰:盒子装饰(
颜色:颜色(0xff193451)。不透明度为(.5),
形状:长方形。圆形),
孩子:填充(
填充:const EdgeInsets.all(.0),
子项:_buildRadialSeekBar(),
),
),
居中(
子:容器(
宽度:150.0,
高度:150.0,
孩子:填充(
填充:常数边集全部(5.0),
孩子:斜坡(
clipper:MClipper(),
子:Image.asset(
“资产/justine.jpg”,
适合:BoxFit.cover,
),
),
),
),
)
],
),
),
),
容器(
//颜色:颜色,蓝色,
宽度:350.0,
高度:100.0,
子:堆栈(
儿童:[
居中(
子:容器(
身高:65.0,
宽度:290.0,
装饰:盒子装饰(
边界:边界(
颜色:颜色(0xff193451),宽度:3.0),
边界半径:边界半径。圆形(40.0)),
孩子:填充(
填充:常量边集。对称(水平:25.0),
孩子:排(
儿童:[
图标(图标。快退,
尺寸:55.0,颜色:颜色(0xff193451)),
扩大(
子级:容器(),
),
图标(图标。快进,
尺寸:55.0,颜色:颜色(0xff193451))
],
),
),
),
),
对齐(
对齐:对齐.center,
子:容器(
宽度:92.0,
身高:92.0,
装饰:盒子装饰(
颜色:颜色(0xff193451),形状:BoxShape.circle),
孩子:我的钮扣(
图标:图标(
图标。播放箭头,
尺寸:45.0,
颜色:颜色,白色,
),
按下:(){},
),
),
)
],
),
),
列表视图(
收缩膜:对,
物理:ClampingScrollPhysics(),
儿童:[
如果(LocalUrl==”http://local)容器(子级:parseLocal(),),
如果(LocalUrl==”http://music)容器(子项:ParseMusicc(),),
如果(LocalUrl==”http://talk)容器(子项:ParseTalkk(),),
如果(LocalUrl==”http://sports)容器(子项:parsesports(),),
如果(LocalUrl==”http://id=r0)容器(子项:ParseByLocationn(),),
如果(LocalUrl==”http://lang)容器(子级:ParseLanguagess(),),
如果(LocalUrl==”http://podcast)容器(子项:ParseProdcastss(),),
],
),
],
),
));
提前感谢您可以从您的
列表视图
中分离Justin
部分,并用列
将其包装起来。代码仍然需要一些修复,但将是这样的:
body: Container(
// Here is the Column!
child: Column(
children: [
// And here is the top part!
Center(
child: Container(
width: 200.0,
height: 150.0,
child: Stack(
children: <Widget>[
Container(
decoration: BoxDecoration(
color:Color(0xff193451).withOpacity(.5),
shape: BoxShape.circle),
child: Padding(
padding: const EdgeInsets.all(.0),
child: _buildRadialSeekBar(),
),
),
Center(
child: Container(
width: 150.0,
height: 150.0,
child: Padding(
padding: const EdgeInsets.all(5.0),
child: ClipOval(
clipper: MClipper(),
child: Image.asset(
"assets/justine.jpg",
fit: BoxFit.cover,
),
),
),
),
)
],
),
),
),
ListView(
shrinkWrap: true,
children: <Widget>[
Container(
// color: Colors.blue,
width: 350.0,
height: 100.0,
child: Stack(
children: <Widget>[
Center(
child: Container(
height: 65.0,
width: 290.0,
decoration: BoxDecoration(
border: Border.all(
color: Color(0xff193451), width: 3.0),
borderRadius: BorderRadius.circular(40.0)),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 25.0),
child: Row(
children: <Widget>[
Icon(Icons.fast_rewind,
size: 55.0, color: Color(0xff193451)),
Expanded(
child: Container(),
),
Icon(Icons.fast_forward,
size: 55.0, color: Color(0xff193451))
],
),
),
),
),
Align(
alignment: Alignment.center,
child: Container(
width: 92.0,
height: 92.0,
decoration: BoxDecoration(
color: Color(0xff193451), shape: BoxShape.circle),
child: IconButton(
icon: Icon(
Icons.play_arrow,
size: 45.0,
color: Colors.white,
),
onPressed: () {},
),
),
)
],
),
),
ListView(
shrinkWrap: true,
physics: ClampingScrollPhysics(),
children: [
if(LocalUrl == "http://local") Container(child: ParseLocall(),),
if(LocalUrl == "http://music") Container(child: ParseMusicc(),),
if(LocalUrl == "http://talk") Container(child: ParseTalkk(),),
if(LocalUrl == "http://sports") Container(child: ParseSportss(),),
if(LocalUrl == "http://id=r0") Container(child: ParseByLocationn(),),
if(LocalUrl == "http://lang") Container(child: ParseLanguagess(),),
if(LocalUrl == "http://podcast") Container(child: ParseProdcastss(),),
],
),
],
),
],
),
));
主体:容器(
//这是专栏!
子:列(
儿童:[
//这是最上面的部分!
居中(
子:容器(
宽度:200.0,
高度:150.0,
子:堆栈(
儿童:[
容器(
装饰:盒子装饰(
颜色:颜色(0xff193451)。不透明度为(.5),
形状:长方形。圆形),
孩子:填充(
填充:const EdgeInsets.all(.0),
子项:_buildRadialSeekBar(),
),
),
居中(
子:容器(
宽度:150.0,
高度:150.0,
孩子:填充(
填充:常数边集全部(5.0),
孩子:斜坡(