AnswerBun.com

Flutter text background with figure

Stack Overflow Asked by talisman7525 on December 1, 2020

Card(
            color: const Color(0xFF202020),
            child: Column(
              children: [
                ListTile(
                    title: const DecoratedBox(
                  decoration:
                      const BoxDecoration(color: const Color(0xFF141414)),
                  child: const Text(
                    'John',
                    style: TextStyle(color: const Color(0xFFE7E7E7)),
                  ),
                )),
                ButtonBar(
                  alignment: MainAxisAlignment.start,
                  children: [
                    FlatButton(
                        textColor: const Color(0xFFE7E7E7),
                        onPressed: () {},
                        child: const Text('Contact'))
                  ],
                )
              ],
            ),
          ),

This is my code for Card.

the result of upper code

this is how upper code executed.

text style what I want

I want the background of the letter not to be connected to the end of the card, but to enter a square with a round end.

One Answer

Hope this helps you.

Center(
        child: Container(
          alignment: Alignment.center,
          margin: const EdgeInsets.all(10),
          height: 65,
          decoration: BoxDecoration(
              color: Color(0xFF202020),
              shape: BoxShape.rectangle,
              borderRadius: BorderRadius.circular(10)),
          child: Text(
            'John',
            textAlign: TextAlign.center,
            style: TextStyle(
              fontWeight: FontWeight.bold,
              fontSize: 22,
              letterSpacing: 0.5,
              color: const Color(0xFFE7E7E7),
            ),
          ),
        ),
      )

Answered by codevk on December 1, 2020

Add your own answers!

Related Questions

Implementing an interface with partial delegation

1  Asked on November 22, 2021 by fabrizio

   

postgresql execute dynamic sql command

2  Asked on November 22, 2021 by boothy

 

How to make dict from dataframe?

2  Asked on November 22, 2021 by oumayma-hamdi

       

IOS Full Screen App: why does toolbar appears when page changes?

1  Asked on November 22, 2021 by joel-hoelting

     

azure build pipeline does not start as triggered

2  Asked on November 22, 2021 by oleksa

 

How to fix Exception with queryStringParameters?

1  Asked on November 22, 2021 by mvn-2047

     

PostGIS ST_X() precision behaviour

1  Asked on November 22, 2021 by vance-tunnicliffe

     

merge Map and Array of objects by key

2  Asked on November 22, 2021

   

Changing react barcode format

1  Asked on November 22, 2021 by mig_08

   

MongoDB Document of Size 300kb taking 8-15s

2  Asked on November 22, 2021 by liqteq-developer

   

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir