0
ListView(
                    scrollDirection: Axis.vertical,
                    shrinkWrap: true,
                    children: [
                      Padding(
                        padding: const EdgeInsets.fromLTRB(20, 10, 20, 10),
                        child: Expanded(
                          child: Container(
                            height: 100,
                            color: Colors.grey[100],
                            child: Row(// this
                                children: [
                              Padding(
                                padding: const EdgeInsets.fromLTRB(
                                    20, 10, 5, 10),
                                child: Column(
                                  children: const [
                                    SizedBox(
                                      height: 5,
                                    ),
                                    Text(
                                      "1",
                                      style: TextStyle(
                                        fontSize: 35,
                                        fontWeight: FontWeight.bold,
                                      ),
                                    ),
                                    Text(
                                      "MAY",
                                      style: TextStyle(
                                          fontSize: 17,
                                          fontWeight: FontWeight.bold,
                                          color: Color.fromARGB(
                                              255, 231, 95, 97)),
                                    ),
                                  ],
                                ),
                              ),
                              Column(
                                crossAxisAlignment:
                                    CrossAxisAlignment.start,
                                children: [
                                  SizedBox(
                                    height: 5,
                                  ),
                                  Padding(
                                    padding:
                                        EdgeInsets.fromLTRB(20, 10, 20, 5),
                                    child: Text(
                                      "Viral fever & Cough",
                                      style: TextStyle(
                                        fontSize: 17,
                                        fontWeight: FontWeight.bold,
                                      ),
                                    ),
                                  ),
                                  Padding(
                                    padding:
                                        EdgeInsets.fromLTRB(20, 0, 20, 0),
                                    child: Text(
                                      "Two dolo 650 one to be taken in the morning, another in the evening",
                                      style: TextStyle(
                                          color: Colors.grey[600]),
                                    ),
                                  ),
                                  Padding(
                                    padding: EdgeInsets.fromLTRB(
                                        20, 0, 20, 10),
                                    child: Text(
                                      "Dr. Shetty",
                                      style: TextStyle(
                                        color: Color.fromARGB(
                                            255, 63, 134, 172),
                                        overflow: TextOverflow.ellipsis,
                                      ),
                                    ),
                                  ),
                                ],
                              )
                            ]),
                          ),
                        ),
                      )
                    ],
                  )

I was trying to fit the text into a container, but it didn't work out. I wanted it to go ... at the end of the container What should I edit or add to fit the text in the container? Can you help me out? [ Also, I am sorry this question might have been asked many times on StackOverflow. ]

Current: enter image description here

Expected: enter image description here

Sahar
  • 35
  • 3
  • 8

3 Answers3

1

Put an Expanded wrapping the Column that contains the Text.

In the source code of your question, that would be 10 lines down from the word "MAY", that Column, wrap an Expanded to it.

WSBT
  • 33,033
  • 18
  • 128
  • 133
1

Take a look at this website:

https://kindacode.com/article/text-overflow-in-flutter

It has the answer to your question!

1

you have to make it flexible size,

for your Column or Row you may use Expanded. here some example if you want to try it

similar question: Overflow within a Column when mapping out items, Flutter

Demo : https://dartpad.dev/?id=7787182fed870e512474ef4779de2271

enter image description here

pmatatias
  • 3,491
  • 3
  • 10
  • 30