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