Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
d3cdb270
Commit
d3cdb270
authored
Nov 03, 2016
by
Ian Hickson
Committed by
GitHub
Nov 03, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More documentation for drawers. (#6697)
Closes
https://github.com/flutter/flutter/issues/5781
parent
a7debdc7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
3 deletions
+19
-3
drawer.dart
packages/flutter/lib/src/material/drawer.dart
+11
-3
drawer_item.dart
packages/flutter/lib/src/material/drawer_item.dart
+2
-0
scaffold.dart
packages/flutter/lib/src/material/scaffold.dart
+6
-0
No files found.
packages/flutter/lib/src/material/drawer.dart
View file @
d3cdb270
...
...
@@ -34,11 +34,19 @@ const Duration _kBaseSettleDuration = const Duration(milliseconds: 246);
/// Typically, the child of the drawer is a [Block] whose first child is a
/// [DrawerHeader] that displays status information about the current user.
///
/// The [Scaffold] automatically shows an appropriate [IconButton], and handles
/// the edge-swipe gesture, to show the drawer.
///
/// See also:
///
/// * [Scaffold.drawer]
/// * [DrawerItem]
/// * [DrawerHeader]
/// * [Scaffold.drawer], where one specifies a [Drawer] so that it can be
/// shown.
/// * [Scaffold.of], to obtain the current [ScaffoldState], which manages the
/// display and animation of the drawer.
/// * [ScaffoldState.openDrawer], which displays its [Drawer], if any.
/// * [Navigator.pop], which closes the drawer if it is open.
/// * [DrawerItem], a widget for items in drawers.
/// * [DrawerHeader], a widget for the top part of a drawer.
/// * <https://material.google.com/patterns/navigation-drawer.html>
class
Drawer
extends
StatelessWidget
{
/// Creates a material design drawer.
...
...
packages/flutter/lib/src/material/drawer_item.dart
View file @
d3cdb270
...
...
@@ -52,6 +52,8 @@ class DrawerItem extends StatelessWidget {
/// Called when the user taps this drawer item.
///
/// If null, the drawer item is displayed as disabled.
///
/// To close the [Drawer] when an item is pressed, call [Navigator.pop].
final
VoidCallback
onPressed
;
/// Whether this drawer item is currently selected.
...
...
packages/flutter/lib/src/material/scaffold.dart
View file @
d3cdb270
...
...
@@ -504,6 +504,12 @@ class ScaffoldState extends State<Scaffold> with TickerProviderStateMixin {
///
/// If the scaffold has a non-null [Scaffold.drawer], this function will cause
/// the drawer to begin its entrance animation.
///
/// Normally this is not needed since the [Scaffold] automatically shows an
/// appropriate [IconButton], and handles the edge-swipe gesture, to show the
/// drawer.
///
/// To close the drawer once it is open, use [Navigator.pop].
void
openDrawer
()
{
_drawerKey
.
currentState
?.
open
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment