Skip to content

Scaffold

Material

demo

scaffold-material.png

code
Terminal window
import 'package:flutter/material.dart';
Scaffold(
appBar: AppBar(
title: const Text('Page'),
),
body: SizedBox(),
floatingActionButton: FloatingActionButton(
onPressed: () => print('Pressed'),
child: Icon(Icons.add),
),
)

Cupertino

demo

scaffold-cupertino.png

code
Terminal window
import 'package:flutter/cupertino.dart';
CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar(
middle: Text('Page'),
), // AppBar
child: Stack(
children: [
const SizedBox(), // body
Positioned(
bottom: 16.0,
right: 16.0,
child: CupertinoButton(
child: const Icon(CupertinoIcons.add),
onPressed: () {},
), // floatingActionButton
),
],
),
);

Further reading