Scaffold Widget

In this lesson, we discuss the Scaffold widget in detail.

Scaffold widget

The Scaffold widget provides the basic material design visual layout implementation for a MaterialApp.

It acts as a single top-level container for most of the material apps.

In this lesson, we’ll cover the following two properties of Scaffold widget:

  1. appBar: This property defines the app bar to be displayed at the top of the scaffold.
  2. body: The main content of the page goes here.

The Scaffold widget will wrap the app’s contents like below:

  return MaterialApp(
      home: Scaffold(
        appBar: AppBar(),
        body: Center(
          child: Text(
             "Hello Flutter !"),
        ),
      ),
    );

Let’s take a look at the visual below to understand what appBar and body mean.

Get hands-on with 1200+ tech skills courses.