Home > Enterprise >  (Text) right overflowed by 205 pixels
(Text) right overflowed by 205 pixels

Time:08-25

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

CodePudding user response:

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.

CodePudding user response:

Take a look at this website:

enter image description here

  • Related