【发布时间】:2020-10-04 14:32:37
【问题描述】:
我在我的 profilePage 中使用了 innerDrawer。我在脚手架上放了一列,并在里面添加了小部件。其中一个小部件是 SignedContracts,这个小部件有一个 Expanded 小部件,里面有一列。我想在扩展或容器小部件(如第二张图片)中填充或填充此列。我尝试了很多东西,但没有找到任何解决方案。
注意:第一张图片中的红色边框可以看到容器的边框。
脚手架部分:
scaffold: Scaffold(
body: Container(
child: Column(
children: [
SizedBox(
height: 20,
),
Stack(
children: [
Container(
decoration: BoxDecoration(
border: Border.all(color: Colors.red, width: 2),
),
child: Image.network(
"${firestoreDB.user.photoURL}",
width: 500,
height: 250,
fit: BoxFit.fill,
),
),
Positioned(
child: IconButton(
icon: Icon(Icons.menu),
onPressed: () {
_toggle();
},
),
),
Positioned(
child: Text(
"${_user.name}",
style: TextStyle(color: Colors.white, fontSize: 20.0),
),
bottom: 50,
left: 50,
),
Positioned(
child: Text(
"${_user.desc}",
style: TextStyle(color: Colors.white, fontSize: 15.0),
),
bottom: 30,
left: 50,
),
],
),
MiddleCounts(lastWeekListen, lastWeekStream,sL),
Row(),
SignedContracts(),
],
),
),
),
SignedContracts 小部件:
class SignedContracts extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Expanded(
child: Container(
decoration:
BoxDecoration(border: Border.all(color: Colors.red, width: 2)),
alignment: Alignment.centerLeft,
//height: 500,
padding: EdgeInsets.all(30),
//color: Colors.black,
child: Container(
decoration:
BoxDecoration(border: Border.all(color: Colors.red, width: 2)),
child: Column(
//crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: [
Text(
"Signed Contracts",
style: TextStyle(color: Colors.white, fontSize: 30.0),
),
SizedBox(
height: 20,
),
Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Text(
"Multiple Rights Agreement",
style: TextStyle(color: Colors.grey),
),
Text(
"Sound Recording Licence",
style: TextStyle(color: Colors.grey),
),
Text(
"Merchandising Agreement",
style: TextStyle(color: Colors.grey),
),
Text(
"Synchronisation Licence",
style: TextStyle(color: Colors.grey),
),
Text(
"Artist Development Agreement",
style: TextStyle(color: Colors.grey),
),
Text(
"Management Agreement",
style: TextStyle(color: Colors.grey),
),
],
),
FlatButton(
onPressed: () {},
child: Text(
"Manage Contracts",
style: TextStyle(color: Colors.white),
),
color: Colors.red,
),
],
),
),
),
);
}
}
【问题讨论】: