Skip to content

Commit 4174d22

Browse files
committed
remove all const
1 parent 6b435a8 commit 4174d22

File tree

132 files changed

+1213
-1213
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+1213
-1213
lines changed

analysis_options.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,10 @@ linter:
154154
# - prefer_asserts_with_message # not required by flutter style
155155
- prefer_collection_literals
156156
- prefer_conditional_assignment
157-
- prefer_const_constructors
157+
# - prefer_const_constructors
158158
- prefer_const_constructors_in_immutables
159-
- prefer_const_declarations
160-
- prefer_const_literals_to_create_immutables
159+
# - prefer_const_declarations
160+
# - prefer_const_literals_to_create_immutables
161161
# - prefer_constructors_over_static_methods # far too many false positives
162162
- prefer_contains
163163
# - prefer_double_quotes # opposite of prefer_single_quotes

dev/integration_tests/new_gallery/lib/constants.dart

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,36 @@
77
import 'dart:typed_data';
88

99
// Height of the 'Gallery' header
10-
const double galleryHeaderHeight = 64;
10+
double galleryHeaderHeight = 64;
1111

1212
// The font size delta for headline4 font.
13-
const double desktopDisplay1FontDelta = 16;
13+
double desktopDisplay1FontDelta = 16;
1414

1515
// The width of the settingsDesktop.
16-
const double desktopSettingsWidth = 520;
16+
double desktopSettingsWidth = 520;
1717

1818
// Sentinel value for the system text scale factor option.
19-
const double systemTextScaleFactorOption = -1;
19+
double systemTextScaleFactorOption = -1;
2020

2121
// The splash page animation duration.
22-
const Duration splashPageAnimationDuration = Duration(milliseconds: 300);
22+
Duration splashPageAnimationDuration = Duration(milliseconds: 300);
2323

2424
// Half the splash page animation duration.
25-
const Duration halfSplashPageAnimationDuration = Duration(milliseconds: 150);
25+
Duration halfSplashPageAnimationDuration = Duration(milliseconds: 150);
2626

2727
// Duration for settings panel to open on mobile.
28-
const Duration settingsPanelMobileAnimationDuration =
28+
Duration settingsPanelMobileAnimationDuration =
2929
Duration(milliseconds: 200);
3030

3131
// Duration for settings panel to open on desktop.
32-
const Duration settingsPanelDesktopAnimationDuration =
32+
Duration settingsPanelDesktopAnimationDuration =
3333
Duration(milliseconds: 600);
3434

3535
// Duration for home page elements to fade in.
36-
const Duration entranceAnimationDuration = Duration(milliseconds: 200);
36+
Duration entranceAnimationDuration = Duration(milliseconds: 200);
3737

3838
// The desktop top padding for a page's first header (e.g. Gallery, Settings)
39-
const double firstHeaderDesktopTopPadding = 5.0;
39+
double firstHeaderDesktopTopPadding = 5.0;
4040

4141
// A transparent image used to avoid loading images when they are not needed.
4242
final Uint8List kTransparentImage = Uint8List.fromList(<int>[

dev/integration_tests/new_gallery/lib/data/demos.dart

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ import '../gallery_localizations.dart';
3232
import '../gallery_localizations_en.dart';
3333
import 'icons.dart';
3434

35-
const String _docsBaseUrl = 'https://api.flutter.dev/flutter';
36-
const String _docsAnimationsUrl =
35+
String _docsBaseUrl = 'https://api.flutter.dev/flutter';
36+
String _docsAnimationsUrl =
3737
'https://pub.dev/documentation/animations/latest/animations';
3838

3939
enum GalleryDemoCategory {
@@ -57,7 +57,7 @@ enum GalleryDemoCategory {
5757
}
5858

5959
class GalleryDemo {
60-
const GalleryDemo({
60+
GalleryDemo({
6161
required this.title,
6262
required this.category,
6363
required this.subtitle,
@@ -83,11 +83,11 @@ class GalleryDemo {
8383
}
8484

8585
TextSpan noOpCodeDisplayer(BuildContext context) {
86-
return const TextSpan(text: '');
86+
return TextSpan(text: '');
8787
}
8888

8989
class GalleryDemoConfiguration {
90-
const GalleryDemoConfiguration({
90+
GalleryDemoConfiguration({
9191
required this.title,
9292
required this.description,
9393
required this.documentationUrl,
@@ -1176,35 +1176,35 @@ class Demos {
11761176
description: localizations.demoSharedAxisDescription,
11771177
documentationUrl:
11781178
'$_docsAnimationsUrl/SharedAxisTransition-class.html',
1179-
buildRoute: (_) => const SharedXAxisTransitionDemo(),
1179+
buildRoute: (_) => SharedXAxisTransitionDemo(),
11801180
),
11811181
GalleryDemoConfiguration(
11821182
title: localizations.demoSharedYAxisTitle,
11831183
description: localizations.demoSharedAxisDescription,
11841184
documentationUrl:
11851185
'$_docsAnimationsUrl/SharedAxisTransition-class.html',
1186-
buildRoute: (_) => const SharedYAxisTransitionDemo(),
1186+
buildRoute: (_) => SharedYAxisTransitionDemo(),
11871187
),
11881188
GalleryDemoConfiguration(
11891189
title: localizations.demoSharedZAxisTitle,
11901190
description: localizations.demoSharedAxisDescription,
11911191
documentationUrl:
11921192
'$_docsAnimationsUrl/SharedAxisTransition-class.html',
1193-
buildRoute: (_) => const SharedZAxisTransitionDemo(),
1193+
buildRoute: (_) => SharedZAxisTransitionDemo(),
11941194
),
11951195
GalleryDemoConfiguration(
11961196
title: localizations.demoFadeThroughTitle,
11971197
description: localizations.demoFadeThroughDescription,
11981198
documentationUrl:
11991199
'$_docsAnimationsUrl/FadeThroughTransition-class.html',
1200-
buildRoute: (_) => const FadeThroughTransitionDemo(),
1200+
buildRoute: (_) => FadeThroughTransitionDemo(),
12011201
),
12021202
GalleryDemoConfiguration(
12031203
title: localizations.demoFadeScaleTitle,
12041204
description: localizations.demoFadeScaleDescription,
12051205
documentationUrl:
12061206
'$_docsAnimationsUrl/FadeScaleTransition-class.html',
1207-
buildRoute: (_) => const FadeScaleTransitionDemo(),
1207+
buildRoute: (_) => FadeScaleTransitionDemo(),
12081208
),
12091209
],
12101210
category: GalleryDemoCategory.other,

dev/integration_tests/new_gallery/lib/data/gallery_options.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ enum CustomTextDirection {
1616
}
1717

1818
// See http://en.wikipedia.org/wiki/Right-to-left
19-
const List<String> rtlLanguages = <String>[
19+
List<String> rtlLanguages = <String>[
2020
'ar', // Arabic
2121
'fa', // Farsi
2222
'he', // Hebrew
@@ -25,7 +25,7 @@ const List<String> rtlLanguages = <String>[
2525
];
2626

2727
// Fake locale to represent the system Locale option.
28-
const Locale systemLocaleOption = Locale('system');
28+
Locale systemLocaleOption = Locale('system');
2929

3030
Locale? _deviceLocale;
3131

@@ -247,7 +247,7 @@ class _ModelBindingState extends State<ModelBinding> {
247247
// We delay the time dilation change long enough that the user can see
248248
// that UI has started reacting and then we slam on the brakes so that
249249
// they see that the time is in fact now dilated.
250-
_timeDilationTimer = Timer(const Duration(milliseconds: 150), () {
250+
_timeDilationTimer = Timer(Duration(milliseconds: 150), () {
251251
timeDilation = newModel.timeDilation;
252252
});
253253
} else {

dev/integration_tests/new_gallery/lib/data/icons.dart

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -7,168 +7,168 @@ import 'package:flutter/material.dart';
77
class GalleryIcons {
88
GalleryIcons._();
99

10-
static const IconData tooltip = IconData(
10+
static IconData tooltip = IconData(
1111
0xe900,
1212
fontFamily: 'GalleryIcons',
1313
);
14-
static const IconData textFieldsAlt = IconData(
14+
static IconData textFieldsAlt = IconData(
1515
0xe901,
1616
fontFamily: 'GalleryIcons',
1717
);
18-
static const IconData tabs = IconData(
18+
static IconData tabs = IconData(
1919
0xe902,
2020
fontFamily: 'GalleryIcons',
2121
);
22-
static const IconData switches = IconData(
22+
static IconData switches = IconData(
2323
0xe903,
2424
fontFamily: 'GalleryIcons',
2525
);
26-
static const IconData sliders = IconData(
26+
static IconData sliders = IconData(
2727
0xe904,
2828
fontFamily: 'GalleryIcons',
2929
);
30-
static const IconData shrine = IconData(
30+
static IconData shrine = IconData(
3131
0xe905,
3232
fontFamily: 'GalleryIcons',
3333
);
34-
static const IconData sentimentVerySatisfied = IconData(
34+
static IconData sentimentVerySatisfied = IconData(
3535
0xe906,
3636
fontFamily: 'GalleryIcons',
3737
);
38-
static const IconData refresh = IconData(
38+
static IconData refresh = IconData(
3939
0xe907,
4040
fontFamily: 'GalleryIcons',
4141
);
42-
static const IconData progressActivity = IconData(
42+
static IconData progressActivity = IconData(
4343
0xe908,
4444
fontFamily: 'GalleryIcons',
4545
);
46-
static const IconData phoneIphone = IconData(
46+
static IconData phoneIphone = IconData(
4747
0xe909,
4848
fontFamily: 'GalleryIcons',
4949
);
50-
static const IconData pageControl = IconData(
50+
static IconData pageControl = IconData(
5151
0xe90a,
5252
fontFamily: 'GalleryIcons',
5353
);
54-
static const IconData moreVert = IconData(
54+
static IconData moreVert = IconData(
5555
0xe90b,
5656
fontFamily: 'GalleryIcons',
5757
);
58-
static const IconData menu = IconData(
58+
static IconData menu = IconData(
5959
0xe90c,
6060
fontFamily: 'GalleryIcons',
6161
);
62-
static const IconData listAlt = IconData(
62+
static IconData listAlt = IconData(
6363
0xe90d,
6464
fontFamily: 'GalleryIcons',
6565
);
66-
static const IconData gridOn = IconData(
66+
static IconData gridOn = IconData(
6767
0xe90e,
6868
fontFamily: 'GalleryIcons',
6969
);
70-
static const IconData expandAll = IconData(
70+
static IconData expandAll = IconData(
7171
0xe90f,
7272
fontFamily: 'GalleryIcons',
7373
);
74-
static const IconData event = IconData(
74+
static IconData event = IconData(
7575
0xe910,
7676
fontFamily: 'GalleryIcons',
7777
);
78-
static const IconData driveVideo = IconData(
78+
static IconData driveVideo = IconData(
7979
0xe911,
8080
fontFamily: 'GalleryIcons',
8181
);
82-
static const IconData dialogs = IconData(
82+
static IconData dialogs = IconData(
8383
0xe912,
8484
fontFamily: 'GalleryIcons',
8585
);
86-
static const IconData dataTable = IconData(
86+
static IconData dataTable = IconData(
8787
0xe913,
8888
fontFamily: 'GalleryIcons',
8989
);
90-
static const IconData customTypography = IconData(
90+
static IconData customTypography = IconData(
9191
0xe914,
9292
fontFamily: 'GalleryIcons',
9393
);
94-
static const IconData colors = IconData(
94+
static IconData colors = IconData(
9595
0xe915,
9696
fontFamily: 'GalleryIcons',
9797
);
98-
static const IconData chips = IconData(
98+
static IconData chips = IconData(
9999
0xe916,
100100
fontFamily: 'GalleryIcons',
101101
);
102-
static const IconData checkBox = IconData(
102+
static IconData checkBox = IconData(
103103
0xe917,
104104
fontFamily: 'GalleryIcons',
105105
);
106-
static const IconData cards = IconData(
106+
static IconData cards = IconData(
107107
0xe918,
108108
fontFamily: 'GalleryIcons',
109109
);
110-
static const IconData buttons = IconData(
110+
static IconData buttons = IconData(
111111
0xe919,
112112
fontFamily: 'GalleryIcons',
113113
);
114-
static const IconData bottomSheets = IconData(
114+
static IconData bottomSheets = IconData(
115115
0xe91a,
116116
fontFamily: 'GalleryIcons',
117117
);
118-
static const IconData bottomNavigation = IconData(
118+
static IconData bottomNavigation = IconData(
119119
0xe91b,
120120
fontFamily: 'GalleryIcons',
121121
);
122-
static const IconData animation = IconData(
122+
static IconData animation = IconData(
123123
0xe91c,
124124
fontFamily: 'GalleryIcons',
125125
);
126-
static const IconData accountBox = IconData(
126+
static IconData accountBox = IconData(
127127
0xe91d,
128128
fontFamily: 'GalleryIcons',
129129
);
130-
static const IconData snackbar = IconData(
130+
static IconData snackbar = IconData(
131131
0xe91e,
132132
fontFamily: 'GalleryIcons',
133133
);
134-
static const IconData categoryMdc = IconData(
134+
static IconData categoryMdc = IconData(
135135
0xe91f,
136136
fontFamily: 'GalleryIcons',
137137
);
138-
static const IconData cupertinoProgress = IconData(
138+
static IconData cupertinoProgress = IconData(
139139
0xe920,
140140
fontFamily: 'GalleryIcons',
141141
);
142-
static const IconData cupertinoPullToRefresh = IconData(
142+
static IconData cupertinoPullToRefresh = IconData(
143143
0xe921,
144144
fontFamily: 'GalleryIcons',
145145
);
146-
static const IconData cupertinoSwitch = IconData(
146+
static IconData cupertinoSwitch = IconData(
147147
0xe922,
148148
fontFamily: 'GalleryIcons',
149149
);
150-
static const IconData genericButtons = IconData(
150+
static IconData genericButtons = IconData(
151151
0xe923,
152152
fontFamily: 'GalleryIcons',
153153
);
154-
static const IconData backdrop = IconData(
154+
static IconData backdrop = IconData(
155155
0xe924,
156156
fontFamily: 'GalleryIcons',
157157
);
158-
static const IconData bottomAppBar = IconData(
158+
static IconData bottomAppBar = IconData(
159159
0xe925,
160160
fontFamily: 'GalleryIcons',
161161
);
162-
static const IconData bottomSheetPersistent = IconData(
162+
static IconData bottomSheetPersistent = IconData(
163163
0xe926,
164164
fontFamily: 'GalleryIcons',
165165
);
166-
static const IconData listsLeaveBehind = IconData(
166+
static IconData listsLeaveBehind = IconData(
167167
0xe927,
168168
fontFamily: 'GalleryIcons',
169169
);
170-
static const IconData navigationRail = Icons.vertical_split;
171-
static const IconData appbar = Icons.web_asset;
172-
static const IconData divider = Icons.credit_card;
173-
static const IconData search = Icons.search;
170+
static IconData navigationRail = Icons.vertical_split;
171+
static IconData appbar = Icons.web_asset;
172+
static IconData divider = Icons.credit_card;
173+
static IconData search = Icons.search;
174174
}

0 commit comments

Comments
 (0)