TransWikia.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!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP