diff --git a/examples/flutter_gallery/lib/demo/bottom_navigation_demo.dart b/examples/flutter_gallery/lib/demo/bottom_navigation_demo.dart index c6e74f72b1..ccafdd15de 100644 --- a/examples/flutter_gallery/lib/demo/bottom_navigation_demo.dart +++ b/examples/flutter_gallery/lib/demo/bottom_navigation_demo.dart @@ -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( 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 with TickerProviderStateMixin { +class _BottomNavigationDemoState extends State + with TickerProviderStateMixin { int _currentIndex = 0; BottomNavigationBarType _type = BottomNavigationBarType.shifting; List _navigationViews; @@ -136,9 +138,9 @@ class _BottomNavigationDemoState extends State 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 with Ticker _currentIndex = index; _navigationViews[_currentIndex].controller.forward(); }); - } + }, ); return new Scaffold( @@ -169,9 +171,9 @@ class _BottomNavigationDemoState extends State with Ticker value: BottomNavigationBarType.shifting, child: new Text('Shifting'), ) - ] + ], ) - ] + ], ), body: _buildBody(), bottomNavigationBar: botNavBar, diff --git a/examples/flutter_gallery/lib/demo/buttons_demo.dart b/examples/flutter_gallery/lib/demo/buttons_demo.dart index 25f20e0eb9..fafb72d732 100644 --- a/examples/flutter_gallery/lib/demo/buttons_demo.dart +++ b/examples/flutter_gallery/lib/demo/buttons_demo.dart @@ -7,36 +7,35 @@ import 'package:flutter/material.dart'; import '../gallery/demo.dart'; const String _raisedText = - "Raised buttons add dimension to mostly flat layouts. They emphasize " - "functions on busy or wide spaces."; + "Raised buttons add dimension to mostly flat layouts. They emphasize " + "functions on busy or wide spaces."; const String _raisedCode = 'buttons_raised'; -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"; +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"; const String _flatCode = 'buttons_flat'; const String _dropdownText = - "A dropdown button displays a menu that's used to select a value from a " - "small set of values. The button displays the current value and a down " - "arrow."; + "A dropdown button displays a menu that's used to select a value from a " + "small set of values. The button displays the current value and a down " + "arrow."; 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'; const String _actionText = - "Floating action buttons are used for a promoted action. They are " - "distinguished by a circled icon floating above the UI and can have motion " - "behaviors that include morphing, launching, and a transferring anchor " - "point."; + "Floating action buttons are used for a promoted action. They are " + "distinguished by a circled icon floating above the UI and can have motion " + "behaviors that include morphing, launching, and a transferring anchor " + "point."; const String _actionCode = 'buttons_action'; @@ -55,37 +54,37 @@ class _ButtonsDemoState extends State { 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 { 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 { 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 { .map((String value) { return new DropdownMenuItem( 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 { dropdown2Value = newValue; }); }, - items: ['One', 'Two', 'Free', 'Four'] - .map((String value) { - return new DropdownMenuItem( - value: value, - child: new Text(value)); - }) - .toList() - ) + items: ['One', 'Two', 'Free', 'Four'].map((String value) { + return new DropdownMenuItem( + value: value, + child: new Text(value), + ); + }).toList(), + ), ) - ] - ) + ], + ), ); } @@ -203,16 +202,16 @@ class _ButtonsDemoState extends State { 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 { child: new Icon(Icons.add), onPressed: () { // Perform some action - } - ) + }, + ), ); } }