0
votes

Friends, I could not use the constraints structure in the container class. Now, according to my text child, while waiting for the min, max values to be formed, I always output maxwidth, maxheight values, even if the text content is little. As expected in the training video I watched, it grows according to the max value given according to the text content. but I could not.my code and quit:

    body: Center(
      child: Container(
          alignment: AlignmentDirectional.centerStart,
          color: Colors.yellow,
          child: Text(
            "Merhaba",
            style: TextStyle(color: Colors.red, fontSize: 25),
          ),
          constraints: BoxConstraints(
              maxHeight: 300.0,
              maxWidth: 200.0,
              minWidth: 150.0,
              minHeight: 150.0)
      ),
    ),

Text size is 25, the result is: https://i.stack.imgur.com/ZHNTG.png

I tried font size as 250, the result is:

https://i.stack.imgur.com/W5qWK.png

1
Please type code. Screenshot is not efficient. - Akif
Thanks, I edited. - birisix

1 Answers

0
votes

It depends on the font size of the text. Now it is 25. Please set bigger values than 25 to see what you expected.