0
0
Fluttermobile~5 mins

ElevatedButton and TextButton in Flutter - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is an ElevatedButton in Flutter?
An ElevatedButton is a button with a shadow that lifts it above the surface, making it stand out. It is used for important actions in your app.
Click to reveal answer
beginner
What is a TextButton in Flutter?
A TextButton is a simple button with no shadow or background by default. It looks like text and is used for less prominent actions.
Click to reveal answer
beginner
How do you create an ElevatedButton with a label 'Click Me'?
Use ElevatedButton(onPressed: () {}, child: Text('Click Me')) to create a button with the label 'Click Me'.
Click to reveal answer
beginner
How do you handle a button press in Flutter?
You provide a function to the onPressed property of the button. This function runs when the user taps the button.
Click to reveal answer
beginner
When should you use ElevatedButton vs TextButton?
Use ElevatedButton for main actions that need emphasis. Use TextButton for less important actions or inline links.
Click to reveal answer
Which Flutter button shows a shadow by default?
AElevatedButton
BTextButton
CIconButton
DFlatButton
What property do you use to specify what happens when a button is tapped?
AonPressed
Bchild
Clabel
Dstyle
Which button type looks like plain text by default?
AElevatedButton
BTextButton
CFloatingActionButton
DOutlinedButton
How do you add a label to an ElevatedButton?
AUse the text property
BUse the label property
CUse the title property
DUse the child property with a Text widget
Which button is best for a primary action in your app?
AIconButton
BTextButton
CElevatedButton
DCheckbox
Explain the difference between ElevatedButton and TextButton in Flutter.
Think about how each button looks and when you would use them.
You got /4 concepts.
    Describe how to create a button in Flutter that prints 'Hello' when tapped.
    Focus on the onPressed and child properties.
    You got /4 concepts.