无法在行 Flutter 下方的卡片内添加列
Cannot add column inside a card below a row Flutter
我正在实现一个有行的卡片,我想在 flutter 中的卡片中的行下方添加列。我无法在卡片底部添加列。
Column buildWorkshopSection() {
return Column(
children: [
Card(
margin: EdgeInsets.symmetric(horizontal: 20.0, vertical: 5.0),
clipBehavior: Clip.antiAlias,
color: Colors.white,
elevation: 5.0,
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 8.0, vertical: 22.0),
child: Row(
children: <Widget>[
Expanded(
child: Column(
children: <Widget>[
SizedBox(
height: 5.0,
),
buildStartTimeWorkshop(),
],
),
),
Expanded(
child: Column(
children: <Widget>[
SizedBox(
height: 5.0,
),
buildCloseTimeWorkshop(),
],
),
),
],
),
),
)
],
);
}
像这样添加提交按钮
Card(
margin:
EdgeInsets.symmetric(horizontal: 20.0, vertical: 5.0),
clipBehavior: Clip.antiAlias,
color: Colors.white,
elevation: 5.0,
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 8.0, vertical: 22.0),
child: Column(
children: [
Row(
children: <Widget>[
Expanded(
child: Column(
children: <Widget>[
SizedBox(
height: 5.0,
),
buildStartTimeWorkshop(),
],
),
),
Expanded(
child: Column(
children: <Widget>[
SizedBox(
height: 5.0,
),
buildCloseTimeWorkshop(),
],
),
),
],
),
SizedBox(
height: 20,
),
RaisedButton(
onPressed: () {},
child: Text("Submit"),
)
],
),
),
),
看起来像这样
我正在实现一个有行的卡片,我想在 flutter 中的卡片中的行下方添加列。我无法在卡片底部添加列。
Column buildWorkshopSection() {
return Column(
children: [
Card(
margin: EdgeInsets.symmetric(horizontal: 20.0, vertical: 5.0),
clipBehavior: Clip.antiAlias,
color: Colors.white,
elevation: 5.0,
child: Padding(
padding:
const EdgeInsets.symmetric(horizontal: 8.0, vertical: 22.0),
child: Row(
children: <Widget>[
Expanded(
child: Column(
children: <Widget>[
SizedBox(
height: 5.0,
),
buildStartTimeWorkshop(),
],
),
),
Expanded(
child: Column(
children: <Widget>[
SizedBox(
height: 5.0,
),
buildCloseTimeWorkshop(),
],
),
),
],
),
),
)
],
);
}
像这样添加提交按钮
Card(
margin:
EdgeInsets.symmetric(horizontal: 20.0, vertical: 5.0),
clipBehavior: Clip.antiAlias,
color: Colors.white,
elevation: 5.0,
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 8.0, vertical: 22.0),
child: Column(
children: [
Row(
children: <Widget>[
Expanded(
child: Column(
children: <Widget>[
SizedBox(
height: 5.0,
),
buildStartTimeWorkshop(),
],
),
),
Expanded(
child: Column(
children: <Widget>[
SizedBox(
height: 5.0,
),
buildCloseTimeWorkshop(),
],
),
),
],
),
SizedBox(
height: 20,
),
RaisedButton(
onPressed: () {},
child: Text("Submit"),
)
],
),
),
),
看起来像这样