Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Child text – Flutter

I am trying to create a new text field, but I don’t know how to get the text in the position I want. When trying to program, it stays in this position:

problem

but I want it to look like this, in this position:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

example

This is the code:

body: Container(
        padding: EdgeInsets.only(left: 25, bottom: 15),
        height: 80,
        decoration: BoxDecoration(
          color: Color.fromARGB(255, 73, 158, 138),
          borderRadius: BorderRadius.only(
            bottomLeft: Radius.circular(36),
            bottomRight: Radius.circular(36),
          )
        ),
        child: Column(
          
          children: <Widget>[
            Text(
              "Olá, usuário",
              style: TextStyle(
                color: Colors.white,
                fontWeight: FontWeight.bold,
                fontSize: 35,
              ),
            ),
            Text(
              "Olá, usuário",
              style: TextStyle(
                color: Colors.white,
                fontWeight: FontWeight.bold,
                fontSize: 35,
              ),
            ),
          ],
        ),
        
      ),

>Solution :

DEMO

remove height
and set width as infinite to fill the parent using width: double. Infinity, Also set Column to have

mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,

Container should be first of child of Column

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading