The const will continue until morale improves (#9536)

This commit is contained in:
Adam Barth 2017-04-21 14:59:24 -07:00 committed by GitHub
parent 76ecb0b9a1
commit 0d0861b3ee
3 changed files with 29 additions and 29 deletions

View File

@ -96,45 +96,45 @@ class TopBarMenu extends StatelessWidget {
return new PopupMenuButton<String>(
onSelected: (String value) { print('Selected: $value'); },
itemBuilder: (BuildContext context) => <PopupMenuItem<String>>[
new PopupMenuItem<String>(
const PopupMenuItem<String>(
value: 'Friends',
child: new MenuItemWithIcon(Icons.people, 'Friends', '5 new')
child: const MenuItemWithIcon(Icons.people, 'Friends', '5 new')
),
const PopupMenuItem<String>(
value: 'Events',
child: const MenuItemWithIcon(Icons.event, 'Events', '12 upcoming')
),
new PopupMenuItem<String>(
const PopupMenuItem<String>(
value: 'Events',
child: new MenuItemWithIcon(Icons.group, 'Groups', '14')
child: const MenuItemWithIcon(Icons.group, 'Groups', '14')
),
new PopupMenuItem<String>(
const PopupMenuItem<String>(
value: 'Events',
child: new MenuItemWithIcon(Icons.image, 'Pictures', '12')
child: const MenuItemWithIcon(Icons.image, 'Pictures', '12')
),
new PopupMenuItem<String>(
const PopupMenuItem<String>(
value: 'Events',
child: new MenuItemWithIcon(Icons.near_me, 'Nearby', '33')
child: const MenuItemWithIcon(Icons.near_me, 'Nearby', '33')
),
new PopupMenuItem<String>(
const PopupMenuItem<String>(
value: 'Friends',
child: new MenuItemWithIcon(Icons.people, 'Friends', '5')
child: const MenuItemWithIcon(Icons.people, 'Friends', '5')
),
const PopupMenuItem<String>(
value: 'Events',
child: const MenuItemWithIcon(Icons.event, 'Events', '12')
),
new PopupMenuItem<String>(
const PopupMenuItem<String>(
value: 'Events',
child: new MenuItemWithIcon(Icons.group, 'Groups', '14')
child: const MenuItemWithIcon(Icons.group, 'Groups', '14')
),
new PopupMenuItem<String>(
const PopupMenuItem<String>(
value: 'Events',
child: new MenuItemWithIcon(Icons.image, 'Pictures', '12')
child: const MenuItemWithIcon(Icons.image, 'Pictures', '12')
),
new PopupMenuItem<String>(
const PopupMenuItem<String>(
value: 'Events',
child: new MenuItemWithIcon(Icons.near_me, 'Nearby', '33')
child: const MenuItemWithIcon(Icons.near_me, 'Nearby', '33')
)
]
);
@ -234,7 +234,7 @@ class IconBar extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
const IconWithText(Icons.thumb_up, 'Like'),
new IconWithText(Icons.comment, 'Comment'),
const IconWithText(Icons.comment, 'Comment'),
const IconWithText(Icons.share, 'Share'),
]
)
@ -530,13 +530,13 @@ class BottomBar extends StatelessWidget {
child: new Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
new BottomBarButton(Icons.new_releases, 'News'),
new BottomBarButton(Icons.people, 'Requests'),
new BottomBarButton(Icons.chat, 'Messenger'),
new BottomBarButton(Icons.bookmark, 'Bookmark'),
new BottomBarButton(Icons.alarm, 'Alarm')
]
)
const BottomBarButton(Icons.new_releases, 'News'),
const BottomBarButton(Icons.people, 'Requests'),
const BottomBarButton(Icons.chat, 'Messenger'),
const BottomBarButton(Icons.bookmark, 'Bookmark'),
const BottomBarButton(Icons.alarm, 'Alarm'),
],
),
);
}
}

View File

@ -169,10 +169,10 @@ class GalleryHomeState extends State<GalleryHome> with SingleTickerProviderState
new SliverAppBar(
pinned: true,
expandedHeight: _kFlexibleSpaceMaxHeight,
flexibleSpace: new FlexibleSpaceBar(
flexibleSpace: const FlexibleSpaceBar(
title: const Text('Flutter Gallery'),
// TODO(abarth): Wire up to the parallax in a way that doesn't pop during hero transition.
background: new _AppBarBackground(animation: kAlwaysDismissedAnimation),
background: const _AppBarBackground(animation: kAlwaysDismissedAnimation),
),
),
new SliverList(delegate: new SliverChildListDelegate(_galleryListItems())),

View File

@ -8,9 +8,9 @@ import 'package:flutter/widgets.dart';
void main() {
testWidgets('Sliver in a box', (WidgetTester tester) async {
await tester.pumpWidget(
new DecoratedBox(
const DecoratedBox(
decoration: const BoxDecoration(),
child: new SliverList(
child: const SliverList(
delegate: const SliverChildListDelegate(const <Widget>[]),
),
),
@ -21,7 +21,7 @@ void main() {
await tester.pumpWidget(
new Row(
children: <Widget>[
new SliverList(
const SliverList(
delegate: const SliverChildListDelegate(const <Widget>[]),
),
],