Home > Back-end >  Add Text in a new Row in Flutter
Add Text in a new Row in Flutter

Time:10-21

Hi I am trying to add a new in container in the Flutter Project:

Here is layout:

Container(
                  decoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(10),
                      color: const Color(0xFFF4F6FD)),
                  padding:
                      const EdgeInsets.symmetric(horizontal: 12, vertical: 12),
                  child: Row(
                    children: [
                      Text(
                        "Last Details:",
                        style: Styles.textStyle,
                      ),
                      Text(
                        "Date",
                        style: Styles.textStyle,
                      ),
                    ],
                  ),
                )
              ],
            ),
          )

Here is the current situation:

enter image description here

This is the required outcome:

enter image description here

My question:

Where can I add the following text to show right below the existing text:

                      Text(
                        "Some Text",
                      ),

CodePudding user response:

Wrap the Row widget with Column widget. Add your text in children of Column.

New code will look like:

    Container(
                      decoration: BoxDecoration(
                          borderRadius: BorderRadius.circular(10),
                          color: const Color(0xFFF4F6FD)),
                      padding:
                          const EdgeInsets.symmetric(horizontal: 12, vertical: 12),
                      child:Column(
                children:[
                      Row(
                        children: [
                          Text(
                            "Last Details:",
                            style: Styles.textStyle,
                          ),
                          Text(
                            "Date",
                            style: Styles.textStyle,
                          ),
                        ],
                      ),
                     

                  Text(
                    "Some Text",
                  ),
                  ],

                ),
              )
  • Related