Skip to content

Commit

Permalink
added sample code for scaffold widget [flutter#21136]
Browse files Browse the repository at this point in the history
  • Loading branch information
NPKompleet committed Sep 9, 2018
1 parent e8fa45c commit 17e7308
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions packages/flutter/lib/src/material/scaffold.dart
Expand Up @@ -662,6 +662,41 @@ class _FloatingActionButtonTransitionState extends State<_FloatingActionButtonTr
/// [ScaffoldState] for the current [BuildContext] via [Scaffold.of] and use the
/// [ScaffoldState.showSnackBar] and [ScaffoldState.showBottomSheet] functions.
///
/// ## Sample code
///
/// This example shows a [Scaffold] with an [AppBar], a [BottomAppBar]
/// and a [FloatingActionButton]. The [body] is a [Text] placed in a [Center]
/// in order to center the text within the [Scaffold] and the
/// [FloatingActionButton] is centered and docked within the
/// [BottomAppBar] using [FloatingActionButtonLocation.centerDocked].
///
/// ```dart
/// Scaffold(
/// appBar: AppBar(
/// title: Text('Sample Code'),
/// ),
/// body: Center(
/// child: Text(
/// 'Scaffold',
/// ),
/// ),
///
/// bottomNavigationBar: BottomAppBar(
/// child: Container(
/// height: 50.0,
/// ),
/// ),
///
/// floatingActionButton: FloatingActionButton(
/// onPressed: () {},
/// tooltip: 'Increment',
/// child: Icon(Icons.add),
/// ),
///
/// floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
/// )
/// ```
///
/// See also:
///
/// * [AppBar], which is a horizontal bar typically shown at the top of an app
Expand Down

0 comments on commit 17e7308

Please sign in to comment.