如何在Flutter中像Reddit App一样将卡片按钮组合在一起?

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

我想把我的卡片按钮放在一起像Reddit App一样。怎么办?

主Row外面有一个Container和Container',填充高度为15.0。 Row的小部件如何适应15.0的高度。

Reddit card buttons

My app card buttons

这是我的代码;

@override
  Widget build(BuildContext context) {
    return new SafeArea(
      top: false,
      bottom: false,
      child: new Card(
        child: new Column(
          children: <Widget>[
            new Container(
              padding: EdgeInsets.fromLTRB(5.0, 15.0, 5.0, 3.0),
              child: new Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: <Widget>[
                  new Container(
                    color: Colors.blueGrey,
                    child: new Row(
                      children: <Widget>[
                        new Icon(Icons.arrow_drop_up),
                        new Text('Vote'),
                        new Icon(Icons.arrow_drop_down),
                      ],
                    ),
                  ),
                  new Container(
                    color: Colors.blueGrey,
                    child: new Row(
                      children: <Widget>[
                        new Icon(Icons.mode_comment),
                        new Text('Comment'),
                      ],
                    ),
                  ),
                  new Container(
                    color: Colors.blueGrey,
                    child: new Row(
                      children: <Widget>[
                        new Icon(Icons.share),
                        new Text('Share'),
                      ],
                    ),
                  ),
                ],
              ),
            )
          ],
        ),
      ),
    );
  }
dart flutter
2个回答
© www.soinside.com 2019 - 2024. All rights reserved.