Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.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
User interface 如何创建自定义卡(颤振小部件)?_User Interface_Flutter_Dart - Fatal编程技术网

User interface 如何创建自定义卡(颤振小部件)?

User interface 如何创建自定义卡(颤振小部件)?,user-interface,flutter,dart,User Interface,Flutter,Dart,我正在尝试在Flatter中创建一张如下所示的自定义卡: 任何建议或指导都将不胜感激。您应该尝试一下,它将大大帮助您,另一方面,对于右上角的图标,您可以尝试堆栈小部件,其他组件可以放在一列中,例如: Card( child: Stack( children: [ Positioned( top: 0, right: 0, child: Container( decoration: BoxDecorati

我正在尝试在Flatter中创建一张如下所示的自定义卡:

任何建议或指导都将不胜感激。

您应该尝试一下,它将大大帮助您,另一方面,对于右上角的图标,您可以尝试堆栈小部件,其他组件可以放在一列中,例如:

Card(
  child: Stack(
    children: [
      Positioned(
        top: 0,
        right: 0,
        child: Container(
          decoration: BoxDecoration(
            gradient: RadialGradient(
              colors: [
                Colors.red,
                Colors.white
              ],

              // Todo: to achive it as you have it in the picture you need to play with the radialgradient, check the oficial documentation for radialgradient and check for center, stops and radius properties of radialgradient
            )
          ),
          child: Padding(padding: EdgeInsets.all(10.0), child: Icon(Icons.menu /*Replace it with your icon*/)),
        ),
      ),
      Padding(
        padding: EdgeInsets.all(20.0),
        child: Column(
          children: <Widget>[
            Text("some text"),
            Text("some text 2"),
            Align(
              alignment: Alignment.centerRight,
              child: Chip(
                label: Text('0'),
              ),
            ),
          ],
        ),
      )
    ],
  ),
);
卡(
子:堆栈(
儿童:[
定位(
排名:0,
右:0,,
子:容器(
装饰:盒子装饰(
梯度:径向梯度(
颜色:[
颜色,红色,
颜色。白色
],
//Todo:要实现图片中的效果,您需要使用radialgradient,请查看radialgradient的官方文档,并检查radialgradient的中心、停止点和半径属性
)
),
child:Padding(Padding:EdgeInsets.all(10.0),child:Icon(Icons.menu/*替换为您的Icon*/),
),
),
填充物(
填充:所有边缘设置(20.0),
子:列(
儿童:[
文本(“某些文本”),
文本(“部分文本2”),
对齐(
对齐:alignment.centerRight,
孩子:芯片(
标签:文本('0'),
),
),
],
),
)
],
),
);
这不是全部答案,你需要考虑尺寸、高度、宽度、填充物和边距,祝你好运