Commit 67254ef6 authored by Todd Volkert's avatar Todd Volkert Committed by GitHub

Run `dartfmt` on a few of the gallery example files (#6260)

parent 3161d1a5
......@@ -15,7 +15,7 @@ class NavigationIconView {
destinationLabel = new DestinationLabel(
icon: icon,
title: title,
backgroundColor: color
backgroundColor: color,
),
controller = new AnimationController(
duration: kThemeAnimationDuration,
......@@ -23,7 +23,7 @@ class NavigationIconView {
) {
_animation = new CurvedAnimation(
parent: controller,
curve: new Interval(0.5, 1.0, curve: Curves.fastOutSlowIn)
curve: new Interval(0.5, 1.0, curve: Curves.fastOutSlowIn),
);
}
......@@ -39,8 +39,9 @@ class NavigationIconView {
iconColor = _color;
} else {
final ThemeData themeData = Theme.of(context);
iconColor = themeData.brightness == Brightness.light ?
themeData.primaryColor : themeData.accentColor;
iconColor = themeData.brightness == Brightness.light
? themeData.primaryColor
: themeData.accentColor;
}
return new FadeTransition(
......@@ -48,10 +49,10 @@ class NavigationIconView {
child: new SlideTransition(
position: new Tween<FractionalOffset>(
begin: const FractionalOffset(0.0, 0.02), // Small offset from the top.
end: FractionalOffset.topLeft
end: FractionalOffset.topLeft,
).animate(_animation),
child: new Icon(_icon.icon, color: iconColor, size: 120.0)
)
child: new Icon(_icon.icon, color: iconColor, size: 120.0),
),
);
}
}
......@@ -63,7 +64,8 @@ class BottomNavigationDemo extends StatefulWidget {
_BottomNavigationDemoState createState() => new _BottomNavigationDemoState();
}
class _BottomNavigationDemoState extends State<BottomNavigationDemo> with TickerProviderStateMixin {
class _BottomNavigationDemoState extends State<BottomNavigationDemo>
with TickerProviderStateMixin {
int _currentIndex = 0;
BottomNavigationBarType _type = BottomNavigationBarType.shifting;
List<NavigationIconView> _navigationViews;
......@@ -136,9 +138,9 @@ class _BottomNavigationDemoState extends State<BottomNavigationDemo> with Ticker
@override
Widget build(BuildContext context) {
final BottomNavigationBar botNavBar = new BottomNavigationBar(
labels: _navigationViews.map(
(NavigationIconView navigationView) => navigationView.destinationLabel
).toList(),
labels: _navigationViews
.map((NavigationIconView navigationView) => navigationView.destinationLabel)
.toList(),
currentIndex: _currentIndex,
type: _type,
onTap: (int index) {
......@@ -147,7 +149,7 @@ class _BottomNavigationDemoState extends State<BottomNavigationDemo> with Ticker
_currentIndex = index;
_navigationViews[_currentIndex].controller.forward();
});
}
},
);
return new Scaffold(
......@@ -169,9 +171,9 @@ class _BottomNavigationDemoState extends State<BottomNavigationDemo> with Ticker
value: BottomNavigationBarType.shifting,
child: new Text('Shifting'),
)
]
],
)
]
],
),
body: _buildBody(),
bottomNavigationBar: botNavBar,
......
......@@ -12,8 +12,7 @@ const String _raisedText =
const String _raisedCode = 'buttons_raised';
const String _flatText =
"A flat button displays an ink splash on press "
const String _flatText = "A flat button displays an ink splash on press "
"but does not lift. Use flat buttons on toolbars, in dialogs and "
"inline with padding";
......@@ -27,8 +26,8 @@ const String _dropdownText =
const String _dropdownCode = 'buttons_dropdown';
const String _iconText =
"IconButtons are appropriate for toggle buttons that allow a single choice to be "
"selected or deselected, such as adding or removing an item's star.";
"IconButtons are appropriate for toggle buttons that allow a single choice "
"to be selected or deselected, such as adding or removing an item's star.";
const String _iconCode = 'buttons_icon';
......@@ -55,37 +54,37 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
tabName: 'RAISED',
description: _raisedText,
widget: buildRaisedButton(),
exampleCodeTag: _raisedCode
exampleCodeTag: _raisedCode,
),
new ComponentDemoTabData(
tabName: 'FLAT',
description: _flatText,
widget: buildFlatButton(),
exampleCodeTag: _flatCode
exampleCodeTag: _flatCode,
),
new ComponentDemoTabData(
tabName: 'DROPDOWN',
description: _dropdownText,
widget: buildDropdownButton(),
exampleCodeTag: _dropdownCode
exampleCodeTag: _dropdownCode,
),
new ComponentDemoTabData(
tabName: 'ICON',
description: _iconText,
widget: buildIconButton(),
exampleCodeTag: _iconCode
exampleCodeTag: _iconCode,
),
new ComponentDemoTabData(
tabName: 'ACTION',
description: _actionText,
widget: buildActionButton(),
exampleCodeTag: _actionCode
exampleCodeTag: _actionCode,
),
];
return new TabbedComponentDemoScaffold(
title: 'Buttons',
demos: demos
demos: demos,
);
}
......@@ -99,14 +98,14 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
child: new Text('RAISED BUTTON'),
onPressed: () {
// Perform some action
}
},
),
new RaisedButton(
child: new Text('DISABLED'),
onPressed: null
)
]
onPressed: null,
)
],
),
);
}
......@@ -120,14 +119,14 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
child: new Text('FLAT BUTTON'),
onPressed: () {
// Perform some action
}
},
),
new FlatButton(
child: new Text('DISABLED'),
onPressed: null
)
]
onPressed: null,
)
],
),
);
}
......@@ -158,13 +157,14 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
.map((String value) {
return new DropdownMenuItem<String>(
value: value,
child: new Text(value));
child: new Text(value),
);
})
.toList()
)
.toList(),
),
),
new SizedBox(
height: 24.0
height: 24.0,
),
new ListItem(
title: new Text('Simple dropdown:'),
......@@ -176,17 +176,16 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
dropdown2Value = newValue;
});
},
items: <String>['One', 'Two', 'Free', 'Four']
.map((String value) {
items: <String>['One', 'Two', 'Free', 'Four'].map((String value) {
return new DropdownMenuItem<String>(
value: value,
child: new Text(value));
})
.toList()
)
)
]
child: new Text(value),
);
}).toList(),
),
)
],
),
);
}
......@@ -203,16 +202,16 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
onPressed: () {
setState(() => iconButtonToggle = !iconButtonToggle);
},
color: iconButtonToggle ? Theme.of(context).primaryColor : null
color: iconButtonToggle ? Theme.of(context).primaryColor : null,
),
new IconButton(
icon: new Icon(Icons.thumb_up),
onPressed: null
onPressed: null,
)
]
.map((Widget button) => new SizedBox(width: 64.0, height: 64.0, child: button))
.toList()
)
.toList(),
),
);
}
......@@ -223,8 +222,8 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
child: new Icon(Icons.add),
onPressed: () {
// Perform some action
}
)
},
),
);
}
}
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