How to make a Facebook post box in Flutter?

Viewed 295

I want to make a Facebook post box like this in Flutter. When pressed and it will go to another page. How can I make it?

Facebook post box

2 Answers

updated with border

 GestureDetector(
            onTap: () {
              print("Nav to page");
            },
            child: Container(
              height: 50,
              width: 300,
              alignment: Alignment.centerLeft,
              padding: EdgeInsets.only(left: 12),
              decoration: BoxDecoration(
                color: Colors.black,
                borderRadius: BorderRadius.circular(34),
                border: Border.all(
                  color: Colors.grey,
                  width: 1.5,
                ),
              ),
              child: Text(
                "what's on your mind ?",
                style: TextStyle(
                  color: Colors.white,
                ),
              ),
            ),
          ),

Hi :) You should use MaterialPageRoute to Navigate between pages here we go :

Please Up vote Yeasin Sheikh’s answer but this is the one to ✅

GestureDetector(
            onTap: () {
              Navigator.push(context, MaterialPageRoute(builder: (context) => SecondRoute()),
            },
            child: Container(
              height: 50,
              width: 300,
              alignment: Alignment.centerLeft,
              padding: EdgeInsets.only(left: 12),
              decoration: BoxDecoration(
                color: Colors.black,
                borderRadius: BorderRadius.circular(34),
                border: Border.all(
                  color: Colors.grey,
                  width: 1.5,
                ),
              ),
              child: Text(
                "what's on your mind ?",
                style: TextStyle(
                  color: Colors.white,
                ),
              ),
            ),
          ),
Related