What is the SizedBox widget?

Why Interviewers Ask This

Foundational questions like this help interviewers calibrate the rest of the interview. A confident, accurate answer signals that you have solid Flutter basics — a prerequisite for any developer role.

Answer

SizedBox is a simple widget with a fixed width and/or height. It is commonly used in two ways: to give a child widget specific dimensions (SizedBox(width: 200, height: 50, child: Button())), or as an empty spacer between widgets without needing a child (SizedBox(height: 16)). It is more semantically explicit than using Container with just a size, and the Flutter linter prefers it for simple spacing.

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.