Skip to content

Commit 2f5ed33

Browse files
authored
Updated the Drawer API doc to link to NavigationDrawer (#126915)
fixes flutter/flutter#124887
1 parent e62e5c4 commit 2f5ed33

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

packages/flutter/lib/src/material/drawer.dart

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ const Duration _kBaseSettleDuration = Duration(milliseconds: 246);
5353
/// A Material Design panel that slides in horizontally from the edge of a
5454
/// [Scaffold] to show navigation links in an application.
5555
///
56+
/// There is a Material 3 version of this component, [NavigationDrawer],
57+
/// that's preferred for applications that are configured for Material 3
58+
/// (see [ThemeData.useMaterial3]).
59+
///
5660
/// {@youtube 560 315 https://www.youtube.com/watch?v=WRj86iHihgY}
5761
///
5862
/// Drawers are typically used with the [Scaffold.drawer] property. The child of
@@ -67,6 +71,18 @@ const Duration _kBaseSettleDuration = Duration(milliseconds: 246);
6771
///
6872
/// {@animation 350 622 https://flutter.github.io/assets-for-api-docs/assets/material/drawer.mp4}
6973
///
74+
/// ## Updating to [NavigationDrawer]
75+
///
76+
/// There is a Material 3 version of this component, [NavigationDrawer],
77+
/// that's preferred for applications that are configured for Material 3
78+
/// (see [ThemeData.useMaterial3]). The [NavigationDrawer] widget's visual
79+
/// are a little bit different, see the Material 3 spec at
80+
/// <https://m3.material.io/components/navigation-drawer/overview> for
81+
/// more details. While the [Drawer] widget can have only one child, the
82+
/// [NavigationDrawer] widget can have list of widgets, which typically contains
83+
/// [NavigationDrawerDestination] widgets and/or customized widgets like headlines
84+
/// and dividers.
85+
///
7086
/// {@tool snippet}
7187
/// This example shows how to create a [Scaffold] that contains an [AppBar] and
7288
/// a [Drawer]. A user taps the "menu" icon in the [AppBar] to open the

0 commit comments

Comments
 (0)