dav*_*020 5 flutter flutter-layout
我可以基于另一个窗口小部件放置窗口小部件吗?像这样:
平铺版面 不带
flutter_staggered_grid_view库
没有Widget
类似的,ConstraintLayout
但你可以使用不同的小部件来实现你想要的,就像这个例子:
class Testing2 extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
color: Colors.red,
child: Row(
children: <Widget>[
Flexible(
child: Column(
children: <Widget>[
Flexible(
flex: 1,
child: Container(
color: Colors.deepOrange,
),
),
Flexible(
flex: 2,
child: Container(
color: Colors.lightBlue,
),
),
],
),
),
Flexible(
child: Column(
children: <Widget>[
Flexible(
flex: 3,
child: Container(
color: Colors.orange,
)),
Flexible(
flex: 1,
child: Row(
children: <Widget>[
Flexible(
flex: 2,
child: Container(
color: Colors.blue,
)),
Flexible(child: Container(color: Colors.green))
],
),
)
],
),
)
],
),
);
}
Run Code Online (Sandbox Code Playgroud)
您也可以查看此链接以了解布局小部件:https ://flutter.io/widgets/layout/
归档时间: |
|
查看次数: |
3184 次 |
最近记录: |