AppBar bottom widget, not necessarily a TabBar (#4631)

This commit is contained in:
Hans Muller
2016-06-20 12:45:20 -07:00
committed by GitHub
parent ef6a4faa8d
commit c707b53f01
10 changed files with 81 additions and 62 deletions

View File

@@ -119,7 +119,7 @@ class ColorsDemo extends StatelessWidget {
appBar: new AppBar(
elevation: 0,
title: new Text('Colors'),
tabBar: new TabBar<ColorSwatch>(
bottom: new TabBar<ColorSwatch>(
isScrollable: true,
labels: new Map<ColorSwatch, TabLabel>.fromIterable(colorSwatches, value: (ColorSwatch swatch) {
return new TabLabel(text: swatch.name);

View File

@@ -71,7 +71,7 @@ class ScrollableTabsDemoState extends State<ScrollableTabsDemo> {
]
)
],
tabBar: new TabBar<IconData>(
bottom: new TabBar<IconData>(
isScrollable: true,
labels: new Map<IconData, TabLabel>.fromIterable(
icons,

View File

@@ -50,7 +50,7 @@ class TabsDemoState extends State<TabsDemo> {
appBarBehavior: AppBarBehavior.under,
appBar: new AppBar(
title: new Text('Tabs and scrolling'),
tabBar: new TabBar<_Page>(
bottom: new TabBar<_Page>(
labels: new Map<_Page, TabLabel>.fromIterable(_pages, value: (_Page page) {
return new TabLabel(text: page.label);
})

View File

@@ -100,7 +100,7 @@ class _TabsFabDemoState extends State<TabsFabDemo> {
key: scaffoldKey,
appBar: new AppBar(
title: new Text('FAB per tab'),
tabBar: new TabBar<_Page>(
bottom: new TabBar<_Page>(
labels: new Map<_Page, TabLabel>.fromIterable(pages, value: (_Page page) => page.tabLabel)
)
),

View File

@@ -16,15 +16,16 @@ class TwoLevelListDemo extends StatelessWidget {
children: <Widget>[
new TwoLevelListItem(title: new Text('Top')),
new TwoLevelSublist(
title: new Text('Sublist'),
children: <Widget>[
new TwoLevelListItem(title: new Text('One')),
new TwoLevelListItem(title: new Text('Two')),
new TwoLevelListItem(title: new Text('Free')),
new TwoLevelListItem(title: new Text('Four'))
]
),
new TwoLevelListItem(title: new Text('Bottom'))
title: new Text('Sublist'),
children: <Widget>[
new TwoLevelListItem(title: new Text('One')),
new TwoLevelListItem(title: new Text('Two')),
// https://en.wikipedia.org/wiki/Free_Four
new TwoLevelListItem(title: new Text('Free')),
new TwoLevelListItem(title: new Text('Four'))
]
),
new TwoLevelListItem(title: new Text('Bottom'))
]
)
);

View File

@@ -73,7 +73,7 @@ class TabbedComponentDemoScaffold extends StatelessWidget {
child: new Scaffold(
appBar: new AppBar(
title: new Text(title),
tabBar: new TabBar<ComponentDemoTabData>(
bottom: new TabBar<ComponentDemoTabData>(
isScrollable: true,
labels: ComponentDemoTabData.buildTabLabels(demos)
)

View File

@@ -241,7 +241,7 @@ class StockHomeState extends State<StockHome> {
]
)
],
tabBar: new TabBar<StockHomeTab>(
bottom: new TabBar<StockHomeTab>(
labels: <StockHomeTab, TabLabel>{
StockHomeTab.market: new TabLabel(text: StockStrings.of(context).market()),
StockHomeTab.portfolio: new TabLabel(text: StockStrings.of(context).portfolio())