Home > Blockchain >  Placing button at the bottom of container in flutter
Placing button at the bottom of container in flutter

Time:10-25

How can I create button like below,

enter image description here

CodePudding user response:

 Container(
      padding: EdgeInsets.all(20),
      decoration: BoxDecoration(
          color: Colors.blue,
          borderRadius: BorderRadius.all(Radius.circular(20))),
      child: TextButton(
        child: Text(
          "Profile",
          style: TextStyle(color: Colors.white),
        ),
        onPressed: () {},
      ),
    ),

CodePudding user response:

you can use following code sample...change height according to your need...or use mediaquery for better result:

Container(
      height: 275,
      child: Stack(
      children: [
         Container(//container with background color
         height: 250,
         child: //other widgets
        ),
         Positioned(
         bottom: 0,
         child: //button here
        ),
      ],
    ),
 ),

CodePudding user response:

Try below code hope its helpful to you. used Stack widget Image

  • Related