RenderFlex переполнен на 112 пикселей в нижней части - PullRequest
0 голосов
/ 20 декабря 2018

Я использую AnimatedContainer .он анимирует размер от 0 до некоторого размера и содержит некоторый текст и все остальное.при нажатии одной кнопки анимация запускается и показывает текущие ошибки.

При нажатии кнопки я просто устанавливаю значение sizeOfLevel.изначально его значение равно 0.

Код:

 AnimatedContainer(
        curve: Curves.bounceIn,
        duration: Duration(milliseconds: 200),
        width: sizeOfLevel,
        height: sizeOfLevel,
        decoration: BoxDecoration(
            borderRadius: BorderRadius.all(Radius.circular(8.0)),
            image: DecorationImage(
                image: AssetImage('images/levelunlockScreen.jpg'),
                fit: BoxFit.cover),
            border: Border.all(
                style: BorderStyle.solid, width: 4.0, color: Colors.white)),
        child: Column(
          children: <Widget>[

            Center(
              child: new Text(
                "Unlock Level",
                style: TextStyle(color: Colors.white, fontSize: 30.0),
              ),
            ),

          ],
        ),
      ),

Ошибки:

  I/flutter ( 4579): The following message was thrown during layout:
  I/flutter ( 4579): A RenderFlex overflowed by 112 pixels on the bottom.
  I/flutter ( 4579): The overflowing RenderFlex has an orientation of Axis.vertical.
  I/flutter ( 4579): The edge of the RenderFlex that is overflowing has been marked in the rendering with a yellow and
  I/flutter ( 4579): black striped pattern. This is usually caused by the contents being too big for the RenderFlex.
  I/flutter ( 4579): Consider applying a flex factor (e.g. using an Expanded widget) to force the children of the
  I/flutter ( 4579): RenderFlex to fit within the available space instead of being sized to their natural size.
  I/flutter ( 4579): This is considered an error condition because it indicates that there is content that cannot be
  I/flutter ( 4579): seen. If the content is legitimately bigger than the available space, consider clipping it with a
  I/flutter ( 4579): ClipRect widget before putting it in the flex, or using a scrollable container rather than a Flex,
      I/flutter ( 4579): like a ListView.
  I/flutter ( 4579): The specific RenderFlex in question is:
  I/flutter ( 4579):   RenderFlex#4086c OVERFLOWING
  I/flutter ( 4579):   creator: Column ← Padding ← DecoratedBox ← ConstrainedBox ← Container ← AnimatedContainer ← Center
  I/flutter ( 4579):   ← Stack ← MediaQuery ← LayoutId-[<_ScaffoldSlot.body>] ← CustomMultiChildLayout ← AnimatedBuilder
  I/flutter ( 4579):   ← ⋯
  I/flutter ( 4579):   parentData: offset=Offset(4.0, 4.0) (can use size)
  I/flutter ( 4579):   constraints: BoxConstraints(w=115.7, h=115.7)
  I/flutter ( 4579):   size: Size(115.7, 115.7)
  I/flutter ( 4579):   direction: vertical
  I/flutter ( 4579):   mainAxisAlignment: start
  I/flutter ( 4579):   mainAxisSize: max
  I/flutter ( 4579):   crossAxisAlignment: center
  I/flutter ( 4579):   verticalDirection: down
...