How to use the flat button in Flutter

0 votes

Hi Team,

I am using the Flutter Framework to create an Android App. I want to use the Flat Button. How can I use that? 

Oct 20, 2020 in Others by akhtar
• 38,260 points
4,618 views

2 answers to this question.

0 votes

Hi@akhtar,

You can use the FlatButton inside a Widget. For example, in the container widget, you must define the onPressed property as shown below.

container( 
child: FlatButton( 
  child: Text('Text here'), 
onPressed: (){ print('Button pressed'); }, 
), 
);

To know more about Flutter, join our Flutter Certification today.

answered Oct 20, 2020 by MD
• 95,460 points
+1 vote

FlatButton is really easy to use.

Where ever you need it. Just add

 FlatButton(
child: Text('FlatButton'),
color: Colors.white,
onPressed: () {
print("FlatButton tapped");
},
),
Full source code down below.
``` import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: FlatButton(
child: Text('FlatButton'),
color: Colors.white,
onPressed: () {
print("FlatButton tapped");
},
),
);
}
}
answered Nov 9, 2020 by Vijay
• 200 points

edited Nov 9, 2020 by MD

Related Questions In Others

0 votes
1 answer

How can I use a command button in excel to set the value of multiple cells in one click?

Try this: Private Scan As Integer Private Sub CommandButton1_Click() ...READ MORE

answered Oct 24, 2022 in Others by narikkadan
• 63,600 points
795 views
0 votes
1 answer

How to check the connected device name in Flutter?

Hi@akhtar, Flutter has its command own command to ...READ MORE

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

How to create an Icon Button in Flutter?

Hi@akhtar, To create an Icon Button in Flutter, ...READ MORE

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

How to use hexadecimal color strings in Flutter?

Hi@akhtar, In Flutter the Color class only accepts integers as parameters, or there ...READ MORE

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

How to change the background color of AppBar in Flutter?

Hi@akhtar, You can add backgroundColor keyword in your ...READ MORE

answered Aug 12, 2020 in Others by MD
• 95,460 points
2,121 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,177 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,492 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,800 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,109 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