Scaffold

Scaffold is a built-in widget in Flutter that provides a basic structure for implementing the Material Design visual language. It provides a framework to build the most common UI elements, such as app bars, navigation drawers, floating action buttons, and more.

For instance, creating a basic app in Flutter with a Scaffold widget would look like this:

import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'My Flutter App',
      home: Scaffold(
        appBar: AppBar(
          title: Text('My App Bar'),
        ),
        body: Center(
          child: Text('Hello World!'),
        ),
      ),
    );
  }
}

This creates an app with an app bar and a centered text "Hello World!" as the body.

Attributes

Some common attributes that can be used with the Scaffold widget include: