mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
The const will continue until morale improves (#9536)
This commit is contained in:
parent
76ecb0b9a1
commit
0d0861b3ee
@ -96,45 +96,45 @@ class TopBarMenu extends StatelessWidget {
|
|||||||
return new PopupMenuButton<String>(
|
return new PopupMenuButton<String>(
|
||||||
onSelected: (String value) { print('Selected: $value'); },
|
onSelected: (String value) { print('Selected: $value'); },
|
||||||
itemBuilder: (BuildContext context) => <PopupMenuItem<String>>[
|
itemBuilder: (BuildContext context) => <PopupMenuItem<String>>[
|
||||||
new PopupMenuItem<String>(
|
const PopupMenuItem<String>(
|
||||||
value: 'Friends',
|
value: 'Friends',
|
||||||
child: new MenuItemWithIcon(Icons.people, 'Friends', '5 new')
|
child: const MenuItemWithIcon(Icons.people, 'Friends', '5 new')
|
||||||
),
|
),
|
||||||
const PopupMenuItem<String>(
|
const PopupMenuItem<String>(
|
||||||
value: 'Events',
|
value: 'Events',
|
||||||
child: const MenuItemWithIcon(Icons.event, 'Events', '12 upcoming')
|
child: const MenuItemWithIcon(Icons.event, 'Events', '12 upcoming')
|
||||||
),
|
),
|
||||||
new PopupMenuItem<String>(
|
const PopupMenuItem<String>(
|
||||||
value: 'Events',
|
value: 'Events',
|
||||||
child: new MenuItemWithIcon(Icons.group, 'Groups', '14')
|
child: const MenuItemWithIcon(Icons.group, 'Groups', '14')
|
||||||
),
|
),
|
||||||
new PopupMenuItem<String>(
|
const PopupMenuItem<String>(
|
||||||
value: 'Events',
|
value: 'Events',
|
||||||
child: new MenuItemWithIcon(Icons.image, 'Pictures', '12')
|
child: const MenuItemWithIcon(Icons.image, 'Pictures', '12')
|
||||||
),
|
),
|
||||||
new PopupMenuItem<String>(
|
const PopupMenuItem<String>(
|
||||||
value: 'Events',
|
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',
|
value: 'Friends',
|
||||||
child: new MenuItemWithIcon(Icons.people, 'Friends', '5')
|
child: const MenuItemWithIcon(Icons.people, 'Friends', '5')
|
||||||
),
|
),
|
||||||
const PopupMenuItem<String>(
|
const PopupMenuItem<String>(
|
||||||
value: 'Events',
|
value: 'Events',
|
||||||
child: const MenuItemWithIcon(Icons.event, 'Events', '12')
|
child: const MenuItemWithIcon(Icons.event, 'Events', '12')
|
||||||
),
|
),
|
||||||
new PopupMenuItem<String>(
|
const PopupMenuItem<String>(
|
||||||
value: 'Events',
|
value: 'Events',
|
||||||
child: new MenuItemWithIcon(Icons.group, 'Groups', '14')
|
child: const MenuItemWithIcon(Icons.group, 'Groups', '14')
|
||||||
),
|
),
|
||||||
new PopupMenuItem<String>(
|
const PopupMenuItem<String>(
|
||||||
value: 'Events',
|
value: 'Events',
|
||||||
child: new MenuItemWithIcon(Icons.image, 'Pictures', '12')
|
child: const MenuItemWithIcon(Icons.image, 'Pictures', '12')
|
||||||
),
|
),
|
||||||
new PopupMenuItem<String>(
|
const PopupMenuItem<String>(
|
||||||
value: 'Events',
|
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,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
const IconWithText(Icons.thumb_up, 'Like'),
|
const IconWithText(Icons.thumb_up, 'Like'),
|
||||||
new IconWithText(Icons.comment, 'Comment'),
|
const IconWithText(Icons.comment, 'Comment'),
|
||||||
const IconWithText(Icons.share, 'Share'),
|
const IconWithText(Icons.share, 'Share'),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
@ -530,13 +530,13 @@ class BottomBar extends StatelessWidget {
|
|||||||
child: new Row(
|
child: new Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
new BottomBarButton(Icons.new_releases, 'News'),
|
const BottomBarButton(Icons.new_releases, 'News'),
|
||||||
new BottomBarButton(Icons.people, 'Requests'),
|
const BottomBarButton(Icons.people, 'Requests'),
|
||||||
new BottomBarButton(Icons.chat, 'Messenger'),
|
const BottomBarButton(Icons.chat, 'Messenger'),
|
||||||
new BottomBarButton(Icons.bookmark, 'Bookmark'),
|
const BottomBarButton(Icons.bookmark, 'Bookmark'),
|
||||||
new BottomBarButton(Icons.alarm, 'Alarm')
|
const BottomBarButton(Icons.alarm, 'Alarm'),
|
||||||
]
|
],
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -169,10 +169,10 @@ class GalleryHomeState extends State<GalleryHome> with SingleTickerProviderState
|
|||||||
new SliverAppBar(
|
new SliverAppBar(
|
||||||
pinned: true,
|
pinned: true,
|
||||||
expandedHeight: _kFlexibleSpaceMaxHeight,
|
expandedHeight: _kFlexibleSpaceMaxHeight,
|
||||||
flexibleSpace: new FlexibleSpaceBar(
|
flexibleSpace: const FlexibleSpaceBar(
|
||||||
title: const Text('Flutter Gallery'),
|
title: const Text('Flutter Gallery'),
|
||||||
// TODO(abarth): Wire up to the parallax in a way that doesn't pop during hero transition.
|
// 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())),
|
new SliverList(delegate: new SliverChildListDelegate(_galleryListItems())),
|
||||||
|
@ -8,9 +8,9 @@ import 'package:flutter/widgets.dart';
|
|||||||
void main() {
|
void main() {
|
||||||
testWidgets('Sliver in a box', (WidgetTester tester) async {
|
testWidgets('Sliver in a box', (WidgetTester tester) async {
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
new DecoratedBox(
|
const DecoratedBox(
|
||||||
decoration: const BoxDecoration(),
|
decoration: const BoxDecoration(),
|
||||||
child: new SliverList(
|
child: const SliverList(
|
||||||
delegate: const SliverChildListDelegate(const <Widget>[]),
|
delegate: const SliverChildListDelegate(const <Widget>[]),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -21,7 +21,7 @@ void main() {
|
|||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
new Row(
|
new Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
new SliverList(
|
const SliverList(
|
||||||
delegate: const SliverChildListDelegate(const <Widget>[]),
|
delegate: const SliverChildListDelegate(const <Widget>[]),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
Loading…
Reference in New Issue
Block a user