简体   繁体   English

flutter 中的扩展卡。 孩子们满溢

[英]Expansion Card in flutter. Children overflowing

I try to fit my Cloum child of the expantion Card into his expanded Container.我尝试将扩展卡的 Cloum 孩子放入他扩展的容器中。 It always overflow his Card perent.它总是溢出他的卡百分比。

I tried a few things like putting the container in a FittedBox but nothing is working.我尝试了一些方法,例如将容器放入 FittedBox 中,但没有任何效果。 So my goal is to make the column alway fitting in the expanded part of the card, or that the Card expand more if there are to many children in the Column.所以我的目标是让列总是适合卡片的展开部分,或者如果列中有很多孩子,卡片会展开得更多。 Can anybuddy tell me this magic trick?有朋友能告诉我这个魔术吗? Thanks a lot !非常感谢 ! enter image description here在此处输入图像描述

ExpansionCard(
                leading: CircleAvatar(
                  child: Text('1000'),
                  backgroundColor: Colors.black,
                ),
                borderRadius: 20,
                background: Image.asset(
                  "assets/images/unnamed.jpg",
                  fit: BoxFit.cover,
                ),
                title: Container(
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: <Widget>[
                      Text("Freefly Sprung mit Carlo ",
                          style: jumpCardHeaderStyle),
                      Text(
                        DateFormat.yMMMd().format(DateTime.now()),
                        style: jumpCardDateStyle,
                      ),
                    ],
                  ),
                ),
                children: <Widget>[
                  FittedBox(
                    child: Container(
                      margin: EdgeInsets.symmetric(horizontal: 7),
                      child: Padding(
                        padding: const EdgeInsets.all(8.0),
                        child: Column(
                          mainAxisAlignment: MainAxisAlignment.spaceAround,
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: [
                            Text("Exit Alt. : 4000m", style: kJumpTextStyle),
                            Divider(),
                            Text("Dpl. Alt. 1000m", style: kJumpTextStyle),
                            Divider(),
                            Text("Time FF 42sec", style: kJumpTextStyle),
                            Text("AVG.Speed T 127MPH", style: kJumpTextStyle),
                            Text("AVG.Speed T 127MPH", style: kJumpTextStyle),
                          ],
                        ),
                      ),
                    ),
                  )
                ],
              ),

Have you tried to use a card that has a Wrap object as a child?您小时候有没有尝试过使用带有 Wrap object 的卡? This should allow you to contain everything you need这应该允许你包含你需要的一切

Card(
 child: Wrap(
    children: []
))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM