Commit 1b9939af authored by Luke's avatar Luke Committed by Ian Hickson

Rename DestinationLabel on BottomNavigationBar (#7281)

* rename DestinationLabel and labels properties to BottomNavigationBarItem and items

* update/fix comments

* grammatical changes

* add myself to AUTHORS
parent 3e3d2192
...@@ -12,3 +12,4 @@ Günter Zöchbauer <guenter@gzoechbauer.com> ...@@ -12,3 +12,4 @@ Günter Zöchbauer <guenter@gzoechbauer.com>
Raju Bitter <rajubitter@gmail.com> Raju Bitter <rajubitter@gmail.com>
Michael Beckler <mcbeckler@gmail.com> Michael Beckler <mcbeckler@gmail.com>
Alexandre Ardhuin <alexandre.ardhuin@gmail.com> Alexandre Ardhuin <alexandre.ardhuin@gmail.com>
Luke Freeman <luke@goposse.com>
...@@ -12,7 +12,7 @@ class NavigationIconView { ...@@ -12,7 +12,7 @@ class NavigationIconView {
TickerProvider vsync, TickerProvider vsync,
}) : _icon = icon, }) : _icon = icon,
_color = color, _color = color,
destinationLabel = new DestinationLabel( item = new BottomNavigationBarItem(
icon: icon, icon: icon,
title: title, title: title,
backgroundColor: color, backgroundColor: color,
...@@ -29,7 +29,7 @@ class NavigationIconView { ...@@ -29,7 +29,7 @@ class NavigationIconView {
final Widget _icon; final Widget _icon;
final Color _color; final Color _color;
final DestinationLabel destinationLabel; final BottomNavigationBarItem item;
final AnimationController controller; final AnimationController controller;
CurvedAnimation _animation; CurvedAnimation _animation;
...@@ -165,8 +165,8 @@ class _BottomNavigationDemoState extends State<BottomNavigationDemo> ...@@ -165,8 +165,8 @@ class _BottomNavigationDemoState extends State<BottomNavigationDemo>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final BottomNavigationBar botNavBar = new BottomNavigationBar( final BottomNavigationBar botNavBar = new BottomNavigationBar(
labels: _navigationViews items: _navigationViews
.map((NavigationIconView navigationView) => navigationView.destinationLabel) .map((NavigationIconView navigationView) => navigationView.item)
.toList(), .toList(),
currentIndex: _currentIndex, currentIndex: _currentIndex,
type: _type, type: _type,
......
...@@ -12,12 +12,12 @@ void main() { ...@@ -12,12 +12,12 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
new Scaffold( new Scaffold(
bottomNavigationBar: new BottomNavigationBar( bottomNavigationBar: new BottomNavigationBar(
labels: <DestinationLabel>[ items: <BottomNavigationBarItem>[
new DestinationLabel( new BottomNavigationBarItem(
icon: new Icon(Icons.ac_unit), icon: new Icon(Icons.ac_unit),
title: new Text('AC') title: new Text('AC')
), ),
new DestinationLabel( new BottomNavigationBarItem(
icon: new Icon(Icons.access_alarm), icon: new Icon(Icons.access_alarm),
title: new Text('Alarm') title: new Text('Alarm')
) )
...@@ -38,12 +38,12 @@ void main() { ...@@ -38,12 +38,12 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
new Scaffold( new Scaffold(
bottomNavigationBar: new BottomNavigationBar( bottomNavigationBar: new BottomNavigationBar(
labels: <DestinationLabel>[ items: <BottomNavigationBarItem>[
new DestinationLabel( new BottomNavigationBarItem(
icon: new Icon(Icons.ac_unit), icon: new Icon(Icons.ac_unit),
title: new Text('AC') title: new Text('AC')
), ),
new DestinationLabel( new BottomNavigationBarItem(
icon: new Icon(Icons.access_alarm), icon: new Icon(Icons.access_alarm),
title: new Text('Alarm') title: new Text('Alarm')
) )
...@@ -63,12 +63,12 @@ void main() { ...@@ -63,12 +63,12 @@ void main() {
new Scaffold( new Scaffold(
bottomNavigationBar: new BottomNavigationBar( bottomNavigationBar: new BottomNavigationBar(
type: BottomNavigationBarType.shifting, type: BottomNavigationBarType.shifting,
labels: <DestinationLabel>[ items: <BottomNavigationBarItem>[
new DestinationLabel( new BottomNavigationBarItem(
icon: new Icon(Icons.ac_unit), icon: new Icon(Icons.ac_unit),
title: new Text('AC') title: new Text('AC')
), ),
new DestinationLabel( new BottomNavigationBarItem(
icon: new Icon(Icons.access_alarm), icon: new Icon(Icons.access_alarm),
title: new Text('Alarm') title: new Text('Alarm')
) )
...@@ -87,12 +87,12 @@ void main() { ...@@ -87,12 +87,12 @@ void main() {
bottomNavigationBar: new BottomNavigationBar( bottomNavigationBar: new BottomNavigationBar(
currentIndex: 1, currentIndex: 1,
type: BottomNavigationBarType.shifting, type: BottomNavigationBarType.shifting,
labels: <DestinationLabel>[ items: <BottomNavigationBarItem>[
new DestinationLabel( new BottomNavigationBarItem(
icon: new Icon(Icons.ac_unit), icon: new Icon(Icons.ac_unit),
title: new Text('AC') title: new Text('AC')
), ),
new DestinationLabel( new BottomNavigationBarItem(
icon: new Icon(Icons.access_alarm), icon: new Icon(Icons.access_alarm),
title: new Text('Alarm') title: new Text('Alarm')
) )
...@@ -114,20 +114,20 @@ void main() { ...@@ -114,20 +114,20 @@ void main() {
new Scaffold( new Scaffold(
bottomNavigationBar: new BottomNavigationBar( bottomNavigationBar: new BottomNavigationBar(
type: BottomNavigationBarType.shifting, type: BottomNavigationBarType.shifting,
labels: <DestinationLabel>[ items: <BottomNavigationBarItem>[
new DestinationLabel( new BottomNavigationBarItem(
icon: new Icon(Icons.ac_unit), icon: new Icon(Icons.ac_unit),
title: new Text('AC') title: new Text('AC')
), ),
new DestinationLabel( new BottomNavigationBarItem(
icon: new Icon(Icons.access_alarm), icon: new Icon(Icons.access_alarm),
title: new Text('Alarm') title: new Text('Alarm')
), ),
new DestinationLabel( new BottomNavigationBarItem(
icon: new Icon(Icons.access_time), icon: new Icon(Icons.access_time),
title: new Text('Time') title: new Text('Time')
), ),
new DestinationLabel( new BottomNavigationBarItem(
icon: new Icon(Icons.add), icon: new Icon(Icons.add),
title: new Text('Add') title: new Text('Add')
) )
...@@ -174,20 +174,20 @@ void main() { ...@@ -174,20 +174,20 @@ void main() {
child: new Scaffold( child: new Scaffold(
bottomNavigationBar: new BottomNavigationBar( bottomNavigationBar: new BottomNavigationBar(
type: BottomNavigationBarType.shifting, type: BottomNavigationBarType.shifting,
labels: <DestinationLabel>[ items: <BottomNavigationBarItem>[
new DestinationLabel( new BottomNavigationBarItem(
icon: new Icon(Icons.ac_unit), icon: new Icon(Icons.ac_unit),
title: new Text('AC') title: new Text('AC')
), ),
new DestinationLabel( new BottomNavigationBarItem(
icon: new Icon(Icons.access_alarm), icon: new Icon(Icons.access_alarm),
title: new Text('Alarm') title: new Text('Alarm')
), ),
new DestinationLabel( new BottomNavigationBarItem(
icon: new Icon(Icons.access_time), icon: new Icon(Icons.access_time),
title: new Text('Time') title: new Text('Time')
), ),
new DestinationLabel( new BottomNavigationBarItem(
icon: new Icon(Icons.add), icon: new Icon(Icons.add),
title: new Text('Add') title: new Text('Add')
) )
...@@ -212,20 +212,20 @@ void main() { ...@@ -212,20 +212,20 @@ void main() {
child: new Scaffold( child: new Scaffold(
bottomNavigationBar: new BottomNavigationBar( bottomNavigationBar: new BottomNavigationBar(
type: BottomNavigationBarType.fixed, type: BottomNavigationBarType.fixed,
labels: <DestinationLabel>[ items: <BottomNavigationBarItem>[
new DestinationLabel( new BottomNavigationBarItem(
icon: new Icon(Icons.ac_unit), icon: new Icon(Icons.ac_unit),
title: new Text('AC') title: new Text('AC')
), ),
new DestinationLabel( new BottomNavigationBarItem(
icon: new Icon(Icons.access_alarm), icon: new Icon(Icons.access_alarm),
title: new Text('Alarm') title: new Text('Alarm')
), ),
new DestinationLabel( new BottomNavigationBarItem(
icon: new Icon(Icons.access_time), icon: new Icon(Icons.access_time),
title: new Text('Time') title: new Text('Time')
), ),
new DestinationLabel( new BottomNavigationBarItem(
icon: new Icon(Icons.add), icon: new Icon(Icons.add),
title: new Text('Add') title: new Text('Add')
) )
...@@ -247,12 +247,12 @@ void main() { ...@@ -247,12 +247,12 @@ void main() {
new Scaffold( new Scaffold(
bottomNavigationBar: new BottomNavigationBar( bottomNavigationBar: new BottomNavigationBar(
iconSize: 12.0, iconSize: 12.0,
labels: <DestinationLabel>[ items: <BottomNavigationBarItem>[
new DestinationLabel( new BottomNavigationBarItem(
title: new Text('A'), title: new Text('A'),
icon: new Icon(Icons.ac_unit), icon: new Icon(Icons.ac_unit),
), ),
new DestinationLabel( new BottomNavigationBarItem(
title: new Text('B'), title: new Text('B'),
icon: new Builder( icon: new Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment