How to create a FlatButton in Flutter

0 votes

Hi Guys,

I am new in Flutter. I want to create a FlatButton in my app. How can I do that?

Aug 12, 2020 in Others by akhtar
• 38,260 points
914 views

1 answer to this question.

0 votes

Hi@akhtar,

A flat button is a text label displayed on a Material widget that reacts to touches by filling with color. The below example shows a FlatButton that is normally white-on-blue, with splashes rendered in a different shade of blue. It turns black-on-grey when disabled. The button has 8px of padding on each side, and the text is 20px high.

FlatButton(
  color: Colors.blue,
  textColor: Colors.white,
  disabledColor: Colors.grey,
  disabledTextColor: Colors.black,
  padding: EdgeInsets.all(8.0),
  splashColor: Colors.blueAccent,
  onPressed: () {
    /*...*/
  },
  child: Text(
    "Flat Button",
    style: TextStyle(fontSize: 20.0),
  ),
)

To know more, join our Flutter Certification Course today.

answered Aug 12, 2020 by MD
• 95,460 points

Related Questions In Others

0 votes
1 answer

How to create a container widget in Flutter?

Hi@akhtar, Container means a parent widget that contains ...READ MORE

answered Jul 28, 2020 in Others by MD
• 95,460 points
2,154 views
0 votes
2 answers

How to create a floating button in Flutter?

Scaffold widget provides floatingActionButton property. You can ...READ MORE

answered Nov 9, 2020 in Others by Vijay
• 200 points
5,074 views
0 votes
1 answer

How to create a navigation bar in Flutter app?

Hi@akhtar, To add a drawer to the app, ...READ MORE

answered Aug 25, 2020 in Others by MD
• 95,460 points
863 views
0 votes
0 answers

How to create a batch file in windows?

What is a batch file and How ...READ MORE

Jul 4, 2019 in Others by sindhu
682 views
0 votes
1 answer

What is the future of flutter?

Hi@MD, Flutter is a rather new cross-platform framework ...READ MORE

answered Jul 17, 2020 in Others by akhtar
• 38,260 points
1,116 views
0 votes
1 answer

What is Flutter?

Hi@akhtar, Flutter is an app SDK for building ...READ MORE

answered Jul 17, 2020 in Others by MD
• 95,460 points
1,418 views
0 votes
1 answer

How to install Flutter in Windows system?

Hi@akhtar, You can follow the below-given steps to ...READ MORE

answered Jul 17, 2020 in Others by MD
• 95,460 points
1,760 views
0 votes
1 answer

How to create a Project in Flutter?

Hi@akhtar, Flutter has an inbuilt command to create ...READ MORE

answered Jul 20, 2020 in Others by MD
• 95,460 points
873 views
0 votes
1 answer

How to create a Volume Icon in Flutter App?

Hi@akhtar, You can use Icon Widget to create ...READ MORE

answered Jul 24, 2020 in Others by MD
• 95,460 points
2,079 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP