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
7667db63
Unverified
Commit
7667db63
authored
Mar 14, 2018
by
Alexandre Ardhuin
Committed by
GitHub
Mar 14, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apply upcomming prefer_const_declarations (#15498)
parent
7b8c7963
Changes
35
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
84 additions
and
84 deletions
+84
-84
prepare_package.dart
dev/bots/prepare_package.dart
+1
-1
prepare_package_test.dart
dev/bots/test/prepare_package_test.dart
+2
-2
shrine_home.dart
examples/flutter_gallery/lib/demo/shrine/shrine_home.dart
+2
-2
button_theme.dart
packages/flutter/lib/src/material/button_theme.dart
+1
-1
dropdown.dart
packages/flutter/lib/src/material/dropdown.dart
+1
-1
input_border.dart
packages/flutter/lib/src/material/input_border.dart
+3
-3
input_decorator.dart
packages/flutter/lib/src/material/input_decorator.dart
+1
-1
stepper.dart
packages/flutter/lib/src/material/stepper.dart
+1
-1
switch.dart
packages/flutter/lib/src/material/switch.dart
+1
-1
time_picker.dart
packages/flutter/lib/src/material/time_picker.dart
+1
-1
editable.dart
packages/flutter/lib/src/rendering/editable.dart
+1
-1
banner.dart
packages/flutter/lib/src/widgets/banner.dart
+1
-1
widget_inspector.dart
packages/flutter/lib/src/widgets/widget_inspector.dart
+1
-1
curves_test.dart
packages/flutter/test/animation/curves_test.dart
+1
-1
button_theme_test.dart
packages/flutter/test/material/button_theme_test.dart
+2
-2
floating_action_button_test.dart
...es/flutter/test/material/floating_action_button_test.dart
+16
-16
tabs_test.dart
packages/flutter/test/material/tabs_test.dart
+8
-8
text_field_test.dart
packages/flutter/test/material/text_field_test.dart
+1
-1
alignment_test.dart
packages/flutter/test/painting/alignment_test.dart
+1
-1
shape_decoration_test.dart
packages/flutter/test/painting/shape_decoration_test.dart
+3
-3
framework_test.dart
packages/flutter/test/widgets/framework_test.dart
+4
-4
heroes_test.dart
packages/flutter/test/widgets/heroes_test.dart
+2
-2
image_resolution_test.dart
packages/flutter/test/widgets/image_resolution_test.dart
+1
-1
semantics_debugger_test.dart
packages/flutter/test/widgets/semantics_debugger_test.dart
+1
-1
slivers_protocol_test.dart
packages/flutter/test/widgets/slivers_protocol_test.dart
+1
-1
gradle.dart
packages/flutter_tools/lib/src/android/gradle.dart
+1
-1
io.dart
packages/flutter_tools/lib/src/base/io.dart
+1
-1
mac.dart
packages/flutter_tools/lib/src/ios/mac.dart
+1
-1
plugins.dart
packages/flutter_tools/lib/src/plugins.dart
+1
-1
asset_bundle_package_fonts_test.dart
...s/flutter_tools/test/asset_bundle_package_fonts_test.dart
+5
-5
asset_bundle_package_test.dart
packages/flutter_tools/test/asset_bundle_package_test.dart
+9
-9
analyze_continuously_test.dart
...lutter_tools/test/commands/analyze_continuously_test.dart
+2
-2
analyze_once_test.dart
packages/flutter_tools/test/commands/analyze_once_test.dart
+2
-2
doctor_test.dart
packages/flutter_tools/test/commands/doctor_test.dart
+1
-1
flutter_manifest_test.dart
packages/flutter_tools/test/flutter_manifest_test.dart
+3
-3
No files found.
dev/bots/prepare_package.dart
View file @
7667db63
...
...
@@ -480,7 +480,7 @@ class ArchivePublisher {
jsonData
[
'releases'
][
revision
][
branchName
]
=
metadata
;
final
File
tempFile
=
new
File
(
path
.
join
(
tempDir
.
absolute
.
path
,
'releases_
$platformName
.json'
));
final
JsonEncoder
encoder
=
const
JsonEncoder
.
withIndent
(
' '
);
const
JsonEncoder
encoder
=
const
JsonEncoder
.
withIndent
(
' '
);
tempFile
.
writeAsStringSync
(
encoder
.
convert
(
jsonData
));
await
_cloudCopy
(
tempFile
.
absolute
.
path
,
metadataGsPath
);
}
...
...
dev/bots/test/prepare_package_test.dart
View file @
7667db63
...
...
@@ -16,7 +16,7 @@ import '../prepare_package.dart';
import
'fake_process_manager.dart'
;
void
main
(
)
{
final
String
testRef
=
'deadbeefdeadbeefdeadbeefdeadbeefdeadbeef'
;
const
String
testRef
=
'deadbeefdeadbeefdeadbeefdeadbeefdeadbeef'
;
test
(
'Throws on missing executable'
,
()
async
{
// Uses a *real* process manager, since we want to know what happens if
// it can't find an executable.
...
...
@@ -295,7 +295,7 @@ void main() {
expect
(
contents
,
contains
(
'"beta": "6da8ec6bd0c4801b80d666869e4069698561c043"'
));
// Make sure it's valid JSON, and in the right format.
final
Map
<
String
,
dynamic
>
jsonData
=
json
.
decode
(
contents
);
final
JsonEncoder
encoder
=
const
JsonEncoder
.
withIndent
(
' '
);
const
JsonEncoder
encoder
=
const
JsonEncoder
.
withIndent
(
' '
);
expect
(
contents
,
equals
(
encoder
.
convert
(
jsonData
)));
});
});
...
...
examples/flutter_gallery/lib/demo/shrine/shrine_home.dart
View file @
7667db63
...
...
@@ -99,7 +99,7 @@ class _ShrineGridDelegate extends SliverGridDelegate {
@override
SliverGridLayout
getLayout
(
SliverConstraints
constraints
)
{
final
double
tileWidth
=
(
constraints
.
crossAxisExtent
-
_kSpacing
)
/
2.0
;
final
double
tileHeight
=
40.0
+
144.0
+
40.0
;
const
double
tileHeight
=
40.0
+
144.0
+
40.0
;
return
new
_ShrineGridLayout
(
tileWidth:
tileWidth
,
tileHeight:
tileHeight
,
...
...
@@ -211,7 +211,7 @@ class _HeadingLayout extends MultiChildLayoutDelegate {
final
double
halfWidth
=
size
.
width
/
2.0
;
final
double
halfHeight
=
size
.
height
/
2.0
;
final
double
halfUnit
=
unitSize
/
2.0
;
const
double
halfUnit
=
unitSize
/
2.0
;
const
double
margin
=
16.0
;
final
Size
imageSize
=
layoutChild
(
image
,
new
BoxConstraints
.
loose
(
size
));
...
...
packages/flutter/lib/src/material/button_theme.dart
View file @
7667db63
...
...
@@ -276,7 +276,7 @@ class ButtonThemeData extends Diagnosticable {
@override
void
debugFillProperties
(
DiagnosticPropertiesBuilder
description
)
{
super
.
debugFillProperties
(
description
);
final
ButtonThemeData
defaultTheme
=
const
ButtonThemeData
();
const
ButtonThemeData
defaultTheme
=
const
ButtonThemeData
();
description
.
add
(
new
EnumProperty
<
ButtonTextTheme
>(
'textTheme'
,
textTheme
,
defaultValue:
defaultTheme
.
textTheme
));
description
.
add
(
new
DoubleProperty
(
'minWidth'
,
minWidth
,
defaultValue:
defaultTheme
.
minWidth
));
description
.
add
(
new
DoubleProperty
(
'height'
,
height
,
defaultValue:
defaultTheme
.
height
));
...
...
packages/flutter/lib/src/material/dropdown.dart
View file @
7667db63
...
...
@@ -328,7 +328,7 @@ class _DropdownRoute<T> extends PopupRoute<_DropdownRouteResult<T>> {
final
double
buttonTop
=
buttonRect
.
top
;
final
double
selectedItemOffset
=
selectedIndex
*
_kMenuItemHeight
+
kMaterialListPadding
.
top
;
double
menuTop
=
(
buttonTop
-
selectedItemOffset
)
-
(
_kMenuItemHeight
-
buttonRect
.
height
)
/
2.0
;
final
double
topPreferredLimit
=
_kMenuItemHeight
;
const
double
topPreferredLimit
=
_kMenuItemHeight
;
if
(
menuTop
<
topPreferredLimit
)
menuTop
=
math
.
min
(
buttonTop
,
topPreferredLimit
);
double
bottom
=
menuTop
+
menuHeight
;
...
...
packages/flutter/lib/src/material/input_border.dart
View file @
7667db63
...
...
@@ -365,7 +365,7 @@ class OutlineInputBorder extends InputBorder {
center
.
blRadiusY
*
2.0
,
);
final
double
cornerArcSweep
=
math
.
pi
/
2.0
;
const
double
cornerArcSweep
=
math
.
pi
/
2.0
;
final
double
tlCornerArcSweep
=
start
<
center
.
tlRadiusX
?
math
.
asin
(
start
/
center
.
tlRadiusX
)
:
math
.
pi
/
2.0
;
...
...
@@ -377,8 +377,8 @@ class OutlineInputBorder extends InputBorder {
if
(
start
>
center
.
tlRadiusX
)
path
.
lineTo
(
center
.
left
+
start
,
center
.
top
);
final
double
trCornerArcStart
=
(
3
*
math
.
pi
)
/
2.0
;
final
double
trCornerArcSweep
=
cornerArcSweep
;
const
double
trCornerArcStart
=
(
3
*
math
.
pi
)
/
2.0
;
const
double
trCornerArcSweep
=
cornerArcSweep
;
if
(
start
+
extent
<
center
.
width
-
center
.
trRadiusX
)
{
path
..
relativeMoveTo
(
extent
,
0.0
)
...
...
packages/flutter/lib/src/material/input_decorator.dart
View file @
7667db63
...
...
@@ -2304,7 +2304,7 @@ class InputDecorationTheme extends Diagnosticable {
@override
void
debugFillProperties
(
DiagnosticPropertiesBuilder
description
)
{
super
.
debugFillProperties
(
description
);
final
InputDecorationTheme
defaultTheme
=
const
InputDecorationTheme
();
const
InputDecorationTheme
defaultTheme
=
const
InputDecorationTheme
();
description
.
add
(
new
DiagnosticsProperty
<
TextStyle
>(
'labelStyle'
,
labelStyle
,
defaultValue:
defaultTheme
.
labelStyle
));
description
.
add
(
new
DiagnosticsProperty
<
TextStyle
>(
'helperStyle'
,
helperStyle
,
...
...
packages/flutter/lib/src/material/stepper.dart
View file @
7667db63
...
...
@@ -58,7 +58,7 @@ const TextStyle _kStepStyle = const TextStyle(
fontSize:
12.0
,
color:
Colors
.
white
,
);
final
Color
_kErrorLight
=
Colors
.
red
;
const
Color
_kErrorLight
=
Colors
.
red
;
final
Color
_kErrorDark
=
Colors
.
red
.
shade400
;
const
Color
_kCircleActiveLight
=
Colors
.
white
;
const
Color
_kCircleActiveDark
=
Colors
.
black87
;
...
...
packages/flutter/lib/src/material/switch.dart
View file @
7667db63
...
...
@@ -413,7 +413,7 @@ class _RenderSwitch extends RenderToggleable {
// Paint the track
final
Paint
paint
=
new
Paint
()
..
color
=
trackColor
;
final
double
trackHorizontalPadding
=
kRadialReactionRadius
-
_kTrackRadius
;
const
double
trackHorizontalPadding
=
kRadialReactionRadius
-
_kTrackRadius
;
final
Rect
trackRect
=
new
Rect
.
fromLTWH
(
offset
.
dx
+
trackHorizontalPadding
,
offset
.
dy
+
(
size
.
height
-
_kTrackHeight
)
/
2.0
,
...
...
packages/flutter/lib/src/material/time_picker.dart
View file @
7667db63
...
...
@@ -877,7 +877,7 @@ class _DialPainter extends CustomPainter {
final
Paint
selectorPaint
=
new
Paint
()
..
color
=
accentColor
;
final
Offset
focusedPoint
=
getOffsetForTheta
(
theta
,
activeRing
);
final
double
focusedRadius
=
labelPadding
-
4.0
;
const
double
focusedRadius
=
labelPadding
-
4.0
;
canvas
.
drawCircle
(
centerPoint
,
4.0
,
selectorPaint
);
canvas
.
drawCircle
(
focusedPoint
,
focusedRadius
,
selectorPaint
);
selectorPaint
.
strokeWidth
=
2.0
;
...
...
packages/flutter/lib/src/rendering/editable.dart
View file @
7667db63
...
...
@@ -644,7 +644,7 @@ class RenderEditable extends RenderBox {
assert
(
constraintWidth
!=
null
);
if
(
_textLayoutLastWidth
==
constraintWidth
)
return
;
final
double
caretMargin
=
_kCaretGap
+
_kCaretWidth
;
const
double
caretMargin
=
_kCaretGap
+
_kCaretWidth
;
final
double
availableWidth
=
math
.
max
(
0.0
,
constraintWidth
-
caretMargin
);
final
double
maxWidth
=
_isMultiline
?
availableWidth
:
double
.
infinity
;
_textPainter
.
layout
(
minWidth:
availableWidth
,
maxWidth:
maxWidth
);
...
...
packages/flutter/lib/src/widgets/banner.dart
View file @
7667db63
...
...
@@ -135,7 +135,7 @@ class BannerPainter extends CustomPainter {
..
rotate
(
_rotation
)
..
drawRect
(
_kRect
,
_paintShadow
)
..
drawRect
(
_kRect
,
_paintBanner
);
final
double
width
=
_kOffset
*
2.0
;
const
double
width
=
_kOffset
*
2.0
;
_textPainter
.
layout
(
minWidth:
width
,
maxWidth:
width
);
_textPainter
.
paint
(
canvas
,
_kRect
.
topLeft
+
new
Offset
(
0.0
,
(
_kRect
.
height
-
_textPainter
.
height
)
/
2.0
));
}
...
...
packages/flutter/lib/src/widgets/widget_inspector.dart
View file @
7667db63
...
...
@@ -1058,7 +1058,7 @@ class _InspectorOverlayLayer extends Layer {
if
(!
tooltipBelow
)
wedgeY
+=
tooltipSize
.
height
;
final
double
wedgeSize
=
_kTooltipPadding
*
2
;
const
double
wedgeSize
=
_kTooltipPadding
*
2
;
double
wedgeX
=
math
.
max
(
tipOffset
.
dx
,
target
.
dx
)
+
wedgeSize
*
2
;
wedgeX
=
math
.
min
(
wedgeX
,
tipOffset
.
dx
+
tooltipSize
.
width
-
wedgeSize
*
2
);
final
List
<
Offset
>
wedge
=
<
Offset
>[
...
...
packages/flutter/test/animation/curves_test.dart
View file @
7667db63
...
...
@@ -17,7 +17,7 @@ void main() {
});
test
(
'Curve flipped control test'
,
()
{
final
Curve
ease
=
Curves
.
ease
;
const
Curve
ease
=
Curves
.
ease
;
final
Curve
flippedEase
=
ease
.
flipped
;
expect
(
flippedEase
.
transform
(
0.0
),
lessThan
(
0.001
));
expect
(
flippedEase
.
transform
(
0.5
),
lessThan
(
ease
.
transform
(
0.5
)));
...
...
packages/flutter/test/material/button_theme_test.dart
View file @
7667db63
...
...
@@ -7,7 +7,7 @@ import 'package:flutter_test/flutter_test.dart';
void
main
(
)
{
test
(
'ButtonThemeData defaults'
,
()
{
final
ButtonThemeData
theme
=
const
ButtonThemeData
();
const
ButtonThemeData
theme
=
const
ButtonThemeData
();
expect
(
theme
.
textTheme
,
ButtonTextTheme
.
normal
);
expect
(
theme
.
constraints
,
const
BoxConstraints
(
minWidth:
88.0
,
minHeight:
36.0
));
expect
(
theme
.
padding
,
const
EdgeInsets
.
symmetric
(
horizontal:
16.0
));
...
...
@@ -18,7 +18,7 @@ void main() {
});
test
(
'ButtonThemeData default overrides'
,
()
{
final
ButtonThemeData
theme
=
const
ButtonThemeData
(
const
ButtonThemeData
theme
=
const
ButtonThemeData
(
textTheme:
ButtonTextTheme
.
primary
,
minWidth:
100.0
,
height:
200.0
,
...
...
packages/flutter/test/material/floating_action_button_test.dart
View file @
7667db63
...
...
@@ -209,8 +209,8 @@ void main() {
final
ComputeNotch
computeNotch
=
await
fetchComputeNotch
(
tester
,
const
FloatingActionButton
(
onPressed:
null
));
final
Rect
host
=
new
Rect
.
fromLTRB
(
0.0
,
100.0
,
300.0
,
300.0
);
final
Rect
guest
=
new
Rect
.
fromLTWH
(
50.0
,
50.0
,
10.0
,
10.0
);
final
Offset
start
=
const
Offset
(
10.0
,
100.0
);
final
Offset
end
=
const
Offset
(
60.0
,
100.0
);
const
Offset
start
=
const
Offset
(
10.0
,
100.0
);
const
Offset
end
=
const
Offset
(
60.0
,
100.0
);
expect
(()
{
computeNotch
(
host
,
guest
,
start
,
end
);},
throwsFlutterError
);
});
...
...
@@ -233,8 +233,8 @@ void main() {
final
Rect
host
=
new
Rect
.
fromLTRB
(
0.0
,
100.0
,
300.0
,
300.0
);
final
Rect
guest
=
new
Rect
.
fromLTRB
(
190.0
,
90.0
,
210.0
,
110.0
);
final
Offset
start
=
const
Offset
(
191.0
,
100.0
);
final
Offset
end
=
const
Offset
(
220.0
,
100.0
);
const
Offset
start
=
const
Offset
(
191.0
,
100.0
);
const
Offset
end
=
const
Offset
(
220.0
,
100.0
);
expect
(()
{
computeNotch
(
host
,
guest
,
start
,
end
);},
throwsFlutterError
);
});
...
...
@@ -243,8 +243,8 @@ void main() {
final
Rect
host
=
new
Rect
.
fromLTRB
(
0.0
,
100.0
,
300.0
,
300.0
);
final
Rect
guest
=
new
Rect
.
fromLTRB
(
190.0
,
90.0
,
210.0
,
110.0
);
final
Offset
start
=
const
Offset
(
180.0
,
100.0
);
final
Offset
end
=
const
Offset
(
209.0
,
100.0
);
const
Offset
start
=
const
Offset
(
180.0
,
100.0
);
const
Offset
end
=
const
Offset
(
209.0
,
100.0
);
expect
(()
{
computeNotch
(
host
,
guest
,
start
,
end
);},
throwsFlutterError
);
});
...
...
@@ -252,8 +252,8 @@ void main() {
final
ComputeNotch
computeNotch
=
await
fetchComputeNotch
(
tester
,
const
FloatingActionButton
(
onPressed:
null
,
notchMargin:
0.0
));
final
Rect
host
=
new
Rect
.
fromLTRB
(
0.0
,
100.0
,
300.0
,
300.0
);
final
Rect
guest
=
new
Rect
.
fromLTRB
(
190.0
,
90.0
,
210.0
,
110.0
);
final
Offset
start
=
const
Offset
(
180.0
,
100.0
);
final
Offset
end
=
const
Offset
(
220.0
,
100.0
);
const
Offset
start
=
const
Offset
(
180.0
,
100.0
);
const
Offset
end
=
const
Offset
(
220.0
,
100.0
);
final
Path
actualNotch
=
computeNotch
(
host
,
guest
,
start
,
end
);
final
Path
notchedRectangle
=
...
...
@@ -268,8 +268,8 @@ void main() {
);
final
Rect
host
=
new
Rect
.
fromLTRB
(
0.0
,
100.0
,
300.0
,
300.0
);
final
Rect
guest
=
new
Rect
.
fromLTRB
(
190.0
,
90.0
,
210.0
,
110.0
);
final
Offset
start
=
const
Offset
(
180.0
,
100.0
);
final
Offset
end
=
const
Offset
(
220.0
,
100.0
);
const
Offset
start
=
const
Offset
(
180.0
,
100.0
);
const
Offset
end
=
const
Offset
(
220.0
,
100.0
);
final
Path
actualNotch
=
computeNotch
(
host
,
guest
,
start
,
end
);
final
Path
notchedRectangle
=
...
...
@@ -283,8 +283,8 @@ void main() {
);
final
Rect
host
=
new
Rect
.
fromLTRB
(
0.0
,
100.0
,
300.0
,
300.0
);
final
Rect
guest
=
new
Rect
.
fromLTRB
(
190.0
,
85.0
,
210.0
,
105.0
);
final
Offset
start
=
const
Offset
(
180.0
,
100.0
);
final
Offset
end
=
const
Offset
(
220.0
,
100.0
);
const
Offset
start
=
const
Offset
(
180.0
,
100.0
);
const
Offset
end
=
const
Offset
(
220.0
,
100.0
);
final
Path
actualNotch
=
computeNotch
(
host
,
guest
,
start
,
end
);
final
Path
notchedRectangle
=
...
...
@@ -298,8 +298,8 @@ void main() {
);
final
Rect
host
=
new
Rect
.
fromLTRB
(
0.0
,
100.0
,
300.0
,
300.0
);
final
Rect
guest
=
new
Rect
.
fromLTRB
(
190.0
,
95.0
,
210.0
,
115.0
);
final
Offset
start
=
const
Offset
(
180.0
,
100.0
);
final
Offset
end
=
const
Offset
(
220.0
,
100.0
);
const
Offset
start
=
const
Offset
(
180.0
,
100.0
);
const
Offset
end
=
const
Offset
(
220.0
,
100.0
);
final
Path
actualNotch
=
computeNotch
(
host
,
guest
,
start
,
end
);
final
Path
notchedRectangle
=
...
...
@@ -313,8 +313,8 @@ void main() {
);
final
Rect
host
=
new
Rect
.
fromLTRB
(
0.0
,
100.0
,
300.0
,
300.0
);
final
Rect
guest
=
new
Rect
.
fromLTRB
(
190.0
,
40.0
,
210.0
,
60.0
);
final
Offset
start
=
const
Offset
(
180.0
,
100.0
);
final
Offset
end
=
const
Offset
(
220.0
,
100.0
);
const
Offset
start
=
const
Offset
(
180.0
,
100.0
);
const
Offset
end
=
const
Offset
(
220.0
,
100.0
);
final
Path
actualNotch
=
computeNotch
(
host
,
guest
,
start
,
end
);
final
Path
notchedRectangle
=
...
...
packages/flutter/test/material/tabs_test.dart
View file @
7667db63
...
...
@@ -969,7 +969,7 @@ void main() {
final
RenderBox
tabBarBox
=
tester
.
firstRenderObject
<
RenderBox
>(
find
.
byType
(
TabBar
));
expect
(
tabBarBox
.
size
.
height
,
54.0
);
// 54 = _kTabHeight(46) + indicatorWeight(8.0)
final
double
indicatorY
=
54.0
-
indicatorWeight
/
2.0
;
const
double
indicatorY
=
54.0
-
indicatorWeight
/
2.0
;
double
indicatorLeft
=
padLeft
+
indicatorWeight
/
2.0
;
double
indicatorRight
=
200.0
-
(
padRight
+
indicatorWeight
/
2.0
);
...
...
@@ -1030,7 +1030,7 @@ void main() {
expect
(
tabBarBox
.
size
.
height
,
54.0
);
// 54 = _kTabHeight(46) + indicatorWeight(8.0)
expect
(
tabBarBox
.
size
.
width
,
800.0
);
final
double
indicatorY
=
54.0
-
indicatorWeight
/
2.0
;
const
double
indicatorY
=
54.0
-
indicatorWeight
/
2.0
;
double
indicatorLeft
=
600.0
+
padLeft
+
indicatorWeight
/
2.0
;
double
indicatorRight
=
800.0
-
padRight
-
indicatorWeight
/
2.0
;
...
...
@@ -1182,7 +1182,7 @@ void main() {
expect
(
tester
.
getRect
(
find
.
byKey
(
tabs
[
2
].
key
)),
tabRect
);
// Tab 0 selected, indicator padding resolves to left: 100.0
final
double
indicatorLeft
=
100.0
+
indicatorWeight
/
2.0
;
const
double
indicatorLeft
=
100.0
+
indicatorWeight
/
2.0
;
final
double
indicatorRight
=
130.0
+
kTabLabelPadding
.
horizontal
-
indicatorWeight
/
2.0
;
final
double
indicatorY
=
tabBottom
+
indicatorWeight
/
2.0
;
expect
(
tabBarBox
,
paints
..
line
(
...
...
@@ -1252,7 +1252,7 @@ void main() {
// Tab 0 selected, indicator padding resolves to right: 100.0
final
double
indicatorLeft
=
tabLeft
-
kTabLabelPadding
.
left
+
indicatorWeight
/
2.0
;
final
double
indicatorRight
=
tabRight
+
kTabLabelPadding
.
left
-
indicatorWeight
/
2.0
-
100.0
;
final
double
indicatorY
=
50.0
+
indicatorWeight
/
2.0
;
const
double
indicatorY
=
50.0
+
indicatorWeight
/
2.0
;
expect
(
tabBarBox
,
paints
..
line
(
strokeWidth:
indicatorWeight
,
p1:
new
Offset
(
indicatorLeft
,
indicatorY
),
...
...
@@ -1295,7 +1295,7 @@ void main() {
// Tab 0 out of 100 selected
double
indicatorLeft
=
99.0
*
100.0
+
indicatorWeight
/
2.0
;
double
indicatorRight
=
100.0
*
100.0
-
indicatorWeight
/
2.0
;
final
double
indicatorY
=
40.0
+
indicatorWeight
/
2.0
;
const
double
indicatorY
=
40.0
+
indicatorWeight
/
2.0
;
expect
(
tabBarBox
,
paints
..
line
(
strokeWidth:
indicatorWeight
,
p1:
new
Offset
(
indicatorLeft
,
indicatorY
),
...
...
@@ -1309,8 +1309,8 @@ void main() {
// The x coordinates of p1 and p2 were derived empirically, not analytically.
expect
(
tabBarBox
,
paints
..
line
(
strokeWidth:
indicatorWeight
,
p1:
new
Offset
(
2476.0
,
indicatorY
),
p2:
new
Offset
(
2574.0
,
indicatorY
),
p1:
const
Offset
(
2476.0
,
indicatorY
),
p2:
const
Offset
(
2574.0
,
indicatorY
),
));
await
tester
.
pump
(
const
Duration
(
milliseconds:
501
));
...
...
@@ -1691,7 +1691,7 @@ void main() {
final
RenderBox
tabBarBox
=
tester
.
firstRenderObject
<
RenderBox
>(
find
.
byType
(
TabBar
));
expect
(
tabBarBox
.
size
.
height
,
48.0
);
// 48 = _kTabHeight(46) + indicatorWeight(2.0)
final
double
indicatorY
=
48.0
-
indicatorWeight
/
2.0
;
const
double
indicatorY
=
48.0
-
indicatorWeight
/
2.0
;
double
indicatorLeft
=
indicatorWeight
/
2.0
;
double
indicatorRight
=
400.0
-
indicatorWeight
/
2.0
;
// 400 = screen_width / 2
expect
(
tabBarBox
,
paints
..
line
(
...
...
packages/flutter/test/material/text_field_test.dart
View file @
7667db63
...
...
@@ -587,7 +587,7 @@ void main() {
),
);
final
String
testValue
=
kThreeLines
;
const
String
testValue
=
kThreeLines
;
const
String
cutValue
=
'First line of stuff '
;
await
tester
.
enterText
(
find
.
byType
(
TextField
),
testValue
);
await
skipPastScrollingAnimation
(
tester
);
...
...
packages/flutter/test/painting/alignment_test.dart
View file @
7667db63
...
...
@@ -37,7 +37,7 @@ void main() {
test
(
'AlignmentGeometry invariants'
,
()
{
final
AlignmentDirectional
topStart
=
AlignmentDirectional
.
topStart
;
final
AlignmentDirectional
topEnd
=
AlignmentDirectional
.
topEnd
;
final
Alignment
center
=
Alignment
.
center
;
const
Alignment
center
=
Alignment
.
center
;
final
Alignment
topLeft
=
Alignment
.
topLeft
;
final
Alignment
topRight
=
Alignment
.
topRight
;
final
List
<
double
>
numbers
=
<
double
>[
0.0
,
1.0
,
-
1.0
,
2.0
,
0.25
,
0.5
,
100.0
,
-
999.75
];
...
...
packages/flutter/test/painting/shape_decoration_test.dart
View file @
7667db63
...
...
@@ -17,10 +17,10 @@ void main() {
test
(
'ShapeDecoration constructor'
,
()
{
const
Color
colorR
=
const
Color
(
0xffff0000
);
const
Color
colorG
=
const
Color
(
0xff00ff00
);
final
Gradient
gradient
=
const
LinearGradient
(
colors:
const
<
Color
>[
colorR
,
colorG
]);
const
Gradient
gradient
=
const
LinearGradient
(
colors:
const
<
Color
>[
colorR
,
colorG
]);
expect
(
const
ShapeDecoration
(
shape:
const
Border
()),
const
ShapeDecoration
(
shape:
const
Border
()));
expect
(()
=>
new
ShapeDecoration
(
color:
colorR
,
gradient:
gradient
,
shape:
const
Border
()),
throwsAssertionError
);
expect
(()
=>
new
ShapeDecoration
(
gradient:
gradient
,
shape:
null
),
throwsAssertionError
);
expect
(()
=>
new
ShapeDecoration
(
color:
colorR
,
gradient:
nonconst
(
gradient
)
,
shape:
const
Border
()),
throwsAssertionError
);
expect
(()
=>
new
ShapeDecoration
(
gradient:
nonconst
(
gradient
)
,
shape:
null
),
throwsAssertionError
);
expect
(
new
ShapeDecoration
.
fromBoxDecoration
(
const
BoxDecoration
(
shape:
BoxShape
.
circle
)),
const
ShapeDecoration
(
shape:
const
CircleBorder
(
side:
BorderSide
.
none
)),
...
...
packages/flutter/test/widgets/framework_test.dart
View file @
7667db63
...
...
@@ -37,10 +37,10 @@ void main() {
});
testWidgets
(
'GlobalObjectKey toString test'
,
(
WidgetTester
tester
)
async
{
final
GlobalObjectKey
one
=
const
GlobalObjectKey
(
1
);
final
GlobalObjectKey
<
TestState
>
two
=
const
GlobalObjectKey
<
TestState
>(
2
);
final
GlobalObjectKey
three
=
const
_MyGlobalObjectKey
(
3
);
final
GlobalObjectKey
<
TestState
>
four
=
const
_MyGlobalObjectKey
<
TestState
>(
4
);
const
GlobalObjectKey
one
=
const
GlobalObjectKey
(
1
);
const
GlobalObjectKey
<
TestState
>
two
=
const
GlobalObjectKey
<
TestState
>(
2
);
const
GlobalObjectKey
three
=
const
_MyGlobalObjectKey
(
3
);
const
GlobalObjectKey
<
TestState
>
four
=
const
_MyGlobalObjectKey
<
TestState
>(
4
);
expect
(
one
.
toString
(),
equals
(
'[GlobalObjectKey
${describeIdentity(1)}
]'
));
expect
(
two
.
toString
(),
equals
(
'[GlobalObjectKey<TestState>
${describeIdentity(2)}
]'
));
...
...
packages/flutter/test/widgets/heroes_test.dart
View file @
7667db63
...
...
@@ -259,7 +259,7 @@ void main() {
// over duration and according to curve.
const
Duration
duration
=
const
Duration
(
milliseconds:
300
);
final
Curve
curve
=
Curves
.
fastOutSlowIn
;
const
Curve
curve
=
Curves
.
fastOutSlowIn
;
final
double
initialHeight
=
tester
.
getSize
(
find
.
byKey
(
firstKey
,
skipOffstage:
false
)).
height
;
final
double
finalHeight
=
tester
.
getSize
(
find
.
byKey
(
secondKey
,
skipOffstage:
false
)).
height
;
final
double
deltaHeight
=
finalHeight
-
initialHeight
;
...
...
@@ -1086,7 +1086,7 @@ void main() {
const
double
epsilon
=
0.001
;
const
Duration
duration
=
const
Duration
(
milliseconds:
300
);
final
Curve
curve
=
Curves
.
fastOutSlowIn
;
const
Curve
curve
=
Curves
.
fastOutSlowIn
;
final
MaterialPointArcTween
pushCenterTween
=
new
MaterialPointArcTween
(
begin:
const
Offset
(
50.0
,
50.0
),
end:
const
Offset
(
400.0
,
300.0
),
...
...
packages/flutter/test/widgets/image_resolution_test.dart
View file @
7667db63
...
...
@@ -151,7 +151,7 @@ TestImage getTestImage(WidgetTester tester, Key key) {
Future
<
Null
>
pumpTreeToLayout
(
WidgetTester
tester
,
Widget
widget
)
{
const
Duration
pumpDuration
=
const
Duration
(
milliseconds:
0
);
final
EnginePhase
pumpPhase
=
EnginePhase
.
layout
;
const
EnginePhase
pumpPhase
=
EnginePhase
.
layout
;
return
tester
.
pumpWidget
(
widget
,
pumpDuration
,
pumpPhase
);
}
...
...
packages/flutter/test/widgets/semantics_debugger_test.dart
View file @
7667db63
...
...
@@ -326,7 +326,7 @@ void main() {
final
Key
keyBottom
=
new
UniqueKey
();
bool
valueTop
=
false
;
final
bool
valueBottom
=
true
;
const
bool
valueBottom
=
true
;
await
tester
.
pumpWidget
(
new
Directionality
(
...
...
packages/flutter/test/widgets/slivers_protocol_test.dart
View file @
7667db63
...
...
@@ -34,7 +34,7 @@ void main() {
),
);
final
ScrollPosition
position
=
tester
.
state
<
ScrollableState
>(
find
.
byType
(
Scrollable
)).
position
;
final
double
max
=
RenderBigSliver
.
height
*
3.0
+
(
RenderOverlappingSliver
.
totalHeight
)
*
2.0
-
600.0
;
// 600 is the height of the test viewport
const
double
max
=
RenderBigSliver
.
height
*
3.0
+
(
RenderOverlappingSliver
.
totalHeight
)
*
2.0
-
600.0
;
// 600 is the height of the test viewport
assert
(
max
<
10000.0
);
expect
(
max
,
1450.0
);
expect
(
position
.
pixels
,
0.0
);
...
...
packages/flutter_tools/lib/src/android/gradle.dart
View file @
7667db63
...
...
@@ -122,7 +122,7 @@ void handleKnownGradleExceptions(String exceptionString) {
// Handle Gradle error thrown when Gradle needs to download additional
// Android SDK components (e.g. Platform Tools), and the license
// for that component has not been accepted.
final
String
matcher
=
const
String
matcher
=
r'You have not accepted the license agreements of the following SDK components:'
r'\s*\[(.+)\]'
;
final
RegExp
licenseFailure
=
new
RegExp
(
matcher
,
multiLine:
true
);
...
...
packages/flutter_tools/lib/src/base/io.dart
View file @
7667db63
...
...
@@ -78,7 +78,7 @@ export 'dart:io'
/// Exits the process with the given [exitCode].
typedef
void
ExitFunction
(
int
exitCode
);
final
ExitFunction
_defaultExitFunction
=
io
.
exit
;
const
ExitFunction
_defaultExitFunction
=
io
.
exit
;
ExitFunction
_exitFunction
=
_defaultExitFunction
;
...
...
packages/flutter_tools/lib/src/ios/mac.dart
View file @
7667db63
...
...
@@ -507,7 +507,7 @@ class XcodeBuildExecution {
final
Map
<
String
,
String
>
buildSettings
;
}
final
String
_xcodeRequirement
=
'Xcode
$kXcodeRequiredVersionMajor
.
$kXcodeRequiredVersionMinor
or greater is required to develop for iOS.'
;
const
String
_xcodeRequirement
=
'Xcode
$kXcodeRequiredVersionMajor
.
$kXcodeRequiredVersionMinor
or greater is required to develop for iOS.'
;
bool
_checkXcodeVersion
(
)
{
if
(!
platform
.
isMacOS
)
...
...
packages/flutter_tools/lib/src/plugins.dart
View file @
7667db63
...
...
@@ -241,7 +241,7 @@ void injectPlugins({String directory}) {
_writeAndroidPluginRegistrant
(
directory
,
plugins
);
if
(
fs
.
isDirectorySync
(
fs
.
path
.
join
(
directory
,
'ios'
)))
{
_writeIOSPluginRegistrant
(
directory
,
plugins
);
final
CocoaPods
cocoaPods
=
const
CocoaPods
();
const
CocoaPods
cocoaPods
=
const
CocoaPods
();
if
(
plugins
.
isNotEmpty
)
cocoaPods
.
setupPodfile
(
directory
);
if
(
changed
)
...
...
packages/flutter_tools/test/asset_bundle_package_fonts_test.dart
View file @
7667db63
...
...
@@ -170,7 +170,7 @@ $fontsSection
const
String
localFont
=
'a/bar'
;
writeFontAsset
(
''
,
localFont
);
final
String
expectedFontManifest
=
const
String
expectedFontManifest
=
'[{"fonts":[{"asset":"packages/test_package/bar"},{"asset":"a/bar"}],'
'"family":"foo"}]'
;
await
buildAndVerifyFonts
(
...
...
@@ -200,7 +200,7 @@ $fontsSection
const
String
font
=
'a/bar'
;
writeFontAsset
(
'p/p/'
,
font
);
final
String
expectedFontManifest
=
const
String
expectedFontManifest
=
'[{"family":"packages/test_package/foo",'
'"fonts":[{"asset":"packages/test_package/a/bar"}]}]'
;
await
buildAndVerifyFonts
(
...
...
@@ -231,7 +231,7 @@ $fontsSection
const
String
font
=
'bar'
;
writeFontAsset
(
'p2/p/lib/'
,
font
);
final
String
expectedFontManifest
=
const
String
expectedFontManifest
=
'[{"family":"packages/test_package/foo",'
'"fonts":[{"asset":"packages/test_package2/bar"}]}]'
;
await
buildAndVerifyFonts
(
...
...
@@ -263,7 +263,7 @@ $fontsSection
const
String
font
=
'a/bar'
;
writeFontAsset
(
'p/p/'
,
font
);
final
String
expectedFontManifest
=
const
String
expectedFontManifest
=
'[{"family":"packages/test_package/foo",'
'"fonts":[{"weight":400,"style":"italic","asset":"packages/test_package/a/bar"}]}]'
;
await
buildAndVerifyFonts
(
...
...
@@ -298,7 +298,7 @@ $fontsSection
writeFontAsset
(
''
,
font
);
writeFontAsset
(
'p/p/'
,
font
);
final
String
expectedFontManifest
=
const
String
expectedFontManifest
=
'[{"fonts":[{"asset":"a/bar"}],"family":"foo"},'
'{"family":"packages/test_package/foo",'
'"fonts":[{"asset":"packages/test_package/a/bar"}]}]'
;
...
...
packages/flutter_tools/test/asset_bundle_package_test.dart
View file @
7667db63
...
...
@@ -168,7 +168,7 @@ $assetsSection
writeAssets
(
'p/p/'
,
assets
);
final
String
expectedAssetManifest
=
'{"packages/test_package/a/foo":'
const
String
expectedAssetManifest
=
'{"packages/test_package/a/foo":'
'["packages/test_package/a/foo"]}'
;
await
buildAndVerifyAssets
(
assets
,
...
...
@@ -192,7 +192,7 @@ $assetsSection
final
List
<
String
>
assets
=
<
String
>[
'a/foo'
];
writeAssets
(
'p/p/lib/'
,
assets
);
final
String
expectedAssetManifest
=
'{"packages/test_package/a/foo":'
const
String
expectedAssetManifest
=
'{"packages/test_package/a/foo":'
'["packages/test_package/a/foo"]}'
;
await
buildAndVerifyAssets
(
assets
,
...
...
@@ -215,7 +215,7 @@ $assetsSection
final
List
<
String
>
assets
=
<
String
>[
'a/foo'
,
'a/v/foo'
];
writeAssets
(
'p/p/'
,
assets
);
final
String
expectedManifest
=
'{"packages/test_package/a/foo":'
const
String
expectedManifest
=
'{"packages/test_package/a/foo":'
'["packages/test_package/a/foo","packages/test_package/a/v/foo"]}'
;
await
buildAndVerifyAssets
(
...
...
@@ -242,7 +242,7 @@ $assetsSection
final
List
<
String
>
assets
=
<
String
>[
'a/foo'
,
'a/v/foo'
];
writeAssets
(
'p/p/lib/'
,
assets
);
final
String
expectedManifest
=
'{"packages/test_package/a/foo":'
const
String
expectedManifest
=
'{"packages/test_package/a/foo":'
'["packages/test_package/a/foo","packages/test_package/a/v/foo"]}'
;
await
buildAndVerifyAssets
(
...
...
@@ -266,7 +266,7 @@ $assetsSection
);
writeAssets
(
'p/p/'
,
assets
);
final
String
expectedAssetManifest
=
const
String
expectedAssetManifest
=
'{"packages/test_package/a/foo":["packages/test_package/a/foo"],'
'"packages/test_package/a/bar":["packages/test_package/a/bar"]}'
;
...
...
@@ -298,7 +298,7 @@ $assetsSection
);
writeAssets
(
'p/p/lib/'
,
assets
);
final
String
expectedAssetManifest
=
const
String
expectedAssetManifest
=
'{"packages/test_package/a/foo":["packages/test_package/a/foo"],'
'"packages/test_package/a/bar":["packages/test_package/a/bar"]}'
;
...
...
@@ -332,7 +332,7 @@ $assetsSection
writeAssets
(
'p/p/'
,
assets
);
writeAssets
(
'p2/p/'
,
assets
);
final
String
expectedAssetManifest
=
const
String
expectedAssetManifest
=
'{"packages/test_package/a/foo":'
'["packages/test_package/a/foo","packages/test_package/a/v/foo"],'
'"packages/test_package2/a/foo":'
...
...
@@ -371,7 +371,7 @@ $assetsSection
writeAssets
(
'p/p/lib/'
,
assets
);
writeAssets
(
'p2/p/lib/'
,
assets
);
final
String
expectedAssetManifest
=
const
String
expectedAssetManifest
=
'{"packages/test_package/a/foo":'
'["packages/test_package/a/foo","packages/test_package/a/v/foo"],'
'"packages/test_package2/a/foo":'
...
...
@@ -404,7 +404,7 @@ $assetsSection
final
List
<
String
>
assets
=
<
String
>[
'a/foo'
,
'a/v/foo'
];
writeAssets
(
'p2/p/lib/'
,
assets
);
final
String
expectedAssetManifest
=
const
String
expectedAssetManifest
=
'{"packages/test_package2/a/foo":'
'["packages/test_package2/a/foo","packages/test_package2/a/v/foo"]}'
;
...
...
packages/flutter_tools/test/commands/analyze_continuously_test.dart
View file @
7667db63
...
...
@@ -71,7 +71,7 @@ void main() {
});
testUsingContext
(
'--preview-dart-2'
,
()
async
{
final
String
contents
=
"StringBuffer bar = StringBuffer('baz');"
;
const
String
contents
=
"StringBuffer bar = StringBuffer('baz');"
;
tempDir
.
childFile
(
'main.dart'
).
writeAsStringSync
(
contents
);
server
=
new
AnalysisServer
(
dartSdkPath
,
<
String
>[
tempDir
.
path
],
previewDart2:
true
);
...
...
@@ -90,7 +90,7 @@ void main() {
});
testUsingContext
(
'no --preview-dart-2 shows errors'
,
()
async
{
final
String
contents
=
"StringBuffer bar = StringBuffer('baz');"
;
const
String
contents
=
"StringBuffer bar = StringBuffer('baz');"
;
tempDir
.
childFile
(
'main.dart'
).
writeAsStringSync
(
contents
);
server
=
new
AnalysisServer
(
dartSdkPath
,
<
String
>[
tempDir
.
path
],
previewDart2:
false
);
...
...
packages/flutter_tools/test/commands/analyze_once_test.dart
View file @
7667db63
...
...
@@ -194,7 +194,7 @@ void bar() {
});
testUsingContext
(
'--preview-dart-2'
,
()
async
{
final
String
contents
=
'''
const
String
contents
=
'''
StringBuffer bar = StringBuffer('
baz
');
'''
;
...
...
@@ -213,7 +213,7 @@ StringBuffer bar = StringBuffer('baz');
});
testUsingContext
(
'no --preview-dart-2 shows errors'
,
()
async
{
final
String
contents
=
'''
const
String
contents
=
'''
StringBuffer bar = StringBuffer('
baz
');
'''
;
...
...
packages/flutter_tools/test/commands/doctor_test.dart
View file @
7667db63
...
...
@@ -15,7 +15,7 @@ import '../src/context.dart';
void
main
(
)
{
group
(
'doctor'
,
()
{
testUsingContext
(
'intellij validator'
,
()
async
{
final
String
installPath
=
'/path/to/intelliJ'
;
const
String
installPath
=
'/path/to/intelliJ'
;
final
ValidationResult
result
=
await
new
IntelliJValidatorTestTarget
(
'Test'
,
installPath
).
validate
();
expect
(
result
.
type
,
ValidationType
.
partial
);
expect
(
result
.
statusInfo
,
'version test.test.test'
);
...
...
packages/flutter_tools/test/flutter_manifest_test.dart
View file @
7667db63
...
...
@@ -203,7 +203,7 @@ flutter:
'''
;
final
FlutterManifest
flutterManifest
=
await
FlutterManifest
.
createFromString
(
manifest
);
final
String
expectedFontsDescriptor
=
'[{fonts: [{asset: a/bar}, {style: italic, weight: 400, asset: a/bar}], family: foo},'
const
String
expectedFontsDescriptor
=
'[{fonts: [{asset: a/bar}, {style: italic, weight: 400, asset: a/bar}], family: foo},'
' {fonts: [{asset: a/baz}, {style: italic, weight: 400, asset: a/baz}], family: bar}]'
;
expect
(
flutterManifest
.
fontsDescriptor
.
toString
(),
expectedFontsDescriptor
);
final
List
<
Font
>
fonts
=
flutterManifest
.
fonts
;
...
...
@@ -264,7 +264,7 @@ flutter:
final
FlutterManifest
flutterManifest
=
await
FlutterManifest
.
createFromString
(
manifest
);
final
String
expectedFontsDescriptor
=
'[{fonts: [{asset: a/bar}, {style: italic, weight: 400, asset: a/bar}], family: foo},'
const
String
expectedFontsDescriptor
=
'[{fonts: [{asset: a/bar}, {style: italic, weight: 400, asset: a/bar}], family: foo},'
' {fonts: [{asset: a/baz}, {style: italic, weight: 400, asset: a/baz}]}]'
;
expect
(
flutterManifest
.
fontsDescriptor
.
toString
(),
expectedFontsDescriptor
);
final
List
<
Font
>
fonts
=
flutterManifest
.
fonts
;
...
...
@@ -304,7 +304,7 @@ flutter:
'''
;
final
FlutterManifest
flutterManifest
=
await
FlutterManifest
.
createFromString
(
manifest
);
final
String
expectedFontsDescriptor
=
'[{fonts: [{asset: a/bar}, {style: italic, weight: 400, asset: a/bar}], family: foo},'
const
String
expectedFontsDescriptor
=
'[{fonts: [{asset: a/bar}, {style: italic, weight: 400, asset: a/bar}], family: foo},'
' {family: bar}]'
;
expect
(
flutterManifest
.
fontsDescriptor
.
toString
(),
expectedFontsDescriptor
);
final
List
<
Font
>
fonts
=
flutterManifest
.
fonts
;
...
...
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