Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Write text on the icon in flutter

Tags:

flutter

dart

enter image description here

And I am Using this code: how to set this kind of layout in flutter

Container(
      height: 200.0,
      decoration: new BoxDecoration(
        color: Colors.white,
        shape: BoxShape.circle,
      ),
      child: Center(
        child: Stack(
          children: <Widget>[
            Icon(Icons.play_arrow, color: Colors.blue, size: 200.0,)
          ],
        ),
      ),

    );
like image 672
mr.hir Avatar asked Dec 11 '22 03:12

mr.hir


1 Answers

try this, you have to just make Stack alignment to center and add a Text in Stack array.

Container(
      height: 200.0,
      decoration: new BoxDecoration(
        color: Colors.white,
        shape: BoxShape.circle,
      ),
      child: Center(
        child: Stack(
          alignment: Alignment.center,
          children: <Widget>[
            Icon(
              Icons.play_arrow,
              color: Colors.blue,
              size: 200.0,
            ),
            Text(
              "Play",
              style: TextStyle(fontSize: 18,color: Colors.white),
            ),
          ],
        ),
      ),
    )
like image 79
Amol Gangadhare Avatar answered Jan 19 '23 09:01

Amol Gangadhare