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
b670ce4b
Commit
b670ce4b
authored
Dec 01, 2016
by
Alexandre Ardhuin
Committed by
Adam Barth
Dec 01, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prefer const constructor (#7118)
parent
7667a3f8
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
37 additions
and
37 deletions
+37
-37
about.dart
packages/flutter/lib/src/material/about.dart
+8
-8
data_table.dart
packages/flutter/lib/src/material/data_table.dart
+1
-1
dialog.dart
packages/flutter/lib/src/material/dialog.dart
+2
-2
expansion_panel.dart
packages/flutter/lib/src/material/expansion_panel.dart
+2
-2
paginated_data_table.dart
packages/flutter/lib/src/material/paginated_data_table.dart
+3
-3
popup_menu.dart
packages/flutter/lib/src/material/popup_menu.dart
+3
-3
progress_indicator.dart
packages/flutter/lib/src/material/progress_indicator.dart
+7
-7
refresh_indicator.dart
packages/flutter/lib/src/material/refresh_indicator.dart
+1
-1
stepper.dart
packages/flutter/lib/src/material/stepper.dart
+4
-4
tabs.dart
packages/flutter/lib/src/material/tabs.dart
+3
-3
flutter_logo.dart
packages/flutter/lib/src/painting/flutter_logo.dart
+1
-1
stack.dart
packages/flutter/lib/src/rendering/stack.dart
+1
-1
placeholder.dart
packages/flutter/lib/src/widgets/placeholder.dart
+1
-1
No files found.
packages/flutter/lib/src/material/about.dart
View file @
b670ce4b
...
...
@@ -265,10 +265,10 @@ class AboutDialog extends StatelessWidget {
final
Widget
icon
=
applicationIcon
??
_defaultApplicationIcon
(
context
);
List
<
Widget
>
body
=
<
Widget
>[];
if
(
icon
!=
null
)
body
.
add
(
new
IconTheme
(
data:
new
IconThemeData
(
size:
48.0
),
child:
icon
));
body
.
add
(
new
IconTheme
(
data:
const
IconThemeData
(
size:
48.0
),
child:
icon
));
body
.
add
(
new
Expanded
(
child:
new
Padding
(
padding:
new
EdgeInsets
.
symmetric
(
horizontal:
24.0
),
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
24.0
),
child:
new
BlockBody
(
children:
<
Widget
>[
new
Text
(
name
,
style:
Theme
.
of
(
context
).
textTheme
.
headline
),
...
...
@@ -381,15 +381,15 @@ class _LicensePageState extends State<LicensePage> {
await
for
(
LicenseEntry
license
in
LicenseRegistry
.
licenses
)
{
setState
(()
{
_licenses
.
add
(
new
Padding
(
padding:
new
EdgeInsets
.
symmetric
(
vertical:
18.0
),
padding:
const
EdgeInsets
.
symmetric
(
vertical:
18.0
),
child:
new
Text
(
'🍀'
,
// That's U+1F340. Could also use U+2766 (❦) if U+1F340 doesn't work everywhere.
textAlign:
TextAlign
.
center
)
));
_licenses
.
add
(
new
Container
(
decoration:
new
BoxDecoration
(
border:
new
Border
(
bottom:
new
BorderSide
(
width:
0.0
))
decoration:
const
BoxDecoration
(
border:
const
Border
(
bottom:
const
BorderSide
(
width:
0.0
))
),
child:
new
Text
(
license
.
packages
.
join
(
', '
),
...
...
@@ -400,7 +400,7 @@ class _LicensePageState extends State<LicensePage> {
for
(
LicenseParagraph
paragraph
in
license
.
paragraphs
)
{
if
(
paragraph
.
indent
==
LicenseParagraph
.
centeredIndent
)
{
_licenses
.
add
(
new
Padding
(
padding:
new
EdgeInsets
.
only
(
top:
16.0
),
padding:
const
EdgeInsets
.
only
(
top:
16.0
),
child:
new
Text
(
paragraph
.
text
,
style:
new
TextStyle
(
fontWeight:
FontWeight
.
bold
),
...
...
@@ -438,7 +438,7 @@ class _LicensePageState extends State<LicensePage> {
contents
.
addAll
(
_licenses
);
if
(!
_loaded
)
{
contents
.
add
(
new
Padding
(
padding:
new
EdgeInsets
.
symmetric
(
vertical:
24.0
),
padding:
const
EdgeInsets
.
symmetric
(
vertical:
24.0
),
child:
new
Center
(
child:
new
CircularProgressIndicator
()
)
...
...
@@ -452,7 +452,7 @@ class _LicensePageState extends State<LicensePage> {
style:
Theme
.
of
(
context
).
textTheme
.
caption
,
child:
new
Scrollbar
(
child:
new
LazyBlock
(
padding:
new
EdgeInsets
.
symmetric
(
horizontal:
8.0
,
vertical:
12.0
),
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
8.0
,
vertical:
12.0
),
delegate:
new
LazyBlockChildren
(
children:
contents
)
...
...
packages/flutter/lib/src/material/data_table.dart
View file @
b670ce4b
...
...
@@ -397,7 +397,7 @@ class DataTable extends StatelessWidget {
down:
sorted
?
ascending
:
null
,
duration:
_kSortArrowAnimationDuration
);
final
Widget
arrowPadding
=
new
SizedBox
(
width:
_kSortArrowPadding
);
final
Widget
arrowPadding
=
const
SizedBox
(
width:
_kSortArrowPadding
);
label
=
new
Row
(
children:
numeric
?
<
Widget
>[
arrow
,
arrowPadding
,
label
]
:
<
Widget
>[
label
,
arrowPadding
,
arrow
]
...
...
packages/flutter/lib/src/material/dialog.dart
View file @
b670ce4b
...
...
@@ -52,9 +52,9 @@ class Dialog extends StatelessWidget {
Widget
build
(
BuildContext
context
)
{
return
new
Center
(
child:
new
Container
(
margin:
new
EdgeInsets
.
symmetric
(
horizontal:
40.0
,
vertical:
24.0
),
margin:
const
EdgeInsets
.
symmetric
(
horizontal:
40.0
,
vertical:
24.0
),
child:
new
ConstrainedBox
(
constraints:
new
BoxConstraints
(
minWidth:
280.0
),
constraints:
const
BoxConstraints
(
minWidth:
280.0
),
child:
new
Material
(
elevation:
24
,
color:
_getColor
(
context
),
...
...
packages/flutter/lib/src/material/expansion_panel.dart
View file @
b670ce4b
...
...
@@ -154,8 +154,8 @@ class ExpansionPanelList extends StatelessWidget {
new
AnimatedCrossFade
(
firstChild:
new
Container
(
height:
0.0
),
secondChild:
children
[
i
].
body
,
firstCurve:
new
Interval
(
0.0
,
0.6
,
curve:
Curves
.
fastOutSlowIn
),
secondCurve:
new
Interval
(
0.4
,
1.0
,
curve:
Curves
.
fastOutSlowIn
),
firstCurve:
const
Interval
(
0.0
,
0.6
,
curve:
Curves
.
fastOutSlowIn
),
secondCurve:
const
Interval
(
0.4
,
1.0
,
curve:
Curves
.
fastOutSlowIn
),
sizeCurve:
Curves
.
fastOutSlowIn
,
crossFadeState:
_isChildExpanded
(
i
)
?
CrossFadeState
.
showSecond
:
CrossFadeState
.
showFirst
,
duration:
animationDuration
,
...
...
packages/flutter/lib/src/material/paginated_data_table.dart
View file @
b670ce4b
...
...
@@ -294,7 +294,7 @@ class PaginatedDataTableState extends State<PaginatedDataTable> {
config
.
actions
.
map
/*<Widget>*/
((
Widget
widget
)
{
return
new
Padding
(
// 8.0 is the default padding of an icon button
padding:
new
EdgeInsets
.
only
(
left:
24.0
-
8.0
*
2.0
),
padding:
const
EdgeInsets
.
only
(
left:
24.0
-
8.0
*
2.0
),
child:
widget
);
}).
toList
()
...
...
@@ -363,7 +363,7 @@ class PaginatedDataTableState extends State<PaginatedDataTable> {
:
themeData
.
textTheme
.
title
.
copyWith
(
fontWeight:
FontWeight
.
w400
),
child:
new
IconTheme
.
merge
(
context:
context
,
data:
new
IconThemeData
(
data:
const
IconThemeData
(
opacity:
0.54
),
child:
new
ButtonTheme
.
bar
(
...
...
@@ -399,7 +399,7 @@ class PaginatedDataTableState extends State<PaginatedDataTable> {
style:
footerTextStyle
,
child:
new
IconTheme
.
merge
(
context:
context
,
data:
new
IconThemeData
(
data:
const
IconThemeData
(
opacity:
0.54
),
child:
new
Container
(
...
...
packages/flutter/lib/src/material/popup_menu.dart
View file @
b670ce4b
...
...
@@ -285,12 +285,12 @@ class _PopupMenu<T> extends StatelessWidget {
));
}
final
CurveTween
opacity
=
new
CurveTween
(
curve:
new
Interval
(
0.0
,
1.0
/
3.0
));
final
CurveTween
opacity
=
new
CurveTween
(
curve:
const
Interval
(
0.0
,
1.0
/
3.0
));
final
CurveTween
width
=
new
CurveTween
(
curve:
new
Interval
(
0.0
,
unit
));
final
CurveTween
height
=
new
CurveTween
(
curve:
new
Interval
(
0.0
,
unit
*
route
.
items
.
length
));
Widget
child
=
new
ConstrainedBox
(
constraints:
new
BoxConstraints
(
constraints:
const
BoxConstraints
(
minWidth:
_kMenuMinWidth
,
maxWidth:
_kMenuMaxWidth
),
...
...
@@ -388,7 +388,7 @@ class _PopupMenuRoute<T> extends PopupRoute<T> {
return
new
CurvedAnimation
(
parent:
super
.
createAnimation
(),
curve:
Curves
.
linear
,
reverseCurve:
new
Interval
(
0.0
,
_kMenuCloseIntervalEnd
)
reverseCurve:
const
Interval
(
0.0
,
_kMenuCloseIntervalEnd
)
);
}
...
...
packages/flutter/lib/src/material/progress_indicator.dart
View file @
b670ce4b
...
...
@@ -168,7 +168,7 @@ class _LinearProgressIndicatorState extends State<LinearProgressIndicator> with
Widget
_buildIndicator
(
BuildContext
context
,
double
animationValue
)
{
return
new
Container
(
constraints:
new
BoxConstraints
.
tightFor
(
constraints:
const
BoxConstraints
.
tightFor
(
width:
double
.
INFINITY
,
height:
_kLinearProgressIndicatorHeight
),
...
...
@@ -296,20 +296,20 @@ class CircularProgressIndicator extends ProgressIndicator {
// Tweens used by circular progress indicator
final
Animatable
<
double
>
_kStrokeHeadTween
=
new
CurveTween
(
curve:
new
Interval
(
0.0
,
0.5
,
curve:
Curves
.
fastOutSlowIn
)
curve:
const
Interval
(
0.0
,
0.5
,
curve:
Curves
.
fastOutSlowIn
)
).
chain
(
new
CurveTween
(
curve:
new
SawTooth
(
5
)
curve:
const
SawTooth
(
5
)
));
final
Animatable
<
double
>
_kStrokeTailTween
=
new
CurveTween
(
curve:
new
Interval
(
0.5
,
1.0
,
curve:
Curves
.
fastOutSlowIn
)
curve:
const
Interval
(
0.5
,
1.0
,
curve:
Curves
.
fastOutSlowIn
)
).
chain
(
new
CurveTween
(
curve:
new
SawTooth
(
5
)
curve:
const
SawTooth
(
5
)
));
final
Animatable
<
int
>
_kStepTween
=
new
StepTween
(
begin:
0
,
end:
5
);
final
Animatable
<
double
>
_kRotationTween
=
new
CurveTween
(
curve:
new
SawTooth
(
5
));
final
Animatable
<
double
>
_kRotationTween
=
new
CurveTween
(
curve:
const
SawTooth
(
5
));
class
_CircularProgressIndicatorState
extends
State
<
CircularProgressIndicator
>
with
SingleTickerProviderStateMixin
{
AnimationController
_controller
;
...
...
@@ -331,7 +331,7 @@ class _CircularProgressIndicatorState extends State<CircularProgressIndicator> w
Widget
_buildIndicator
(
BuildContext
context
,
double
headValue
,
double
tailValue
,
int
stepValue
,
double
rotationValue
)
{
return
new
Container
(
constraints:
new
BoxConstraints
(
constraints:
const
BoxConstraints
(
minWidth:
_kMinCircularProgressIndicatorSize
,
minHeight:
_kMinCircularProgressIndicatorSize
,
),
...
...
packages/flutter/lib/src/material/refresh_indicator.dart
View file @
b670ce4b
...
...
@@ -357,7 +357,7 @@ class RefreshIndicatorState extends State<RefreshIndicator> with TickerProviderS
)
.
animate
(
new
CurvedAnimation
(
parent:
_sizeController
,
curve:
new
Interval
(
0.0
,
1.0
/
_kDragSizeFactorLimit
)
curve:
const
Interval
(
0.0
,
1.0
/
_kDragSizeFactorLimit
)
));
return
new
Listener
(
...
...
packages/flutter/lib/src/material/stepper.dart
View file @
b670ce4b
...
...
@@ -310,8 +310,8 @@ class _StepperState extends State<Stepper> with TickerProviderStateMixin {
return
new
AnimatedCrossFade
(
firstChild:
_buildCircle
(
index
,
true
),
secondChild:
_buildTriangle
(
index
,
true
),
firstCurve:
new
Interval
(
0.0
,
0.6
,
curve:
Curves
.
fastOutSlowIn
),
secondCurve:
new
Interval
(
0.4
,
1.0
,
curve:
Curves
.
fastOutSlowIn
),
firstCurve:
const
Interval
(
0.0
,
0.6
,
curve:
Curves
.
fastOutSlowIn
),
secondCurve:
const
Interval
(
0.4
,
1.0
,
curve:
Curves
.
fastOutSlowIn
),
sizeCurve:
Curves
.
fastOutSlowIn
,
crossFadeState:
config
.
steps
[
index
].
state
==
StepState
.
error
?
CrossFadeState
.
showSecond
:
CrossFadeState
.
showFirst
,
duration:
kThemeAnimationDuration
,
...
...
@@ -503,8 +503,8 @@ class _StepperState extends State<Stepper> with TickerProviderStateMixin {
]
)
),
firstCurve:
new
Interval
(
0.0
,
0.6
,
curve:
Curves
.
fastOutSlowIn
),
secondCurve:
new
Interval
(
0.4
,
1.0
,
curve:
Curves
.
fastOutSlowIn
),
firstCurve:
const
Interval
(
0.0
,
0.6
,
curve:
Curves
.
fastOutSlowIn
),
secondCurve:
const
Interval
(
0.4
,
1.0
,
curve:
Curves
.
fastOutSlowIn
),
sizeCurve:
Curves
.
fastOutSlowIn
,
crossFadeState:
_isCurrent
(
index
)
?
CrossFadeState
.
showSecond
:
CrossFadeState
.
showFirst
,
duration:
kThemeAnimationDuration
,
...
...
packages/flutter/lib/src/material/tabs.dart
View file @
b670ce4b
...
...
@@ -402,7 +402,7 @@ class _Tab extends StatelessWidget {
Container
centeredLabel
=
new
Container
(
child:
new
Center
(
child:
labelContent
,
widthFactor:
1.0
,
heightFactor:
1.0
),
constraints:
new
BoxConstraints
(
minWidth:
_kMinTabWidth
),
constraints:
const
BoxConstraints
(
minWidth:
_kMinTabWidth
),
padding:
_kTabLabelPadding
);
...
...
@@ -512,7 +512,7 @@ class TabBarSelection<T> extends StatefulWidget {
/// TabBarSelectionState<Foo> tabState = TabBarSelection.of/*<Foo>*/(context);
/// ```
static
TabBarSelectionState
<
dynamic
/*=T*/
>
of
/*<T>*/
(
BuildContext
context
)
{
return
context
.
ancestorStateOfType
(
new
TypeMatcher
<
TabBarSelectionState
<
dynamic
/*=T*/
>>());
return
context
.
ancestorStateOfType
(
const
TypeMatcher
<
TabBarSelectionState
<
dynamic
/*=T*/
>>());
}
@override
...
...
@@ -1302,7 +1302,7 @@ class TabPageSelector<T> extends StatelessWidget {
return
new
Container
(
width:
12.0
,
height:
12.0
,
margin:
new
EdgeInsets
.
all
(
4.0
),
margin:
const
EdgeInsets
.
all
(
4.0
),
decoration:
new
BoxDecoration
(
backgroundColor:
background
,
border:
new
Border
.
all
(
color:
selectedColor
.
end
),
...
...
packages/flutter/lib/src/painting/flutter_logo.dart
View file @
b670ce4b
...
...
@@ -258,7 +258,7 @@ class _FlutterLogoPainter extends BoxPainter {
)
);
_textPainter
.
layout
();
final
ui
.
TextBox
textSize
=
_textPainter
.
getBoxesForSelection
(
new
TextSelection
(
baseOffset:
0
,
extentOffset:
kLabel
.
length
)).
single
;
final
ui
.
TextBox
textSize
=
_textPainter
.
getBoxesForSelection
(
const
TextSelection
(
baseOffset:
0
,
extentOffset:
kLabel
.
length
)).
single
;
_textBoundingRect
=
new
Rect
.
fromLTRB
(
textSize
.
left
,
textSize
.
top
,
textSize
.
right
,
textSize
.
bottom
);
}
...
...
packages/flutter/lib/src/rendering/stack.dart
View file @
b670ce4b
...
...
@@ -52,7 +52,7 @@ class RelativeRect {
}
/// A rect that covers the entire container.
static
final
RelativeRect
fill
=
new
RelativeRect
.
fromLTRB
(
0.0
,
0.0
,
0.0
,
0.0
);
static
final
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.
final
double
left
;
...
...
packages/flutter/lib/src/widgets/placeholder.dart
View file @
b670ce4b
...
...
@@ -35,6 +35,6 @@ class PlaceholderState extends State<Placeholder> {
Widget
build
(
BuildContext
context
)
{
if
(
_child
!=
null
)
return
child
;
return
new
SizedBox
(
width:
0.0
,
height:
0.0
);
return
const
SizedBox
(
width:
0.0
,
height:
0.0
);
}
}
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