From 5d3c1ca870a11248ca3df944ce337078a3d15738 Mon Sep 17 00:00:00 2001 From: Hans Muller Date: Thu, 20 Apr 2023 16:21:05 -0700 Subject: [PATCH] Updated the BottomNavigationBar API doc to link to NavigationBar (#125240) The BottomNavigationBar API doc now makes it clear that NavigationBar is preferred in new M3 applications. Fixes https://github.com/flutter/flutter/issues/124687 --- .../lib/src/material/bottom_navigation_bar.dart | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/flutter/lib/src/material/bottom_navigation_bar.dart b/packages/flutter/lib/src/material/bottom_navigation_bar.dart index d7cbc27311..ebcb53638a 100644 --- a/packages/flutter/lib/src/material/bottom_navigation_bar.dart +++ b/packages/flutter/lib/src/material/bottom_navigation_bar.dart @@ -63,6 +63,10 @@ enum BottomNavigationBarLandscapeLayout { /// A material widget that's displayed at the bottom of an app for selecting /// among a small number of views, typically between three and five. /// +/// There is an updated version of this component, [NavigationBar], that's +/// preferred for new applications and applications that are configured +/// for Material 3 (see [ThemeData.useMaterial3]). +/// /// The bottom navigation bar consists of multiple items in the form of /// text labels, icons, or both, laid out on top of a piece of material. It /// provides quick navigation between the top-level views of an app. For larger @@ -94,6 +98,18 @@ enum BottomNavigationBarLandscapeLayout { /// case it's assumed that each item will have a different background color /// and that background color will contrast well with white. /// +/// ## Updating to [NavigationBar] +/// +/// There is an updated version of this component, [NavigationBar], +/// that's preferred for new applications and applications that are +/// configured for Material 3 (see [ThemeData.useMaterial3]). The +/// [NavigationBar] widget's visuals are a little bit different, see +/// the Material 3 spec at +/// for +/// more details. The API is similar, destinations are defined with +/// [NavigationDestination]s and [NavigationBar.onDestinationSelected] +/// is called when a destination is tapped. +/// /// {@tool dartpad} /// This example shows a [BottomNavigationBar] as it is used within a [Scaffold] /// widget. The [BottomNavigationBar] has three [BottomNavigationBarItem]