【发布时间】:2021-04-14 04:54:52
【问题描述】:
假设我想在特定布局中随机放置小部件,如下图所示,我该如何实现?
我正在考虑使用 wrap 小部件,但这并没有停止工作,因为它不会随机排列一行中的孩子。我的代码到现在为止
return Wrap(
spacing: 30,
children: [
buildprofile(),
buildprofile(),
buildprofile(),
buildprofile(),
],
);
buildprofile() {
return Column(
children: [
CircleAvatar(
radius: 64,
backgroundColor: Colors.pink,
child: (CircleAvatar(
radius: 62,
backgroundImage: NetworkImage(profilepic),
)),
),
SizedBox(
height: 10,
),
Text(
"Sivaram",
style: mystyle(16, Colors.black, FontWeight.w700),
)
],
);
}
【问题讨论】:
-
每个小部件可以重叠吗?如果你允许它们重叠,我想我有办法
-
每个小部件可以重叠是什么意思,您是指配置文件小部件
-
是的,配置文件小部件。
-
不,我希望他们分开
标签: flutter dart widget flutter-layout