skip to Main Content

I have faced the issue of height related actually I am using the expansion tile widget. there is according to UI height not managed and not working so please explain to any mentor and friends or brother

I want it according to the UI height manage widget.

2

Answers


  1. you can use SizedBox widget to manage height
    SizedBox(
    height://but here the height
    ),

    if you want to know screen height you can use MediaQuery.of(context).size.height.

    Login or Signup to reply.
  2. You can use size box :
    This will set the height of the widget to 100.

      SizedBox(
      height: 100,
      child: YourWidget(),
    )
    

    Use the Expanded widget: You can use the Expanded widget to make a widget take up all the available space in its parent :

        Expanded(
            child: myCustomWidget(),
              )
    

    Also SingleChildScrollView

        SingleChildScrollView(
      child: YourWidget(),
    )
    

    You can also use ConstrainedBox

       ConstrainedBox(
      constraints: BoxConstraints(
        minHeight: 100,
        maxHeight: 200,
      ),
      child: YourWidget(),
    )
    

    I hope above example will help you.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search