What is the ElevatedButton widget?

Why Interviewers Ask This

This question tests conceptual clarity. Interviewers want to hear a precise, confident definition before moving to more complex Flutter topics. It also reveals how well you can explain technical ideas to non-experts.

Answer

ElevatedButton is the standard Material Design button with elevation (shadow), indicating it is raised above the surface. It is the modern replacement for the deprecated RaisedButton. It requires a child (usually a Text widget) and an onPressed callback. Setting onPressed: null automatically disables the button and applies the disabled style. Customize its appearance using the style property with ElevatedButton.styleFrom().

Pro Tip

Demonstrate both theoretical understanding and practical experience. Say what it is, then give an example of how you actually used it in a Flutter codebase.