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

Does anyone know how to fix this? TextOverflow.ellipsis does not help to put ellipsis

I need that if the user had a long nickname, then an ellipsis would appear, but it does not work.

Here is a screenshot

Here is the code:

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

AppBar(
          elevation: 0,
          toolbarHeight: 76,
          backgroundColor: Colors.transparent,
          title: Row(
            children: [
              widget.isActiveBackButton
                  ? IconButton(
                      onPressed: () {
                        Navigator.of(context).pop();
                      },
                      icon: Icon(
                        Icons.arrow_back_rounded,
                        color: Colors.black87.withOpacity(0.7),
                        size: 30,
                      ))
                  : Container(),
              widget.isActiveBackButton
                  ? const SizedBox(
                      width: 20,
                    )
                  : Container(),
              Padding(
                padding: const EdgeInsets.only(right: 20.0),
                child: Row(
                  children: [
                    Text(
                      'WWWWWWWWWWWW',
                      textAlign: TextAlign.center,
                      overflow: TextOverflow.ellipsis,
                      style: GoogleFonts.roboto(
                          textStyle: TextStyle(
                        fontSize: 25,
                        fontWeight: FontWeight.w700,
                        color: Colors.black87.withOpacity(0.7),
                      )),
                    ),
                    const SizedBox(width: 5.0),
                    !UserData.isVerifiedAccount
                        ? Icon(
                            Icons.star_rounded,
                            color: Colors.yellow.shade700,
                            size: 30,
                          )
                        : Container(),
                  ],
                ),
              ),
            ],
          ),
          actions: [
            Row(
              children: [
                Container(
                  margin: const EdgeInsets.only(right: 15.0),
                  child: CircleAvatar(
                    radius: 25,
                    child: Material(
                      borderRadius: BorderRadius.circular(100.0),
                      clipBehavior: Clip.antiAlias,
                      color: Colors.redAccent,
                      child: SizedBox(
                        width: 100,
                        height: 50,
                        child: InkWell(
                          onTap: () {
                            Navigator.of(context).push(MaterialPageRoute(
                                builder: (context) =>
                                    const MyLikesScreen()));
                          },
                          child: const Icon(
                            Icons.favorite_rounded,
                            size: 25,
                          ),
                        ),
                      ),
                      shadowColor: Colors.black,
                      elevation: 5,
                    ),
                  ),
                ),
              ],
            )
          ],
        ),

>Solution :

Follow this structure

Expanded(
  child: Padding(
    padding: const EdgeInsets.all(8.0),
    child: Row(
      children: [
        Flexible(
          child: Text(
            'WWWWWWWWWWWW',
 appBar: AppBar(
  elevation: 0,
  toolbarHeight: 76,
  backgroundColor: Colors.transparent,
  title: Row(
    children: [
      IconButton(
          onPressed: () {
            Navigator.of(context).pop();
          },
          icon: Icon(
            Icons.arrow_back_rounded,
            color: Colors.black87.withOpacity(0.7),
            size: 30,
          )),
      const SizedBox(
        width: 20,
      ),
      Expanded(
        child: Padding(
          padding: const EdgeInsets.all(8.0),
          child: Row(
            children: [
              Flexible(
                child: Text(
                  'WWWWWWWWWWWW',
                  textAlign: TextAlign.center,
                  overflow: TextOverflow.ellipsis,
                  style: GoogleFonts.roboto(
                      textStyle: TextStyle(
                    fontSize: 25,
                    fontWeight: FontWeight.w700,
                    color: Colors.black87.withOpacity(0.7),
                  )),
                ),
              ),
              const SizedBox(width: 5.0),
              Icon(
                Icons.star_rounded,
                color: Colors.yellow.shade700,
                size: 30,
              ),
            ],
          ),
        ),
      ),
    ],
  ),
  actions: [
    Row(
      children: [
        Container(
          margin: const EdgeInsets.only(right: 15.0),
          child: CircleAvatar(
            radius: 25,
            child: Material(
              borderRadius: BorderRadius.circular(100.0),
              clipBehavior: Clip.antiAlias,
              color: Colors.redAccent,
              child: SizedBox(
                width: 100,
                height: 50,
                child: InkWell(
                  onTap: () {},
                  child: const Icon(
                    Icons.favorite_rounded,
                    size: 25,
                  ),
                ),
              ),
              shadowColor: Colors.black,
              elevation: 5,
            ),
          ),
        ),
      ],
    )
  ],
),

  
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