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
c22812e0
Commit
c22812e0
authored
Mar 10, 2017
by
Alexandre Ardhuin
Committed by
GitHub
Mar 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Flutter style guide: Prefer naming the argument to a setter 'value' (#8691)
parent
7b9cefb3
Changes
16
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
148 additions
and
148 deletions
+148
-148
slider.dart
packages/flutter/lib/src/cupertino/slider.dart
+3
-3
slider.dart
packages/flutter/lib/src/material/slider.dart
+8
-8
tab_controller.dart
packages/flutter/lib/src/material/tab_controller.dart
+5
-5
simulation_group.dart
packages/flutter/lib/src/physics/simulation_group.dart
+3
-3
custom_layout.dart
packages/flutter/lib/src/rendering/custom_layout.dart
+5
-5
performance_overlay.dart
packages/flutter/lib/src/rendering/performance_overlay.dart
+12
-12
proxy_box.dart
packages/flutter/lib/src/rendering/proxy_box.dart
+75
-75
shifted_box.dart
packages/flutter/lib/src/rendering/shifted_box.dart
+4
-4
sliver_fixed_extent_list.dart
...s/flutter/lib/src/rendering/sliver_fixed_extent_list.dart
+8
-8
sliver_grid.dart
packages/flutter/lib/src/rendering/sliver_grid.dart
+6
-6
page_view.dart
packages/flutter/lib/src/widgets/page_view.dart
+3
-3
placeholder.dart
packages/flutter/lib/src/widgets/placeholder.dart
+3
-3
markdown_raw.dart
packages/flutter_markdown/lib/src/markdown_raw.dart
+3
-3
binding.dart
packages/flutter_test/lib/src/binding.dart
+2
-2
devfs.dart
packages/flutter_tools/lib/src/devfs.dart
+6
-6
flutter_command.dart
packages/flutter_tools/lib/src/runner/flutter_command.dart
+2
-2
No files found.
packages/flutter/lib/src/cupertino/slider.dart
View file @
c22812e0
...
...
@@ -225,10 +225,10 @@ class _RenderCupertinoSlider extends RenderConstrainedBox implements SemanticsAc
int
get
divisions
=>
_divisions
;
int
_divisions
;
set
divisions
(
int
newDivisions
)
{
if
(
newDivisions
==
_divisions
)
set
divisions
(
int
value
)
{
if
(
value
==
_divisions
)
return
;
_divisions
=
newDivisions
;
_divisions
=
value
;
markNeedsPaint
();
}
...
...
packages/flutter/lib/src/material/slider.dart
View file @
c22812e0
...
...
@@ -316,27 +316,27 @@ class _RenderSlider extends RenderConstrainedBox implements SemanticsActionHandl
int
get
divisions
=>
_divisions
;
int
_divisions
;
set
divisions
(
int
newDivisions
)
{
if
(
newDivisions
==
_divisions
)
set
divisions
(
int
value
)
{
if
(
value
==
_divisions
)
return
;
_divisions
=
newDivisions
;
_divisions
=
value
;
markNeedsPaint
();
}
String
get
label
=>
_label
;
String
_label
;
set
label
(
String
newLabel
)
{
if
(
newLabel
==
_label
)
set
label
(
String
value
)
{
if
(
value
==
_label
)
return
;
_label
=
newLabel
;
_label
=
value
;
additionalConstraints
=
_getAdditionalConstraints
(
_label
);
if
(
newLabel
!=
null
)
{
if
(
value
!=
null
)
{
// TODO(abarth): Handle textScaleFactor.
// https://github.com/flutter/flutter/issues/5938
_labelPainter
..
text
=
new
TextSpan
(
style:
_textTheme
.
body1
.
copyWith
(
fontSize:
10.0
),
text:
newLabel
text:
value
)
..
layout
();
}
else
{
...
...
packages/flutter/lib/src/material/tab_controller.dart
View file @
c22812e0
...
...
@@ -148,13 +148,13 @@ class TabController extends ChangeNotifier {
/// TabBarView has been dragged to the left. Similarly a value between
/// 0.0 and 1.0 implies that the TabBarView has been dragged to the right.
double
get
offset
=>
_animationController
.
value
-
_index
.
toDouble
();
set
offset
(
double
newOffset
)
{
assert
(
newOffset
!=
null
);
assert
(
newOffset
>=
-
1.0
&&
newOffset
<=
1.0
);
set
offset
(
double
value
)
{
assert
(
value
!=
null
);
assert
(
value
>=
-
1.0
&&
value
<=
1.0
);
assert
(!
indexIsChanging
);
if
(
newOffset
==
offset
)
if
(
value
==
offset
)
return
;
_animationController
.
value
=
newOffset
+
_index
.
toDouble
();
_animationController
.
value
=
value
+
_index
.
toDouble
();
}
@override
...
...
packages/flutter/lib/src/physics/simulation_group.dart
View file @
c22812e0
...
...
@@ -69,8 +69,8 @@ abstract class SimulationGroup extends Simulation {
}
@override
set
tolerance
(
Tolerance
t
)
{
currentSimulation
.
tolerance
=
t
;
super
.
tolerance
=
t
;
set
tolerance
(
Tolerance
value
)
{
currentSimulation
.
tolerance
=
value
;
super
.
tolerance
=
value
;
}
}
packages/flutter/lib/src/rendering/custom_layout.dart
View file @
c22812e0
...
...
@@ -282,13 +282,13 @@ class RenderCustomMultiChildLayoutBox extends RenderBox
/// The delegate that controls the layout of the children.
MultiChildLayoutDelegate
get
delegate
=>
_delegate
;
MultiChildLayoutDelegate
_delegate
;
set
delegate
(
MultiChildLayoutDelegate
newDelegat
e
)
{
assert
(
newDelegat
e
!=
null
);
if
(
_delegate
==
newDelegat
e
)
set
delegate
(
MultiChildLayoutDelegate
valu
e
)
{
assert
(
valu
e
!=
null
);
if
(
_delegate
==
valu
e
)
return
;
if
(
newDelegate
.
runtimeType
!=
_delegate
.
runtimeType
||
newDelegat
e
.
shouldRelayout
(
_delegate
))
if
(
value
.
runtimeType
!=
_delegate
.
runtimeType
||
valu
e
.
shouldRelayout
(
_delegate
))
markNeedsLayout
();
_delegate
=
newDelegat
e
;
_delegate
=
valu
e
;
}
Size
_getSize
(
BoxConstraints
constraints
)
{
...
...
packages/flutter/lib/src/rendering/performance_overlay.dart
View file @
c22812e0
...
...
@@ -77,11 +77,11 @@ class RenderPerformanceOverlay extends RenderBox {
/// [PerformanceOverlayOption] to enable.
int
get
optionsMask
=>
_optionsMask
;
int
_optionsMask
;
set
optionsMask
(
int
mask
)
{
assert
(
mask
!=
null
);
if
(
mask
==
_optionsMask
)
set
optionsMask
(
int
value
)
{
assert
(
value
!=
null
);
if
(
value
==
_optionsMask
)
return
;
_optionsMask
=
mask
;
_optionsMask
=
value
;
markNeedsPaint
();
}
...
...
@@ -90,22 +90,22 @@ class RenderPerformanceOverlay extends RenderBox {
/// is suitable for capturing an SkPicture trace for further analysis.
int
get
rasterizerThreshold
=>
_rasterizerThreshold
;
int
_rasterizerThreshold
;
set
rasterizerThreshold
(
int
threshold
)
{
assert
(
threshold
!=
null
);
if
(
threshold
==
_rasterizerThreshold
)
set
rasterizerThreshold
(
int
value
)
{
assert
(
value
!=
null
);
if
(
value
==
_rasterizerThreshold
)
return
;
_rasterizerThreshold
=
threshold
;
_rasterizerThreshold
=
value
;
markNeedsPaint
();
}
/// Whether the raster cache should checkerboard cached entries.
bool
get
checkerboardRasterCacheImages
=>
_checkerboardRasterCacheImages
;
bool
_checkerboardRasterCacheImages
;
set
checkerboardRasterCacheImages
(
bool
checkerboard
)
{
assert
(
checkerboard
!=
null
);
if
(
checkerboard
==
_checkerboardRasterCacheImages
)
set
checkerboardRasterCacheImages
(
bool
value
)
{
assert
(
value
!=
null
);
if
(
value
==
_checkerboardRasterCacheImages
)
return
;
_checkerboardRasterCacheImages
=
checkerboard
;
_checkerboardRasterCacheImages
=
value
;
markNeedsPaint
();
}
...
...
packages/flutter/lib/src/rendering/proxy_box.dart
View file @
c22812e0
This diff is collapsed.
Click to expand it.
packages/flutter/lib/src/rendering/shifted_box.dart
View file @
c22812e0
...
...
@@ -212,11 +212,11 @@ abstract class RenderAligningShiftedBox extends RenderShiftedBox {
/// Sets the alignment to a new value, and triggers a layout update.
///
/// The new alignment must not be null or have any null properties.
set
alignment
(
FractionalOffset
newAlignment
)
{
assert
(
newAlignment
!=
null
&&
newAlignment
.
dx
!=
null
&&
newAlignment
.
dy
!=
null
);
if
(
_alignment
==
newAlignment
)
set
alignment
(
FractionalOffset
value
)
{
assert
(
value
!=
null
&&
value
.
dx
!=
null
&&
value
.
dy
!=
null
);
if
(
_alignment
==
value
)
return
;
_alignment
=
newAlignment
;
_alignment
=
value
;
markNeedsLayout
();
}
...
...
packages/flutter/lib/src/rendering/sliver_fixed_extent_list.dart
View file @
c22812e0
...
...
@@ -163,11 +163,11 @@ class RenderSliverFixedExtentList extends RenderSliverFixedExtentBoxAdaptor {
@override
double
get
itemExtent
=>
_itemExtent
;
double
_itemExtent
;
set
itemExtent
(
double
newV
alue
)
{
assert
(
newV
alue
!=
null
);
if
(
_itemExtent
==
newV
alue
)
set
itemExtent
(
double
v
alue
)
{
assert
(
v
alue
!=
null
);
if
(
_itemExtent
==
v
alue
)
return
;
_itemExtent
=
newV
alue
;
_itemExtent
=
v
alue
;
markNeedsLayout
();
}
}
...
...
@@ -186,11 +186,11 @@ class RenderSliverFill extends RenderSliverFixedExtentBoxAdaptor {
double
get
viewportFraction
=>
_viewportFraction
;
double
_viewportFraction
;
set
viewportFraction
(
double
newV
alue
)
{
assert
(
newV
alue
!=
null
);
if
(
_viewportFraction
==
newV
alue
)
set
viewportFraction
(
double
v
alue
)
{
assert
(
v
alue
!=
null
);
if
(
_viewportFraction
==
v
alue
)
return
;
_viewportFraction
=
newV
alue
;
_viewportFraction
=
v
alue
;
markNeedsLayout
();
}
...
...
packages/flutter/lib/src/rendering/sliver_grid.dart
View file @
c22812e0
...
...
@@ -426,14 +426,14 @@ class RenderSliverGrid extends RenderSliverMultiBoxAdaptor {
SliverGridDelegate
get
gridDelegate
=>
_gridDelegate
;
SliverGridDelegate
_gridDelegate
;
set
gridDelegate
(
SliverGridDelegate
newDelegat
e
)
{
assert
(
newDelegat
e
!=
null
);
if
(
_gridDelegate
==
newDelegat
e
)
set
gridDelegate
(
SliverGridDelegate
valu
e
)
{
assert
(
valu
e
!=
null
);
if
(
_gridDelegate
==
valu
e
)
return
;
if
(
newDelegat
e
.
runtimeType
!=
_gridDelegate
.
runtimeType
||
newDelegat
e
.
shouldRelayout
(
_gridDelegate
))
if
(
valu
e
.
runtimeType
!=
_gridDelegate
.
runtimeType
||
valu
e
.
shouldRelayout
(
_gridDelegate
))
markNeedsLayout
();
_gridDelegate
=
newDelegat
e
;
_gridDelegate
=
valu
e
;
}
@override
...
...
packages/flutter/lib/src/widgets/page_view.dart
View file @
c22812e0
...
...
@@ -159,11 +159,11 @@ class _PagePosition extends ScrollPosition {
double
get
viewportFraction
=>
_viewportFraction
;
double
_viewportFraction
;
set
viewportFraction
(
double
newV
alue
)
{
if
(
_viewportFraction
==
newV
alue
)
set
viewportFraction
(
double
v
alue
)
{
if
(
_viewportFraction
==
v
alue
)
return
;
final
double
oldPage
=
page
;
_viewportFraction
=
newV
alue
;
_viewportFraction
=
v
alue
;
if
(
oldPage
!=
null
)
correctPixels
(
getPixelsFromPage
(
oldPage
));
}
...
...
packages/flutter/lib/src/widgets/placeholder.dart
View file @
c22812e0
...
...
@@ -23,11 +23,11 @@ class PlaceholderState extends State<Placeholder> {
/// Mutating this field will cause this widget to rebuild with the new child.
Widget
get
child
=>
_child
;
Widget
_child
;
set
child
(
Widget
child
)
{
if
(
_child
==
child
)
set
child
(
Widget
value
)
{
if
(
_child
==
value
)
return
;
setState
(()
{
_child
=
child
;
_child
=
value
;
});
}
...
...
packages/flutter_markdown/lib/src/markdown_raw.dart
View file @
c22812e0
...
...
@@ -356,9 +356,9 @@ class _Block {
List
<
_Block
>
subBlocks
;
bool
get
open
=>
_open
;
set
open
(
bool
open
)
{
_open
=
open
;
if
(!
open
&&
subBlocks
.
isNotEmpty
)
set
open
(
bool
value
)
{
_open
=
value
;
if
(!
value
&&
subBlocks
.
isNotEmpty
)
subBlocks
.
last
.
isLast
=
true
;
}
...
...
packages/flutter_test/lib/src/binding.dart
View file @
c22812e0
...
...
@@ -202,8 +202,8 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
/// the focus change.
EditableTextState
get
focusedEditable
=>
_focusedEditable
;
EditableTextState
_focusedEditable
;
set
focusedEditable
(
EditableTextState
editabl
e
)
{
_focusedEditable
=
editabl
e
..
requestKeyboard
();
set
focusedEditable
(
EditableTextState
valu
e
)
{
_focusedEditable
=
valu
e
..
requestKeyboard
();
}
/// Returns the exception most recently caught by the Flutter framework.
...
...
packages/flutter_tools/lib/src/devfs.dart
View file @
c22812e0
...
...
@@ -113,8 +113,8 @@ class DevFSByteContent extends DevFSContent {
List
<
int
>
get
bytes
=>
_bytes
;
set
bytes
(
List
<
int
>
newBytes
)
{
_bytes
=
newBytes
;
set
bytes
(
List
<
int
>
value
)
{
_bytes
=
value
;
_isModified
=
true
;
}
...
...
@@ -145,14 +145,14 @@ class DevFSStringContent extends DevFSByteContent {
String
get
string
=>
_string
;
set
string
(
String
newString
)
{
_string
=
newString
;
set
string
(
String
value
)
{
_string
=
value
;
super
.
bytes
=
UTF8
.
encode
(
_string
);
}
@override
set
bytes
(
List
<
int
>
newBytes
)
{
string
=
UTF8
.
decode
(
newBytes
);
set
bytes
(
List
<
int
>
value
)
{
string
=
UTF8
.
decode
(
value
);
}
}
...
...
packages/flutter_tools/lib/src/runner/flutter_command.dart
View file @
c22812e0
...
...
@@ -77,8 +77,8 @@ abstract class FlutterCommand extends Command<Null> {
help:
'Build a release version of your app
${defaultToRelease ? ' (default mode)' : ''}
.'
);
}
set
defaultBuildMode
(
BuildMode
buildMod
e
)
{
_defaultBuildMode
=
buildMod
e
;
set
defaultBuildMode
(
BuildMode
valu
e
)
{
_defaultBuildMode
=
valu
e
;
}
BuildMode
getBuildMode
()
{
...
...
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