when container size decrease than inside stack size how to decrease in flutter

129 Views Asked by At

In this code i need stack.

If the container aspect ratio 5.5/7 than in stack movableTextWidget how to not resize based on container size.

when keyboard visible than the aspect ratio of container is decrees so in this container movableTextWidget size not decrees .

Transform(
  alignment: FractionalOffset.center,
  transform: Matrix4.diagonal3Values(_scale, _scale, 1.0),
  child: Padding(
    padding: isKeyboardVisible
        ? const EdgeInsets.symmetric(horizontal: 30, vertical: 30)
        : const EdgeInsets.symmetric(horizontal: 20, vertical: 20),
    child: AnimatedContainer(
      duration: Duration(milliseconds: 500),
      alignment: isKeyboardVisible
          ? Alignment.topCenter
          : Alignment.center,
      child: AspectRatio(
        aspectRatio: isKeyboardVisible ? 5.5 / 7 : 5 / 7,
        child: Container(
          color: Colors.white,
          child: Stack(
            alignment: Alignment.center,
            children: [
              ...movableTextWidgets,
            ],
          ),
        ),
      ),
    ),
  ),
)

what wrong in this code.

0

There are 0 best solutions below