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
0b2fb132
Commit
0b2fb132
authored
May 10, 2017
by
Chris Bracken
Committed by
GitHub
May 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add const non-null asserts where required (#9939)
Also fixes a small typo.
parent
4109e282
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
37 additions
and
15 deletions
+37
-15
drag_details.dart
packages/flutter/lib/src/gestures/drag_details.dart
+1
-0
velocity_tracker.dart
packages/flutter/lib/src/gestures/velocity_tracker.dart
+10
-3
data_table.dart
packages/flutter/lib/src/material/data_table.dart
+5
-4
icon_button.dart
packages/flutter/lib/src/material/icon_button.dart
+5
-1
list_tile.dart
packages/flutter/lib/src/material/list_tile.dart
+1
-0
mergeable_material.dart
packages/flutter/lib/src/material/mergeable_material.dart
+1
-1
tab_controller.dart
packages/flutter/lib/src/material/tab_controller.dart
+2
-1
box_painter.dart
packages/flutter/lib/src/painting/box_painter.dart
+6
-3
colors.dart
packages/flutter/lib/src/painting/colors.dart
+5
-1
text_style.dart
packages/flutter/lib/src/painting/text_style.dart
+1
-1
No files found.
packages/flutter/lib/src/gestures/drag_details.dart
View file @
0b2fb132
...
@@ -100,6 +100,7 @@ class DragUpdateDetails {
...
@@ -100,6 +100,7 @@ class DragUpdateDetails {
this
.
primaryDelta
,
this
.
primaryDelta
,
@required
this
.
globalPosition
@required
this
.
globalPosition
})
{
})
{
assert
(
delta
!=
null
);
assert
(
primaryDelta
==
null
assert
(
primaryDelta
==
null
||
(
primaryDelta
==
delta
.
dx
&&
delta
.
dy
==
0.0
)
||
(
primaryDelta
==
delta
.
dx
&&
delta
.
dy
==
0.0
)
||
(
primaryDelta
==
delta
.
dy
&&
delta
.
dx
==
0.0
));
||
(
primaryDelta
==
delta
.
dy
&&
delta
.
dx
==
0.0
));
...
...
packages/flutter/lib/src/gestures/velocity_tracker.dart
View file @
0b2fb132
...
@@ -13,7 +13,7 @@ class Velocity {
...
@@ -13,7 +13,7 @@ class Velocity {
/// Creates a velocity.
/// Creates a velocity.
///
///
/// The [pixelsPerSecond] argument must not be null.
/// The [pixelsPerSecond] argument must not be null.
const
Velocity
({
this
.
pixelsPerSecond
});
const
Velocity
({
this
.
pixelsPerSecond
})
:
assert
(
pixelsPerSecond
!=
null
)
;
/// A velocity that isn't moving at all.
/// A velocity that isn't moving at all.
static
const
Velocity
zero
=
const
Velocity
(
pixelsPerSecond:
Offset
.
zero
);
static
const
Velocity
zero
=
const
Velocity
(
pixelsPerSecond:
Offset
.
zero
);
...
@@ -87,12 +87,17 @@ class Velocity {
...
@@ -87,12 +87,17 @@ class Velocity {
/// useful velocity operations.
/// useful velocity operations.
class
VelocityEstimate
{
class
VelocityEstimate
{
/// Creates a dimensional velocity estimate.
/// Creates a dimensional velocity estimate.
///
/// [pixelsPerSecond], [confidence], [duration], and [offset] must not be null.
const
VelocityEstimate
({
const
VelocityEstimate
({
this
.
pixelsPerSecond
,
this
.
pixelsPerSecond
,
this
.
confidence
,
this
.
confidence
,
this
.
duration
,
this
.
duration
,
this
.
offset
,
this
.
offset
,
});
})
:
assert
(
pixelsPerSecond
!=
null
),
assert
(
confidence
!=
null
),
assert
(
duration
!=
null
),
assert
(
offset
!=
null
);
/// The number of pixels per second of velocity in the x and y directions.
/// The number of pixels per second of velocity in the x and y directions.
final
Offset
pixelsPerSecond
;
final
Offset
pixelsPerSecond
;
...
@@ -116,7 +121,9 @@ class VelocityEstimate {
...
@@ -116,7 +121,9 @@ class VelocityEstimate {
}
}
class
_PointAtTime
{
class
_PointAtTime
{
const
_PointAtTime
(
this
.
point
,
this
.
time
);
const
_PointAtTime
(
this
.
point
,
this
.
time
)
:
assert
(
point
!=
null
),
assert
(
time
!=
null
);
final
Duration
time
;
final
Duration
time
;
final
Offset
point
;
final
Offset
point
;
...
...
packages/flutter/lib/src/material/data_table.dart
View file @
0b2fb132
...
@@ -40,7 +40,7 @@ class DataColumn {
...
@@ -40,7 +40,7 @@ class DataColumn {
this
.
tooltip
,
this
.
tooltip
,
this
.
numeric
:
false
,
this
.
numeric
:
false
,
this
.
onSort
this
.
onSort
});
})
:
assert
(
label
!=
null
)
;
/// The column heading.
/// The column heading.
///
///
...
@@ -92,7 +92,7 @@ class DataRow {
...
@@ -92,7 +92,7 @@ class DataRow {
this
.
selected
:
false
,
this
.
selected
:
false
,
this
.
onSelectChanged
,
this
.
onSelectChanged
,
this
.
cells
this
.
cells
});
})
:
assert
(
cells
!=
null
)
;
/// Creates the configuration for a row of a [DataTable], deriving
/// Creates the configuration for a row of a [DataTable], deriving
/// the key from a row index.
/// the key from a row index.
...
@@ -103,7 +103,8 @@ class DataRow {
...
@@ -103,7 +103,8 @@ class DataRow {
this
.
selected
:
false
,
this
.
selected
:
false
,
this
.
onSelectChanged
,
this
.
onSelectChanged
,
this
.
cells
this
.
cells
})
:
key
=
new
ValueKey
<
int
>(
index
);
})
:
assert
(
cells
!=
null
),
key
=
new
ValueKey
<
int
>(
index
);
/// A [Key] that uniquely identifies this row. This is used to
/// A [Key] that uniquely identifies this row. This is used to
/// ensure that if a row is added or removed, any stateful widgets
/// ensure that if a row is added or removed, any stateful widgets
...
@@ -167,7 +168,7 @@ class DataCell {
...
@@ -167,7 +168,7 @@ class DataCell {
this
.
placeholder
:
false
,
this
.
placeholder
:
false
,
this
.
showEditIcon
:
false
,
this
.
showEditIcon
:
false
,
this
.
onTap
,
this
.
onTap
,
});
})
:
assert
(
child
!=
null
)
;
/// A cell that has no content and has zero width and height.
/// A cell that has no content and has zero width and height.
static
final
DataCell
empty
=
new
DataCell
(
new
Container
(
width:
0.0
,
height:
0.0
));
static
final
DataCell
empty
=
new
DataCell
(
new
Container
(
width:
0.0
,
height:
0.0
));
...
...
packages/flutter/lib/src/material/icon_button.dart
View file @
0b2fb132
...
@@ -69,7 +69,11 @@ class IconButton extends StatelessWidget {
...
@@ -69,7 +69,11 @@ class IconButton extends StatelessWidget {
this
.
disabledColor
,
this
.
disabledColor
,
@required
this
.
onPressed
,
@required
this
.
onPressed
,
this
.
tooltip
this
.
tooltip
})
:
super
(
key:
key
);
})
:
assert
(
iconSize
!=
null
),
assert
(
padding
!=
null
),
assert
(
alignment
!=
null
),
assert
(
icon
!=
null
),
super
(
key:
key
);
/// The size of the icon inside the button.
/// The size of the icon inside the button.
///
///
...
...
packages/flutter/lib/src/material/list_tile.dart
View file @
0b2fb132
...
@@ -137,6 +137,7 @@ class ListTile extends StatelessWidget {
...
@@ -137,6 +137,7 @@ class ListTile extends StatelessWidget {
})
:
assert
(
isThreeLine
!=
null
),
})
:
assert
(
isThreeLine
!=
null
),
assert
(
enabled
!=
null
),
assert
(
enabled
!=
null
),
assert
(
selected
!=
null
),
assert
(
selected
!=
null
),
assert
(!
isThreeLine
||
subtitle
!=
null
),
super
(
key:
key
);
super
(
key:
key
);
/// A widget to display before the title.
/// A widget to display before the title.
...
...
packages/flutter/lib/src/material/mergeable_material.dart
View file @
0b2fb132
...
@@ -17,7 +17,7 @@ abstract class MergeableMaterialItem {
...
@@ -17,7 +17,7 @@ abstract class MergeableMaterialItem {
/// const constructors so that they can be used in const expressions.
/// const constructors so that they can be used in const expressions.
///
///
/// The argument is the [key], which must not be null.
/// The argument is the [key], which must not be null.
const
MergeableMaterialItem
(
this
.
key
);
const
MergeableMaterialItem
(
this
.
key
)
:
assert
(
key
!=
null
)
;
/// The key for this item of the list.
/// The key for this item of the list.
///
///
...
...
packages/flutter/lib/src/material/tab_controller.dart
View file @
0b2fb132
...
@@ -232,7 +232,8 @@ class DefaultTabController extends StatefulWidget {
...
@@ -232,7 +232,8 @@ class DefaultTabController extends StatefulWidget {
@required
this
.
length
,
@required
this
.
length
,
this
.
initialIndex
:
0
,
this
.
initialIndex
:
0
,
@required
this
.
child
,
@required
this
.
child
,
})
:
super
(
key:
key
);
})
:
assert
(
initialIndex
!=
null
),
super
(
key:
key
);
/// The total number of tabs. Must be greater than one.
/// The total number of tabs. Must be greater than one.
final
int
length
;
final
int
length
;
...
...
packages/flutter/lib/src/painting/box_painter.dart
View file @
0b2fb132
...
@@ -993,7 +993,7 @@ class LinearGradient extends Gradient {
...
@@ -993,7 +993,7 @@ class LinearGradient extends Gradient {
/// * [CustomPainter], which shows how to use the above sample code in a custom
/// * [CustomPainter], which shows how to use the above sample code in a custom
/// painter.
/// painter.
class
RadialGradient
extends
Gradient
{
class
RadialGradient
extends
Gradient
{
/// Creates a radial gra
id
ent.
/// Creates a radial gra
di
ent.
///
///
/// The [colors] argument must not be null. If [stops] is non-null, it must
/// The [colors] argument must not be null. If [stops] is non-null, it must
/// have the same length as [colors].
/// have the same length as [colors].
...
@@ -1003,7 +1003,10 @@ class RadialGradient extends Gradient {
...
@@ -1003,7 +1003,10 @@ class RadialGradient extends Gradient {
this
.
colors
,
this
.
colors
,
this
.
stops
,
this
.
stops
,
this
.
tileMode
:
TileMode
.
clamp
,
this
.
tileMode
:
TileMode
.
clamp
,
});
})
:
assert
(
center
!=
null
),
assert
(
radius
!=
null
),
assert
(
colors
!=
null
),
assert
(
tileMode
!=
null
);
/// The center of the gradient, as an offset into the unit square
/// The center of the gradient, as an offset into the unit square
/// describing the gradient which will be mapped onto the paint box.
/// describing the gradient which will be mapped onto the paint box.
...
@@ -1265,7 +1268,7 @@ class DecorationImage {
...
@@ -1265,7 +1268,7 @@ class DecorationImage {
this
.
centerSlice
,
this
.
centerSlice
,
this
.
colorFilter
,
this
.
colorFilter
,
this
.
alignment
,
this
.
alignment
,
});
})
:
assert
(
image
!=
null
)
;
/// The image to be painted into the decoration.
/// The image to be painted into the decoration.
final
ImageProvider
image
;
final
ImageProvider
image
;
...
...
packages/flutter/lib/src/painting/colors.dart
View file @
0b2fb132
...
@@ -17,7 +17,11 @@ class HSVColor {
...
@@ -17,7 +17,11 @@ class HSVColor {
///
///
/// All the arguments must not be null and be in their respective ranges. See
/// All the arguments must not be null and be in their respective ranges. See
/// the fields for each parameter for a description of their ranges.
/// the fields for each parameter for a description of their ranges.
const
HSVColor
.
fromAHSV
(
this
.
alpha
,
this
.
hue
,
this
.
saturation
,
this
.
value
);
const
HSVColor
.
fromAHSV
(
this
.
alpha
,
this
.
hue
,
this
.
saturation
,
this
.
value
)
:
assert
(
alpha
!=
null
),
assert
(
hue
!=
null
),
assert
(
saturation
!=
null
),
assert
(
value
!=
null
);
/// Alpha, from 0.0 to 1.0.
/// Alpha, from 0.0 to 1.0.
final
double
alpha
;
final
double
alpha
;
...
...
packages/flutter/lib/src/painting/text_style.dart
View file @
0b2fb132
...
@@ -26,7 +26,7 @@ class TextStyle {
...
@@ -26,7 +26,7 @@ class TextStyle {
this
.
decoration
,
this
.
decoration
,
this
.
decorationColor
,
this
.
decorationColor
,
this
.
decorationStyle
this
.
decorationStyle
});
})
:
assert
(
inherit
!=
null
)
;
/// Whether null values are replaced with their value in an ancestor text style (e.g., in a [TextSpan] tree).
/// Whether null values are replaced with their value in an ancestor text style (e.g., in a [TextSpan] tree).
final
bool
inherit
;
final
bool
inherit
;
...
...
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