What is the Padding widget?

Why Interviewers Ask This

Interviewers use this question to quickly assess whether a candidate has the foundational knowledge required for Flutter development. It reveals whether you understand the building blocks that more complex concepts rely on.

Answer

The Padding widget inserts empty space around its child widget. You define the padding using an EdgeInsets object, which supports all() for equal padding on all sides, symmetric() for horizontal/vertical padding, and only() for padding on specific sides. Example: Padding(padding: EdgeInsets.all(16), child: Text("Hello")). You can also use the padding property directly on the Container widget.

Pro Tip

Back up your answer with a specific project or situation. Saying 'In my last Flutter project, I used this when...' immediately makes your answer more credible and memorable.