Flutter 无法根据需要设置颤振布局小部件
我正在尝试设置卡片状的图像。我已经扩展了行内的使用,这里是我的代码Flutter 无法根据需要设置颤振布局小部件,flutter,flutter-layout,Flutter,Flutter Layout,我正在尝试设置卡片状的图像。我已经扩展了行内的使用,这里是我的代码 return Card( shape: RoundedRectangleBorder( side: BorderSide(color: Colors.white70, width: 1), borderRadius: BorderRadius.circular(15),
return Card(
shape: RoundedRectangleBorder(
side: BorderSide(color: Colors.white70, width: 1),
borderRadius: BorderRadius.circular(15),
),
child: new InkWell(
onTap: () {
},
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Column(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
child: Text(
"${_userDetails[index].manifiest}",
style: TextStyle(
fontSize: 40.0,
fontWeight: FontWeight.w700,
),
),
),
Padding(
padding:
const EdgeInsets.only(left: 5),
child: Row(
mainAxisAlignment:
MainAxisAlignment.end,
children: <Widget>[
IconButton(
icon: new Icon(
Icons.edit,
),
iconSize: 30,
onPressed: () {
int id =
userData[index]['id'];
Navigator.push(
context,
MaterialPageRoute(
));
},
),
IconButton(
icon: new Icon(
Icons.cancel,
),
iconSize: 30,
onPressed: () {
Utils.isConnected()
.then((intenet) {
if (intenet != null &&
intenet) {
// Internet Present Case
showAlertDialogTwo(
context,
"Are Sure You Want To Delete?",
index);
} else {
Utils.alertDialog(
context,
'Make Sure Connected with Internet',
"");
}
// No-Internet Case
});
},
)
],
))
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
child: Row(
children: <Widget>[
Text(
"${_userDetails[index].fromBranch} ",
style: TextStyle(
color: Colors.black45,
fontWeight: FontWeight.bold,
fontSize: 16.0)),
Icon(Icons.compare_arrows,
color: Colors.black54),
Text(
" ${_userDetails[index].toBranch}",
style: TextStyle(
color: Colors.black45,
fontWeight: FontWeight.bold,
fontSize: 16.0)),
],
)
),
Text("${_userDetails[index].date}",
style: TextStyle(
color: Colors.black45,
fontWeight: FontWeight.bold,
fontSize: 12.0)),
new Padding(
padding: EdgeInsets.only(left: 5)),
Text("${_userDetails[index].time}",
style: TextStyle(
color: Colors.black45,
fontWeight: FontWeight.bold,
fontSize: 12.0)),
new Padding(
padding: EdgeInsets.only(
top: 30.0,
))
],
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
child:Text("Consignment"
style: TextStyle(
color: Colors.black54,
fontWeight: FontWeight.bold,
fontSize: 16.0)),
),
Expanded(
child:Text("${_userDetails[index].totalConsignments}",
style: TextStyle(
color: Colors.black45,
fontWeight: FontWeight.bold,
fontSize: 12.0)),
),
Expanded(
child:Text("PCs ",
style: TextStyle(
color: Colors.black54,
fontWeight: FontWeight.bold,
fontSize: 16.0)),
),
Expanded(
child:Text("${_userDetails[index].totalPcs}",
style: TextStyle(
color: Colors.black45,
fontWeight: FontWeight.bold,
fontSize: 12.0)),
),
new Padding(
padding: EdgeInsets.only(
top: 30.0,
))
],
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Expanded(
child:Text("Weight ",
style: TextStyle(
color: Colors.black54,
fontWeight: FontWeight.bold,
fontSize: 16.0)),
),
Expanded(
child:Text("${_userDetails[index].totalWeight}",
style: TextStyle(
color: Colors.black45,
fontWeight: FontWeight.bold,
fontSize: 12.0)),
),
Expanded(
child:Text("By",
style: TextStyle(
color: Colors.black54,
fontWeight: FontWeight.bold,
fontSize: 16.0)),
),
Expanded(
child:Text("${_userDetails[index].enteredBy}",
style: TextStyle(
color: Colors.black45,
fontWeight: FontWeight.bold,
fontSize: 12.0)),
),
new Padding(
padding: EdgeInsets.only(
top: 30.0,
))
],
),
],
),
),
),
margin: const EdgeInsets.only(
left: 10, top: 10, right: 10),
);
退货卡(
形状:圆形矩形边框(
边:边框边(颜色:Colors.white70,宽度:1),
边界半径:边界半径。圆形(15),
),
孩子:新墨水井(
onTap:(){
},
孩子:填充(
填充:常数边集全部(10.0),
子:列(
主轴对准:
MainAxisAlignment.spaceBetween,
儿童:[
划船(
主轴对准:
MainAxisAlignment.spaceBetween,
儿童:[
扩大(
子:文本(
“${u userDetails[index].manifiest}”,
样式:TextStyle(
字体大小:40.0,
fontWeight:fontWeight.w700,
),
),
),
填充物(
衬垫:
仅限常数边集(左:5),
孩子:排(
主轴对准:
main.end,
儿童:[
图标按钮(
图标:新图标(
图标。编辑,
),
iconSize:30,
已按下:(){
整数id=
用户数据[索引]['id'];
导航器。推(
上下文
材料路线(
));
},
),
图标按钮(
图标:新图标(
图标。取消,
),
iconSize:30,
已按下:(){
Utils.isConnected()
.然后((互联网){
if(intenet!=null&&
互联网){
//互联网现案
显示警报对话框二(
上下文
“确实要删除吗?”,
指数);
}否则{
Utils.alertDialog(
上下文
“确保已连接到Internet”,
"");
}
//没有互联网案例
});
},
)
],
))
],
),
划船(
主轴对准:
MainAxisAlignment.spaceBetween,
儿童:[
扩大(
孩子:排(
儿童:[
正文(
“${u userDetails[index].fromBranch}”,
样式:TextStyle(
颜色:颜色。黑色45,
fontWeight:fontWeight.bold,
字体大小:16.0),
图标(图标。比较箭头,
颜色:颜色。黑色54),
正文(
“${u userDetails[index].toBranch}”,
样式:TextStyle(
颜色:颜色。黑色45,
fontWeight:fontWeight.bold,
字体大小:16.0),
],
)
),
文本(${u userDetails[index].date}),
样式:TextStyle(
颜色:颜色。黑色45,
fontWeight:fontWeight.bold,
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
new Flexible(
child: new Text("Consignmens",
style: TextStyle(
color: Colors.black54,
fontWeight: FontWeight.bold,
fontSize: 16.0)),
flex: 3,
),
new Flexible(
child: new Center(
child: Text(
"${_userDetails[index].totalConsignments}",
style: TextStyle(
color: Colors.black45,
fontWeight: FontWeight.bold,
fontSize: 12.0)),
),
flex: 2,
),
new Flexible(
child: new Center(
child: Text("PCs ",
style: TextStyle(
color: Colors.black54,
fontWeight: FontWeight.bold,
fontSize: 16.0)),
),
flex: 2,
),
new Flexible(
child: new Text(
"${_userDetails[index].totalPcs}",
style: TextStyle(
color: Colors.black45,
fontWeight: FontWeight.bold,
fontSize: 12.0)),
flex: 2,
),
new Padding(
padding: EdgeInsets.only(
top: 30.0,
))
],
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
new Flexible(
child: Text("Weight",
style: TextStyle(
color: Colors.black54,
fontWeight: FontWeight.bold,
fontSize: 16.0)),
flex: 3,
),
new Flexible(
child: new Center(
child: Text(
"${_userDetails[index].totalWeight}",
style: TextStyle(
color: Colors.black45,
fontWeight: FontWeight.bold,
fontSize: 12.0)),
),
flex: 2,
),
new Flexible(
child: new Center(
child: Text("By",
style: TextStyle(
color: Colors.black54,
fontWeight: FontWeight.bold,
fontSize: 16.0)),
),
flex: 2,
),
new Flexible(
child: new Text(
"${_userDetails[index].enteredBy}",
style: TextStyle(
color: Colors.black45,
fontWeight: FontWeight.bold,
fontSize: 12.0)),
flex: 2,
)
],
),