Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Dart 怎样才能使这样的小部件或卡片列表飘动_Dart_Flutter - Fatal编程技术网

Dart 怎样才能使这样的小部件或卡片列表飘动

Dart 怎样才能使这样的小部件或卡片列表飘动,dart,flutter,Dart,Flutter,你怎么能制作这样的小部件 或卡片列表 [![在此处输入图像描述][2][2]看看这个 对于背景图像,使用带有框装饰的容器。对于左侧的图像,请使用image.asset小部件。这将根据您的要求生成所需的UI Widget build(BuildContext context) { return new Container( alignment: Alignment.centerLeft, margin: new EdgeInsets.all(8.0), padding: new Edg

你怎么能制作这样的小部件 或卡片列表

[![在此处输入图像描述][2][2]

看看这个


对于背景图像,使用带有
框装饰的
容器
。对于左侧的图像,请使用
image.asset
小部件。

这将根据您的要求生成所需的UI

Widget build(BuildContext context) {
return new Container(
  alignment: Alignment.centerLeft,
  margin: new EdgeInsets.all(8.0),
  padding: new EdgeInsets.all(8.0),
  height: 150.0,
  decoration: new BoxDecoration(
    color: Colors.lightBlue,
    borderRadius: new BorderRadius.all(new Radius.circular(10.0)),
    boxShadow: [new BoxShadow(color: Colors.black54, offset: new Offset(2.0, 2.0),
    blurRadius: 5.0)]
  ),
  child: new Row(children: <Widget>[
    new CircleAvatar(backgroundColor: Colors.white70,radius: 50.0,),
    new Expanded(child: new Padding(padding: new EdgeInsets.only(left: 8.0),
      child: new Column(
        mainAxisAlignment: MainAxisAlignment.center,
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          new Text('Hot Pot', style: new TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold),),
          new Row(children: <Widget>[
            new Icon(Icons.star, color: Colors.white,),
            new Icon(Icons.star, color: Colors.white,),
            new Icon(Icons.star, color: Colors.white,),
            new Icon(Icons.star_half, color: Colors.white,),
            new Icon(Icons.star_border, color: Colors.white,),
          ],),
          new Wrap(spacing: 2.0,children: <Widget>[
            new Chip(label: new Text('Hot')),
            new Chip(label: new Text('Hot')),
            new Chip(label: new Text('Hot')),
          ],)
        ],),))
  ],),
);
}
小部件构建(构建上下文){
退回新货柜(
对齐:alignment.centerLeft,
边距:所有新边集(8.0),
填充:新边缘设置。全部(8.0),
高度:150.0,
装饰:新盒子装饰(
颜色:颜色。浅蓝色,
borderRadius:新的borderRadius.all(新半径.圆形(10.0)),
boxShadow:[新的boxShadow(颜色:Colors.black54,偏移量:新的偏移量(2.0,2.0),
(半径:5.0)]
),
子项:新行(子项:[
新CircleAvatar(背景色:Colors.white70,半径:50.0,),
新扩展(子项:新填充(填充:仅新边集)(左:8.0),
子:新列(
mainAxisAlignment:mainAxisAlignment.center,
crossAxisAlignment:crossAxisAlignment.start,
儿童:[
新文本(“火锅”,样式:新文本样式(fontSize:20.0,fontWeight:fontWeight.bold),
新行(儿童:[
新图标(Icons.star,颜色:Colors.white,),
新图标(Icons.star,颜色:Colors.white,),
新图标(Icons.star,颜色:Colors.white,),
新图标(Icons.star\u half,颜色:Colors.white,),
新图标(Icons.star_边框,颜色:Colors.white,),
],),
新包裹(间距:2.0,子对象:[
新芯片(标签:新文本('Hot')),
新芯片(标签:新文本('Hot')),
新芯片(标签:新文本('Hot')),
],)
],),))
],),
);
}

您可以输入代码以检查预付款。