Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
10f721c8
Unverified
Commit
10f721c8
authored
Jan 25, 2018
by
Alexandre Ardhuin
Committed by
GitHub
Jan 25, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use const instead of final with const declarations (#14253)
parent
34ff00a7
Changes
24
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
137 additions
and
137 deletions
+137
-137
vitool.dart
dev/tools/vitool/lib/vitool.dart
+2
-2
cards_demo.dart
examples/flutter_gallery/lib/demo/material/cards_demo.dart
+1
-1
tabs_demo.dart
examples/flutter_gallery/lib/demo/material/tabs_demo.dart
+1
-1
shrine_home.dart
examples/flutter_gallery/lib/demo/shrine/shrine_home.dart
+5
-5
shrine_order.dart
examples/flutter_gallery/lib/demo/shrine/shrine_order.dart
+4
-4
transitions_perf_test.dart
...es/flutter_gallery/test_driver/transitions_perf_test.dart
+1
-1
styled_text.dart
examples/layers/widgets/styled_text.dart
+2
-2
slider.dart
packages/flutter/lib/src/cupertino/slider.dart
+1
-1
slider.dart
packages/flutter/lib/src/material/slider.dart
+1
-1
user_accounts_drawer_header.dart
...flutter/lib/src/material/user_accounts_drawer_header.dart
+3
-3
stack.dart
packages/flutter/lib/src/rendering/stack.dart
+1
-1
widget_inspector.dart
packages/flutter/lib/src/widgets/widget_inspector.dart
+4
-4
list_view_misc_test.dart
packages/flutter/test/widgets/list_view_misc_test.dart
+1
-1
multichild_test.dart
packages/flutter/test/widgets/multichild_test.dart
+67
-67
parent_data_test.dart
packages/flutter/test/widgets/parent_data_test.dart
+19
-19
stateful_component_test.dart
packages/flutter/test/widgets/stateful_component_test.dart
+10
-10
test_widgets.dart
packages/flutter/test/widgets/test_widgets.dart
+4
-4
timeline_summary.dart
packages/flutter_driver/lib/src/driver/timeline_summary.dart
+1
-1
binding.dart
packages/flutter_test/lib/src/binding.dart
+2
-2
finders.dart
packages/flutter_test/lib/src/finders.dart
+1
-1
application_package.dart
packages/flutter_tools/lib/src/application_package.dart
+1
-1
cocoapods.dart
packages/flutter_tools/lib/src/ios/cocoapods.dart
+3
-3
vmservice.dart
packages/flutter_tools/lib/src/vmservice.dart
+1
-1
application_package_test.dart
packages/flutter_tools/test/application_package_test.dart
+1
-1
No files found.
dev/tools/vitool/lib/vitool.dart
View file @
10f721c8
...
...
@@ -292,7 +292,7 @@ class SvgPath {
final
List
<
SvgPathCommand
>
commands
;
final
double
opacity
;
static
final
String
_pathCommandAtom
=
' *([a-zA-Z]) *([
\
-
\
.0-9 ,]*)'
;
static
const
String
_pathCommandAtom
=
' *([a-zA-Z]) *([
\
-
\
.0-9 ,]*)'
;
static
final
RegExp
_pathCommandValidator
=
new
RegExp
(
'^(
$_pathCommandAtom
)*
\$
'
);
static
final
RegExp
_pathCommandMatcher
=
new
RegExp
(
_pathCommandAtom
);
...
...
@@ -460,7 +460,7 @@ class _Transform {
}
final
String
_transformCommandAtom
=
' *([^(]+)
\\
(([^)]*)
\\
)'
;
const
String
_transformCommandAtom
=
' *([^(]+)
\\
(([^)]*)
\\
)'
;
final
RegExp
_transformValidator
=
new
RegExp
(
'^(
$_transformCommandAtom
)*
\$
'
);
final
RegExp
_transformCommand
=
new
RegExp
(
_transformCommandAtom
);
...
...
examples/flutter_gallery/lib/demo/material/cards_demo.dart
View file @
10f721c8
...
...
@@ -51,7 +51,7 @@ class TravelDestinationItem extends StatelessWidget {
:
assert
(
destination
!=
null
&&
destination
.
isValid
),
super
(
key:
key
);
static
final
double
height
=
366.0
;
static
const
double
height
=
366.0
;
final
TravelDestination
destination
;
@override
...
...
examples/flutter_gallery/lib/demo/material/tabs_demo.dart
View file @
10f721c8
...
...
@@ -94,7 +94,7 @@ final Map<_Page, List<_CardData>> _allPages = <_Page, List<_CardData>>{
class
_CardDataItem
extends
StatelessWidget
{
const
_CardDataItem
({
this
.
page
,
this
.
data
});
static
final
double
height
=
272.0
;
static
const
double
height
=
272.0
;
final
_Page
page
;
final
_CardData
data
;
...
...
examples/flutter_gallery/lib/demo/shrine/shrine_home.dart
View file @
10f721c8
...
...
@@ -200,11 +200,11 @@ class _FeaturePriceItem extends _PriceItem {
class
_HeadingLayout
extends
MultiChildLayoutDelegate
{
_HeadingLayout
();
static
final
String
price
=
'price'
;
static
final
String
image
=
'image'
;
static
final
String
title
=
'title'
;
static
final
String
description
=
'description'
;
static
final
String
vendor
=
'vendor'
;
static
const
String
price
=
'price'
;
static
const
String
image
=
'image'
;
static
const
String
title
=
'title'
;
static
const
String
description
=
'description'
;
static
const
String
vendor
=
'vendor'
;
@override
void
performLayout
(
Size
size
)
{
...
...
examples/flutter_gallery/lib/demo/shrine/shrine_order.dart
View file @
10f721c8
...
...
@@ -101,10 +101,10 @@ class _VendorItem extends StatelessWidget {
class
_HeadingLayout
extends
MultiChildLayoutDelegate
{
_HeadingLayout
();
static
final
String
image
=
'image'
;
static
final
String
icon
=
'icon'
;
static
final
String
product
=
'product'
;
static
final
String
vendor
=
'vendor'
;
static
const
String
image
=
'image'
;
static
const
String
icon
=
'icon'
;
static
const
String
product
=
'product'
;
static
const
String
vendor
=
'vendor'
;
@override
void
performLayout
(
Size
size
)
{
...
...
examples/flutter_gallery/test_driver/transitions_perf_test.dart
View file @
10f721c8
...
...
@@ -82,7 +82,7 @@ const List<Demo> demos = const <Demo>[
const
Demo
(
'Typography'
),
];
final
FileSystem
_fs
=
const
LocalFileSystem
();
const
FileSystem
_fs
=
const
LocalFileSystem
();
const
Duration
kWaitBetweenActions
=
const
Duration
(
milliseconds:
250
);
...
...
examples/layers/widgets/styled_text.dart
View file @
10f721c8
...
...
@@ -25,8 +25,8 @@ final List<List<String>> _kNameLines = _kDialogText
final
TextStyle
_kDaveStyle
=
new
TextStyle
(
color:
Colors
.
indigo
.
shade400
,
height:
1.8
);
final
TextStyle
_kHalStyle
=
new
TextStyle
(
color:
Colors
.
red
.
shade400
,
fontFamily:
'monospace'
);
final
TextStyle
_kBold
=
const
TextStyle
(
fontWeight:
FontWeight
.
bold
);
final
TextStyle
_kUnderline
=
const
TextStyle
(
const
TextStyle
_kBold
=
const
TextStyle
(
fontWeight:
FontWeight
.
bold
);
const
TextStyle
_kUnderline
=
const
TextStyle
(
decoration:
TextDecoration
.
underline
,
decorationColor:
const
Color
(
0xFF000000
),
decorationStyle:
TextDecorationStyle
.
wavy
...
...
packages/flutter/lib/src/cupertino/slider.dart
View file @
10f721c8
...
...
@@ -182,7 +182,7 @@ const double _kPadding = 8.0;
const
Color
_kTrackColor
=
const
Color
(
0xFFB5B5B5
);
const
double
_kSliderHeight
=
2.0
*
(
CupertinoThumbPainter
.
radius
+
_kPadding
);
const
double
_kSliderWidth
=
176.0
;
// Matches Material Design slider.
final
Duration
_kDiscreteTransitionDuration
=
const
Duration
(
milliseconds:
500
);
const
Duration
_kDiscreteTransitionDuration
=
const
Duration
(
milliseconds:
500
);
const
double
_kAdjustmentUnit
=
0.1
;
// Matches iOS implementation of material slider.
...
...
packages/flutter/lib/src/material/slider.dart
View file @
10f721c8
...
...
@@ -289,7 +289,7 @@ final Color _kActiveTrackColor = Colors.grey;
final
Tween
<
double
>
_kReactionRadiusTween
=
new
Tween
<
double
>(
begin:
_kThumbRadius
,
end:
_kReactionRadius
);
final
Tween
<
double
>
_kThumbRadiusTween
=
new
Tween
<
double
>(
begin:
_kThumbRadius
,
end:
_kActiveThumbRadius
);
final
ColorTween
_kTickColorTween
=
new
ColorTween
(
begin:
Colors
.
transparent
,
end:
Colors
.
black54
);
final
Duration
_kDiscreteTransitionDuration
=
const
Duration
(
milliseconds:
500
);
const
Duration
_kDiscreteTransitionDuration
=
const
Duration
(
milliseconds:
500
);
const
double
_kLabelBalloonRadius
=
14.0
;
final
Tween
<
double
>
_kLabelBalloonCenterTween
=
new
Tween
<
double
>(
begin:
0.0
,
end:
-
_kLabelBalloonRadius
*
2.0
);
...
...
packages/flutter/lib/src/material/user_accounts_drawer_header.dart
View file @
10f721c8
...
...
@@ -165,9 +165,9 @@ class _AccountDetailsLayout extends MultiChildLayoutDelegate {
_AccountDetailsLayout
({
@required
this
.
textDirection
});
static
final
String
accountName
=
'accountName'
;
static
final
String
accountEmail
=
'accountEmail'
;
static
final
String
dropdownIcon
=
'dropdownIcon'
;
static
const
String
accountName
=
'accountName'
;
static
const
String
accountEmail
=
'accountEmail'
;
static
const
String
dropdownIcon
=
'dropdownIcon'
;
final
TextDirection
textDirection
;
...
...
packages/flutter/lib/src/rendering/stack.dart
View file @
10f721c8
...
...
@@ -55,7 +55,7 @@ class RelativeRect {
}
/// A rect that covers the entire container.
static
final
RelativeRect
fill
=
const
RelativeRect
.
fromLTRB
(
0.0
,
0.0
,
0.0
,
0.0
);
static
const
RelativeRect
fill
=
const
RelativeRect
.
fromLTRB
(
0.0
,
0.0
,
0.0
,
0.0
);
/// Distance from the left side of the container to the left side of this rectangle.
///
...
...
packages/flutter/lib/src/widgets/widget_inspector.dart
View file @
10f721c8
...
...
@@ -843,10 +843,10 @@ class _InspectorOverlayRenderState {
int
get
hashCode
=>
hashValues
(
overlayRect
,
selected
,
hashList
(
candidates
),
tooltip
);
}
final
int
_kMaxTooltipLines
=
5
;
final
Color
_kTooltipBackgroundColor
=
const
Color
.
fromARGB
(
230
,
60
,
60
,
60
);
final
Color
_kHighlightedRenderObjectFillColor
=
const
Color
.
fromARGB
(
128
,
128
,
128
,
255
);
final
Color
_kHighlightedRenderObjectBorderColor
=
const
Color
.
fromARGB
(
128
,
64
,
64
,
128
);
const
int
_kMaxTooltipLines
=
5
;
const
Color
_kTooltipBackgroundColor
=
const
Color
.
fromARGB
(
230
,
60
,
60
,
60
);
const
Color
_kHighlightedRenderObjectFillColor
=
const
Color
.
fromARGB
(
128
,
128
,
128
,
255
);
const
Color
_kHighlightedRenderObjectBorderColor
=
const
Color
.
fromARGB
(
128
,
64
,
64
,
128
);
/// A layer that outlines the selected [RenderObject] and candidate render
/// objects that also match the last pointer location.
...
...
packages/flutter/test/widgets/list_view_misc_test.dart
View file @
10f721c8
...
...
@@ -6,7 +6,7 @@ import 'package:flutter_test/flutter_test.dart';
import
'package:flutter/rendering.dart'
;
import
'package:flutter/widgets.dart'
;
final
Key
blockKey
=
const
Key
(
'test'
);
const
Key
blockKey
=
const
Key
(
'test'
);
void
main
(
)
{
testWidgets
(
'Cannot scroll a non-overflowing block'
,
(
WidgetTester
tester
)
async
{
...
...
packages/flutter/test/widgets/multichild_test.dart
View file @
10f721c8
This diff is collapsed.
Click to expand it.
packages/flutter/test/widgets/parent_data_test.dart
View file @
10f721c8
...
...
@@ -53,14 +53,14 @@ void main() {
await
tester
.
pumpWidget
(
new
Stack
(
textDirection:
TextDirection
.
ltr
,
children:
<
Widget
>[
new
DecoratedBox
(
decoration:
kBoxDecorationA
),
new
Positioned
(
children:
const
<
Widget
>[
const
DecoratedBox
(
decoration:
kBoxDecorationA
),
const
Positioned
(
top:
10.0
,
left:
10.0
,
child:
new
DecoratedBox
(
decoration:
kBoxDecorationB
),
child:
const
DecoratedBox
(
decoration:
kBoxDecorationB
),
),
new
DecoratedBox
(
decoration:
kBoxDecorationC
),
const
DecoratedBox
(
decoration:
kBoxDecorationC
),
],
),
);
...
...
@@ -74,18 +74,18 @@ void main() {
await
tester
.
pumpWidget
(
new
Stack
(
textDirection:
TextDirection
.
ltr
,
children:
<
Widget
>[
new
Positioned
(
children:
const
<
Widget
>[
const
Positioned
(
bottom:
5.0
,
right:
7.0
,
child:
new
DecoratedBox
(
decoration:
kBoxDecorationA
),
child:
const
DecoratedBox
(
decoration:
kBoxDecorationA
),
),
new
Positioned
(
const
Positioned
(
top:
10.0
,
left:
10.0
,
child:
new
DecoratedBox
(
decoration:
kBoxDecorationB
),
child:
const
DecoratedBox
(
decoration:
kBoxDecorationB
),
),
new
DecoratedBox
(
decoration:
kBoxDecorationC
),
const
DecoratedBox
(
decoration:
kBoxDecorationC
),
],
),
);
...
...
@@ -96,9 +96,9 @@ void main() {
kNonPositioned
,
]);
final
DecoratedBox
kDecoratedBoxA
=
new
DecoratedBox
(
decoration:
kBoxDecorationA
);
final
DecoratedBox
kDecoratedBoxB
=
new
DecoratedBox
(
decoration:
kBoxDecorationB
);
final
DecoratedBox
kDecoratedBoxC
=
new
DecoratedBox
(
decoration:
kBoxDecorationC
);
final
DecoratedBox
kDecoratedBoxA
=
const
DecoratedBox
(
decoration:
kBoxDecorationA
);
final
DecoratedBox
kDecoratedBoxB
=
const
DecoratedBox
(
decoration:
kBoxDecorationB
);
final
DecoratedBox
kDecoratedBoxC
=
const
DecoratedBox
(
decoration:
kBoxDecorationC
);
await
tester
.
pumpWidget
(
new
Stack
(
...
...
@@ -254,13 +254,13 @@ void main() {
new
Stack
(
textDirection:
TextDirection
.
ltr
,
children:
<
Widget
>[
new
Positioned
(
const
Positioned
(
top:
5.0
,
bottom:
8.0
,
child:
new
Positioned
(
child:
const
Positioned
(
top:
6.0
,
left:
7.0
,
child:
new
DecoratedBox
(
decoration:
kBoxDecorationB
),
child:
const
DecoratedBox
(
decoration:
kBoxDecorationB
),
),
),
],
...
...
@@ -276,10 +276,10 @@ void main() {
new
Container
(
child:
new
Row
(
children:
<
Widget
>[
new
Positioned
(
const
Positioned
(
top:
6.0
,
left:
7.0
,
child:
new
DecoratedBox
(
decoration:
kBoxDecorationB
),
child:
const
DecoratedBox
(
decoration:
kBoxDecorationB
),
),
],
),
...
...
packages/flutter/test/widgets/stateful_component_test.dart
View file @
10f721c8
...
...
@@ -22,18 +22,18 @@ void main() {
}
await
tester
.
pumpWidget
(
new
FlipWidget
(
left:
new
DecoratedBox
(
decoration:
kBoxDecorationA
),
right:
new
DecoratedBox
(
decoration:
kBoxDecorationB
)
const
FlipWidget
(
left:
const
DecoratedBox
(
decoration:
kBoxDecorationA
),
right:
const
DecoratedBox
(
decoration:
kBoxDecorationB
)
)
);
checkTree
(
kBoxDecorationA
);
await
tester
.
pumpWidget
(
new
FlipWidget
(
left:
new
DecoratedBox
(
decoration:
kBoxDecorationB
),
right:
new
DecoratedBox
(
decoration:
kBoxDecorationA
)
const
FlipWidget
(
left:
const
DecoratedBox
(
decoration:
kBoxDecorationB
),
right:
const
DecoratedBox
(
decoration:
kBoxDecorationA
)
)
);
...
...
@@ -46,9 +46,9 @@ void main() {
checkTree
(
kBoxDecorationA
);
await
tester
.
pumpWidget
(
new
FlipWidget
(
left:
new
DecoratedBox
(
decoration:
kBoxDecorationA
),
right:
new
DecoratedBox
(
decoration:
kBoxDecorationB
)
const
FlipWidget
(
left:
const
DecoratedBox
(
decoration:
kBoxDecorationA
),
right:
const
DecoratedBox
(
decoration:
kBoxDecorationB
)
)
);
...
...
@@ -60,7 +60,7 @@ void main() {
new
FlipWidget
(
key:
const
Key
(
'rebuild test'
),
left:
new
TestBuildCounter
(),
right:
new
DecoratedBox
(
decoration:
kBoxDecorationB
)
right:
const
DecoratedBox
(
decoration:
kBoxDecorationB
)
)
);
...
...
packages/flutter/test/widgets/test_widgets.dart
View file @
10f721c8
...
...
@@ -6,15 +6,15 @@ import 'package:flutter_test/flutter_test.dart';
import
'package:flutter/rendering.dart'
;
import
'package:flutter/widgets.dart'
;
final
BoxDecoration
kBoxDecorationA
=
const
BoxDecoration
(
const
BoxDecoration
kBoxDecorationA
=
const
BoxDecoration
(
color:
const
Color
(
0xFFFF0000
),
);
final
BoxDecoration
kBoxDecorationB
=
const
BoxDecoration
(
const
BoxDecoration
kBoxDecorationB
=
const
BoxDecoration
(
color:
const
Color
(
0xFF00FF00
),
);
final
BoxDecoration
kBoxDecorationC
=
const
BoxDecoration
(
const
BoxDecoration
kBoxDecorationC
=
const
BoxDecoration
(
color:
const
Color
(
0xFF0000FF
),
);
...
...
@@ -24,7 +24,7 @@ class TestBuildCounter extends StatelessWidget {
@override
Widget
build
(
BuildContext
context
)
{
buildCount
+=
1
;
return
new
DecoratedBox
(
decoration:
kBoxDecorationA
);
return
const
DecoratedBox
(
decoration:
kBoxDecorationA
);
}
}
...
...
packages/flutter_driver/lib/src/driver/timeline_summary.dart
View file @
10f721c8
...
...
@@ -12,7 +12,7 @@ import 'package:path/path.dart' as path;
import
'common.dart'
;
import
'timeline.dart'
;
final
JsonEncoder
_prettyEncoder
=
const
JsonEncoder
.
withIndent
(
' '
);
const
JsonEncoder
_prettyEncoder
=
const
JsonEncoder
.
withIndent
(
' '
);
/// The maximum amount of time considered safe to spend for a frame's build
/// phase. Anything past that is in the danger of missing the frame as 60FPS.
...
...
packages/flutter_test/lib/src/binding.dart
View file @
10f721c8
...
...
@@ -279,7 +279,7 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
fontSize:
40.0
,
);
static
final
Widget
_kPreTestMessage
=
const
Center
(
static
const
Widget
_kPreTestMessage
=
const
Center
(
child:
const
Text
(
'Test starting...'
,
style:
_kMessageStyle
,
...
...
@@ -287,7 +287,7 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
)
);
static
final
Widget
_kPostTestMessage
=
const
Center
(
static
const
Widget
_kPostTestMessage
=
const
Center
(
child:
const
Text
(
'Test finished.'
,
style:
_kMessageStyle
,
...
...
packages/flutter_test/lib/src/finders.dart
View file @
10f721c8
...
...
@@ -15,7 +15,7 @@ typedef bool WidgetPredicate(Widget widget);
typedef
bool
ElementPredicate
(
Element
element
);
/// Some frequently used widget [Finder]s.
final
CommonFinders
find
=
const
CommonFinders
.
_
();
const
CommonFinders
find
=
const
CommonFinders
.
_
();
/// Provides lightweight syntax for getting frequently used widget [Finder]s.
///
...
...
packages/flutter_tools/lib/src/application_package.dart
View file @
10f721c8
...
...
@@ -200,7 +200,7 @@ abstract class IOSApp extends ApplicationPackage {
}
class
BuildableIOSApp
extends
IOSApp
{
static
final
String
kBundleName
=
'Runner.app'
;
static
const
String
kBundleName
=
'Runner.app'
;
BuildableIOSApp
({
this
.
appDirectory
,
...
...
packages/flutter_tools/lib/src/ios/cocoapods.dart
View file @
10f721c8
...
...
@@ -17,16 +17,16 @@ import '../base/version.dart';
import
'../cache.dart'
;
import
'../globals.dart'
;
final
String
noCocoaPodsConsequence
=
'''
const
String
noCocoaPodsConsequence
=
'''
CocoaPods is used to retrieve the iOS platform side'
s
plugin
code
that
responds
to
your
plugin
usage
on
the
Dart
side
.
Without
resolving
iOS
dependencies
with
CocoaPods
,
plugins
will
not
work
on
iOS
.
For
more
info
,
see
https:
//flutter.io/platform-plugins''';
final
String
cocoaPodsInstallInstructions
=
'''
const
String
cocoaPodsInstallInstructions
=
'''
brew install cocoapods
pod setup'''
;
final
String
cocoaPodsUpgradeInstructions
=
'''
const
String
cocoaPodsUpgradeInstructions
=
'''
brew upgrade cocoapods
pod setup'''
;
...
...
packages/flutter_tools/lib/src/vmservice.dart
View file @
10f721c8
...
...
@@ -1025,7 +1025,7 @@ class Isolate extends ServiceObjectOwner {
_updateHeaps
(
map
[
'_heaps'
],
mapIsRef
);
}
static
final
int
kIsolateReloadBarred
=
1005
;
static
const
int
kIsolateReloadBarred
=
1005
;
Future
<
Map
<
String
,
dynamic
>>
reloadSources
(
{
bool
pause:
false
,
...
...
packages/flutter_tools/test/application_package_test.dart
View file @
10f721c8
...
...
@@ -29,7 +29,7 @@ void main() {
});
}
final
String
_aaptData
=
'''
const
String
_aaptData
=
'''
package: name='
io
.
flutter
.
gallery
' versionCode='
1
' versionName='
0.0
.
1
' platformBuildVersionName='
NMR1
'
sdkVersion:'
14
'
targetSdkVersion:'
21
'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment