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
69e23538
Commit
69e23538
authored
Jun 05, 2017
by
Alexandre Ardhuin
Committed by
GitHub
Jun 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apply prefer_asserts_in_initializer_list lint (#10482)
parent
abb76697
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
42 additions
and
43 deletions
+42
-43
serialization.dart
packages/flutter/lib/src/foundation/serialization.dart
+2
-3
material.dart
packages/flutter/lib/src/material/material.dart
+6
-3
box_painter.dart
packages/flutter/lib/src/painting/box_painter.dart
+3
-3
flutter_logo.dart
packages/flutter/lib/src/painting/flutter_logo.dart
+4
-3
text_painter.dart
packages/flutter/lib/src/painting/text_painter.dart
+7
-4
clamped_simulation.dart
packages/flutter/lib/src/physics/clamped_simulation.dart
+3
-5
friction_simulation.dart
packages/flutter/lib/src/physics/friction_simulation.dart
+2
-3
gravity_simulation.dart
packages/flutter/lib/src/physics/gravity_simulation.dart
+7
-8
image_stream.dart
packages/flutter/lib/src/services/image_stream.dart
+2
-2
message_codec.dart
packages/flutter/lib/src/services/message_codec.dart
+3
-6
text_input.dart
packages/flutter/lib/src/services/text_input.dart
+3
-3
No files found.
packages/flutter/lib/src/foundation/serialization.dart
View file @
69e23538
...
...
@@ -103,9 +103,8 @@ class WriteBuffer {
/// The byte order used is [Endianness.HOST_ENDIAN] throughout.
class
ReadBuffer
{
/// Creates a [ReadBuffer] for reading from the specified [data].
ReadBuffer
(
this
.
data
)
{
assert
(
data
!=
null
);
}
ReadBuffer
(
this
.
data
)
:
assert
(
data
!=
null
);
/// The underlying data being read.
final
ByteData
data
;
...
...
packages/flutter/lib/src/material/material.dart
View file @
69e23538
...
...
@@ -275,9 +275,12 @@ class _MaterialState extends State<Material> with TickerProviderStateMixin {
const
Duration
_kHighlightFadeDuration
=
const
Duration
(
milliseconds:
200
);
class
_RenderInkFeatures
extends
RenderProxyBox
implements
MaterialInkController
{
_RenderInkFeatures
({
RenderBox
child
,
@required
this
.
vsync
,
this
.
color
})
:
super
(
child
)
{
assert
(
vsync
!=
null
);
}
_RenderInkFeatures
({
RenderBox
child
,
@required
this
.
vsync
,
this
.
color
,
})
:
assert
(
vsync
!=
null
),
super
(
child
);
// This class should exist in a 1:1 relationship with a MaterialState object,
// since there's no current support for dynamically changing the ticker
...
...
packages/flutter/lib/src/painting/box_painter.dart
View file @
69e23538
...
...
@@ -1659,9 +1659,9 @@ class BoxDecoration extends Decoration {
/// An object that paints a [BoxDecoration] into a canvas.
class
_BoxDecorationPainter
extends
BoxPainter
{
_BoxDecorationPainter
(
@required
this
.
_decoration
,
VoidCallback
onChange
)
:
super
(
onChange
)
{
assert
(
_decoration
!=
null
);
}
_BoxDecorationPainter
(
@required
this
.
_decoration
,
VoidCallback
onChange
)
:
assert
(
_decoration
!=
null
),
super
(
onChange
);
final
BoxDecoration
_decoration
;
...
...
packages/flutter/lib/src/painting/flutter_logo.dart
View file @
69e23538
...
...
@@ -219,9 +219,10 @@ class FlutterLogoDecoration extends Decoration {
/// An object that paints a [BoxDecoration] into a canvas.
class
_FlutterLogoPainter
extends
BoxPainter
{
_FlutterLogoPainter
(
this
.
_config
)
:
super
(
null
)
{
assert
(
_config
!=
null
);
assert
(
_config
.
debugAssertIsValid
());
_FlutterLogoPainter
(
this
.
_config
)
:
assert
(
_config
!=
null
),
assert
(
_config
.
debugAssertIsValid
()),
super
(
null
)
{
_prepareText
();
}
...
...
packages/flutter/lib/src/painting/text_painter.dart
View file @
69e23538
...
...
@@ -41,10 +41,13 @@ class TextPainter {
double
textScaleFactor:
1.0
,
int
maxLines
,
String
ellipsis
,
})
:
_text
=
text
,
_textAlign
=
textAlign
,
_textScaleFactor
=
textScaleFactor
,
_maxLines
=
maxLines
,
_ellipsis
=
ellipsis
{
assert
(
text
==
null
||
text
.
debugAssertIsValid
());
assert
(
textScaleFactor
!=
null
);
}
})
:
assert
(
text
==
null
||
text
.
debugAssertIsValid
()),
assert
(
textScaleFactor
!=
null
),
_text
=
text
,
_textAlign
=
textAlign
,
_textScaleFactor
=
textScaleFactor
,
_maxLines
=
maxLines
,
_ellipsis
=
ellipsis
;
ui
.
Paragraph
_paragraph
;
bool
_needsLayout
=
true
;
...
...
packages/flutter/lib/src/physics/clamped_simulation.dart
View file @
69e23538
...
...
@@ -26,11 +26,9 @@ class ClampedSimulation extends Simulation {
this
.
xMax
:
double
.
INFINITY
,
this
.
dxMin
:
double
.
NEGATIVE_INFINITY
,
this
.
dxMax
:
double
.
INFINITY
})
{
assert
(
simulation
!=
null
);
assert
(
xMax
>=
xMin
);
assert
(
dxMax
>=
dxMin
);
}
})
:
assert
(
simulation
!=
null
),
assert
(
xMax
>=
xMin
),
assert
(
dxMax
>=
dxMin
);
/// The simulation being clamped. Calls to [x], [dx], and [isDone] are
/// forwarded to the simulation.
...
...
packages/flutter/lib/src/physics/friction_simulation.dart
View file @
69e23538
...
...
@@ -105,9 +105,8 @@ class BoundedFrictionSimulation extends FrictionSimulation {
double
velocity
,
this
.
_minX
,
this
.
_maxX
)
:
super
(
drag
,
position
,
velocity
)
{
assert
(
position
.
clamp
(
_minX
,
_maxX
)
==
position
);
}
)
:
assert
(
position
.
clamp
(
_minX
,
_maxX
)
==
position
),
super
(
drag
,
position
,
velocity
);
final
double
_minX
;
final
double
_maxX
;
...
...
packages/flutter/lib/src/physics/gravity_simulation.dart
View file @
69e23538
...
...
@@ -28,16 +28,15 @@ class GravitySimulation extends Simulation {
double
distance
,
double
endDistance
,
double
velocity
)
:
_a
=
acceleration
,
)
:
assert
(
acceleration
!=
null
),
assert
(
distance
!=
null
),
assert
(
velocity
!=
null
),
assert
(
endDistance
!=
null
),
assert
(
endDistance
>=
0
),
_a
=
acceleration
,
_x
=
distance
,
_v
=
velocity
,
_end
=
endDistance
{
assert
(
acceleration
!=
null
);
assert
(
distance
!=
null
);
assert
(
velocity
!=
null
);
assert
(
endDistance
!=
null
);
assert
(
endDistance
>=
0
);
}
_end
=
endDistance
;
final
double
_x
;
final
double
_v
;
...
...
packages/flutter/lib/src/services/image_stream.dart
View file @
69e23538
...
...
@@ -237,8 +237,8 @@ class OneFrameImageStreamCompleter extends ImageStreamCompleter {
/// argument on [FlutterErrorDetails] set to true, meaning that by default the
/// message is only dumped to the console in debug mode (see [new
/// FlutterErrorDetails]).
OneFrameImageStreamCompleter
(
Future
<
ImageInfo
>
image
,
{
InformationCollector
informationCollector
})
{
assert
(
image
!=
null
);
OneFrameImageStreamCompleter
(
Future
<
ImageInfo
>
image
,
{
InformationCollector
informationCollector
})
:
assert
(
image
!=
null
)
{
image
.
then
<
Null
>(
setImage
,
onError:
(
dynamic
error
,
StackTrace
stack
)
{
FlutterError
.
reportError
(
new
FlutterErrorDetails
(
exception:
error
,
...
...
packages/flutter/lib/src/services/message_codec.dart
View file @
69e23538
...
...
@@ -35,9 +35,8 @@ abstract class MessageCodec<T> {
class
MethodCall
{
/// Creates a [MethodCall] representing the invocation of [method] with the
/// specified [arguments].
MethodCall
(
this
.
method
,
[
this
.
arguments
])
{
assert
(
method
!=
null
);
}
MethodCall
(
this
.
method
,
[
this
.
arguments
])
:
assert
(
method
!=
null
);
/// The name of the method to be called.
final
String
method
;
...
...
@@ -148,9 +147,7 @@ class PlatformException implements Exception {
@required
this
.
code
,
this
.
message
,
this
.
details
,
})
{
assert
(
code
!=
null
);
}
})
:
assert
(
code
!=
null
);
/// An error code.
final
String
code
;
...
...
packages/flutter/lib/src/services/text_input.dart
View file @
69e23538
...
...
@@ -224,9 +224,9 @@ abstract class TextInputClient {
///
/// * [TextInput.attach]
class
TextInputConnection
{
TextInputConnection
.
_
(
this
.
_client
)
:
_id
=
_nextId
++
{
assert
(
_client
!=
null
);
}
TextInputConnection
.
_
(
this
.
_client
)
:
assert
(
_client
!=
null
),
_id
=
_nextId
++;
static
int
_nextId
=
1
;
final
int
_id
;
...
...
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