无法在浮动中调整行小部件的大小

问题描述 投票:-1回答:1

我只想减小布局的大小,如果有人可以帮助的话:

return Container(
            child: Row(
              children: <Widget>[
                MainAxisSize.max(){
                _expandedVideoRow([views[0]]);},
                MainAxisSize.min(){
                _expandedVideoRow([views[1]]);}
              ],
            ));

大小不变。

flutter layout resize agora.io
1个回答
0
投票
像下面的示例一样向容器添加宽度

import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatefulWidget { @override State<StatefulWidget> createState() { return MyAppState(); } } class MyAppState extends State<MyApp> { @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( appBar: AppBar( title: Text("Width sizing"), ), body: Container( width: 70.0, child: Row( children: <Widget>[ Container( width: 35.0, height: 35.0, color: Colors.blue), Container( width: 35.0, height: 35.0, color: Colors.green), ], ),), ), ); } }

快乐编码!!
© www.soinside.com 2019 - 2024. All rights reserved.