mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
fix analyzer warning: use const where possible (#9320)
This commit is contained in:
parent
5efbe05f04
commit
a5593b1678
@ -482,11 +482,11 @@ class ItemGalleryBox extends StatelessWidget {
|
|||||||
new Row(
|
new Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
new IconButton(
|
new IconButton(
|
||||||
icon: new Icon(Icons.share),
|
icon: const Icon(Icons.share),
|
||||||
onPressed: () { print('Pressed share'); },
|
onPressed: () { print('Pressed share'); },
|
||||||
),
|
),
|
||||||
new IconButton(
|
new IconButton(
|
||||||
icon: new Icon(Icons.event),
|
icon: const Icon(Icons.event),
|
||||||
onPressed: () { print('Pressed event'); },
|
onPressed: () { print('Pressed event'); },
|
||||||
),
|
),
|
||||||
new Expanded(
|
new Expanded(
|
||||||
@ -620,7 +620,7 @@ class FancyDrawerHeader extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return new Container(
|
return new Container(
|
||||||
decoration: new BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
backgroundColor: Colors.purple
|
backgroundColor: Colors.purple
|
||||||
),
|
),
|
||||||
height: 200.0
|
height: 200.0
|
||||||
|
@ -286,7 +286,7 @@ class CardCollectionState extends State<CardCollection> {
|
|||||||
leftArrowIcon = new Opacity(opacity: 0.1, child: leftArrowIcon);
|
leftArrowIcon = new Opacity(opacity: 0.1, child: leftArrowIcon);
|
||||||
|
|
||||||
// TODO(abarth): This icon is wrong in RTL.
|
// TODO(abarth): This icon is wrong in RTL.
|
||||||
Widget rightArrowIcon = new Icon(Icons.arrow_forward, size: 36.0);
|
Widget rightArrowIcon = const Icon(Icons.arrow_forward, size: 36.0);
|
||||||
if (_dismissDirection == DismissDirection.endToStart)
|
if (_dismissDirection == DismissDirection.endToStart)
|
||||||
rightArrowIcon = new Opacity(opacity: 0.1, child: rightArrowIcon);
|
rightArrowIcon = new Opacity(opacity: 0.1, child: rightArrowIcon);
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ class PageViewAppState extends State<PageViewApp> {
|
|||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
const DrawerHeader(child: const Center(child: const Text('Options'))),
|
const DrawerHeader(child: const Center(child: const Text('Options'))),
|
||||||
new ListTile(
|
new ListTile(
|
||||||
leading: new Icon(Icons.more_horiz),
|
leading: const Icon(Icons.more_horiz),
|
||||||
selected: scrollDirection == Axis.horizontal,
|
selected: scrollDirection == Axis.horizontal,
|
||||||
trailing: const Text('Horizontal Layout'),
|
trailing: const Text('Horizontal Layout'),
|
||||||
onTap: switchScrollDirection,
|
onTap: switchScrollDirection,
|
||||||
|
@ -378,7 +378,7 @@ class _AppBarState extends State<AppBar> {
|
|||||||
if (leading == null) {
|
if (leading == null) {
|
||||||
if (_hasDrawer) {
|
if (_hasDrawer) {
|
||||||
leading = new IconButton(
|
leading = new IconButton(
|
||||||
icon: new Icon(Icons.menu),
|
icon: const Icon(Icons.menu),
|
||||||
onPressed: _handleDrawerButton,
|
onPressed: _handleDrawerButton,
|
||||||
tooltip: 'Open navigation menu' // TODO(ianh): Figure out how to localize this string
|
tooltip: 'Open navigation menu' // TODO(ianh): Figure out how to localize this string
|
||||||
);
|
);
|
||||||
|
@ -294,7 +294,7 @@ class VersionCheckStamp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Stamp is missing or is malformed.
|
// Stamp is missing or is malformed.
|
||||||
return new VersionCheckStamp();
|
return const VersionCheckStamp();
|
||||||
}
|
}
|
||||||
|
|
||||||
static VersionCheckStamp fromJson(Map<String, String> json) {
|
static VersionCheckStamp fromJson(Map<String, String> json) {
|
||||||
|
Loading…
Reference in New Issue
Block a user