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
33f9afd9
Unverified
Commit
33f9afd9
authored
Mar 12, 2018
by
Hans Muller
Committed by
GitHub
Mar 12, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated the BottomNavigationBar class doc (#15347)
parent
11d81b11
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
11 deletions
+27
-11
bottom_navigation_bar.dart
packages/flutter/lib/src/material/bottom_navigation_bar.dart
+27
-11
No files found.
packages/flutter/lib/src/material/bottom_navigation_bar.dart
View file @
33f9afd9
...
...
@@ -41,7 +41,7 @@ enum BottomNavigationBarType {
}
/// A material widget displayed at the bottom of an app for selecting among a
/// small number of views.
/// small number of views
, typically between three and five
.
///
/// 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
...
...
@@ -51,6 +51,23 @@ enum BottomNavigationBarType {
/// A bottom navigation bar is usually used in conjunction with a [Scaffold],
/// where it is provided as the [Scaffold.bottomNavigationBar] argument.
///
/// The bottom navigation bar's [type] changes how its [items] are displayed.
/// If not specified it's automatically set to [BottomNavigationBarType.fixed]
/// when there are less than four items, [BottomNavigationBarType.shifting]
/// otherwise.
///
/// * [BottomNavigationBarType.fixed], the default when there are less than
/// four [items]. The selected item is rendered with [fixedColor] if it's
/// non-null, otherwise the theme's [ThemeData.primaryColor] is used. The
/// navigation bar's background color is the default [Material] background
/// color, [ThemeData.canvasColor] (essentially opaque white).
/// * [BottomNavigationBarType.shifting], the default when there are four
/// or more [items]. All items are rendered in white and the navigation bar's
/// background color is the same as the
/// [BottomNavigationBarItem.backgroundColor] of the selected item. In this
/// case it's assumed that each item will have a different background color
/// and that background color will contrast well with white.
///
/// See also:
///
/// * [BottomNavigationBarItem]
...
...
@@ -60,16 +77,14 @@ class BottomNavigationBar extends StatefulWidget {
/// Creates a bottom navigation bar, typically used in a [Scaffold] where it
/// is provided as the [Scaffold.bottomNavigationBar] argument.
///
/// The
argument [items] should not be null
.
/// The
length of [items] must be at least two
.
///
/// The number of items passed should be equal to, or greater than, two. If
/// three or fewer items are passed, then the default [type] (if [type] is
/// null or not given) will be [BottomNavigationBarType.fixed], and if more
/// than three items are passed, will be [BottomNavigationBarType.shifting].
/// If [type] is null then [BottomNavigationBarType.fixed] is used when there
/// are two or three [items], [BottomNavigationBarType.shifting] otherwise.
///
///
Passing a null [fixedColor] will cause a fallback to the theme's primary
///
color. The [fixedColor] field will be ignored if the
[BottomNavigationBar.type] is
///
not [BottomNavigationBarType.fixed]
.
///
If [fixedColor] is null then the theme's primary color,
///
[ThemeData.primaryColor], is used. However if
[BottomNavigationBar.type] is
///
[BottomNavigationBarType.shifting] then [fixedColor] is ignored
.
BottomNavigationBar
({
Key
key
,
@required
this
.
items
,
...
...
@@ -107,8 +122,9 @@ class BottomNavigationBar extends StatefulWidget {
/// The color of the selected item when bottom navigation bar is
/// [BottomNavigationBarType.fixed].
///
/// If [fixedColor] is null, it will use the theme's primary color. The [fixedColor]
/// field will be ignored if the [type] is not [BottomNavigationBarType.fixed].
/// If [fixedColor] is null then the theme's primary color,
/// [ThemeData.primaryColor], is used. However if [BottomNavigationBar.type] is
/// [BottomNavigationBarType.shifting] then [fixedColor] is ignored.
final
Color
fixedColor
;
/// The size of all of the [BottomNavigationBarItem] icons.
...
...
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