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
b554f893
Unverified
Commit
b554f893
authored
May 14, 2021
by
Abhishek Ghaskata
Committed by
GitHub
May 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable unnecessary_null_checks lint (#82084)
parent
f6747dfa
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
26 additions
and
23 deletions
+26
-23
analysis_options.yaml
analysis_options.yaml
+1
-1
snippets.dart
dev/snippets/lib/snippets.dart
+3
-1
form_section.dart
packages/flutter/lib/src/cupertino/form_section.dart
+2
-2
date_picker.dart
packages/flutter/lib/src/material/date_picker.dart
+1
-1
dialog.dart
packages/flutter/lib/src/material/dialog.dart
+1
-1
reorderable_list.dart
packages/flutter/lib/src/material/reorderable_list.dart
+1
-1
change_notifier_test.dart
packages/flutter/test/foundation/change_notifier_test.dart
+2
-2
restoration_test.dart
packages/flutter/test/services/restoration_test.dart
+1
-1
editable_text_test.dart
packages/flutter/test/widgets/editable_text_test.dart
+6
-6
focus_scope_test.dart
packages/flutter/test/widgets/focus_scope_test.dart
+1
-1
scroll_aware_image_provider_test.dart
...lutter/test/widgets/scroll_aware_image_provider_test.dart
+2
-2
shortcuts_test.dart
packages/flutter/test/widgets/shortcuts_test.dart
+1
-1
test_async_utils.dart
packages/flutter_test/lib/src/test_async_utils.dart
+2
-1
analysis.dart
packages/flutter_tools/lib/src/dart/analysis.dart
+1
-1
fuchsia_remote_connection.dart
...ote_debug_protocol/lib/src/fuchsia_remote_connection.dart
+1
-1
No files found.
analysis_options.yaml
View file @
b554f893
...
...
@@ -204,7 +204,7 @@ linter:
# - unnecessary_lambdas # has false positives: https://github.com/dart-lang/linter/issues/498
-
unnecessary_new
-
unnecessary_null_aware_assignments
# - unnecessary_null_checks # not yet tested
-
unnecessary_null_checks
-
unnecessary_null_in_if_null_operators
-
unnecessary_nullable_for_final_variable_declarations
-
unnecessary_overrides
...
...
dev/snippets/lib/snippets.dart
View file @
b554f893
...
...
@@ -227,7 +227,9 @@ class SnippetGenerator {
if (match != null) { // If we saw the start or end of a code block
inCodeBlock = !inCodeBlock;
if (match.namedGroup('language') != null) {
language = match[1]!;
language = match[1];
assert(language != null);
language = language!;
if (match.namedGroup('section') != null) {
components.add(_ComponentTuple('code-
${match.namedGroup('section')}
', <String>[], language: language));
} else {
...
...
packages/flutter/lib/src/cupertino/form_section.dart
View file @
b554f893
...
...
@@ -287,7 +287,7 @@ class CupertinoFormSection extends StatelessWidget {
),
child:
Padding
(
padding:
_kDefaultHeaderMargin
,
child:
header
!
,
child:
header
,
),
),
),
...
...
@@ -311,7 +311,7 @@ class CupertinoFormSection extends StatelessWidget {
),
child:
Padding
(
padding:
_kDefaultFooterMargin
,
child:
footer
!
,
child:
footer
,
),
),
),
...
...
packages/flutter/lib/src/material/date_picker.dart
View file @
b554f893
...
...
@@ -1652,7 +1652,7 @@ class _CalendarRangePickerDialog extends StatelessWidget {
if
(
orientation
==
Orientation
.
portrait
&&
entryModeButton
!=
null
)
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
8.0
),
child:
entryModeButton
!
,
child:
entryModeButton
,
),
]),
),
...
...
packages/flutter/lib/src/material/dialog.dart
View file @
b554f893
...
...
@@ -528,7 +528,7 @@ class AlertDialog extends StatelessWidget {
style:
contentTextStyle
??
dialogTheme
.
contentTextStyle
??
theme
.
textTheme
.
subtitle1
!,
child:
Semantics
(
container:
true
,
child:
content
!
,
child:
content
,
),
),
);
...
...
packages/flutter/lib/src/material/reorderable_list.dart
View file @
b554f893
...
...
@@ -557,7 +557,7 @@ class _ReorderableListViewState extends State<ReorderableListView> {
if
(
widget
.
header
!=
null
)
SliverPadding
(
padding:
headerPadding
,
sliver:
SliverToBoxAdapter
(
child:
widget
.
header
!
),
sliver:
SliverToBoxAdapter
(
child:
widget
.
header
),
),
SliverPadding
(
padding:
listPadding
,
...
...
packages/flutter/test/foundation/change_notifier_test.dart
View file @
b554f893
...
...
@@ -454,9 +454,9 @@ void main() {
error
=
e
;
}
expect
(
error
,
isNotNull
);
expect
(
error
!
,
isFlutterError
);
expect
(
error
,
isFlutterError
);
expect
(
error
.
toStringDeep
(),
error
!
.
toStringDeep
(),
equalsIgnoringHashCodes
(
'FlutterError
\n
'
' A TestNotifier was used after being disposed.
\n
'
...
...
packages/flutter/test/services/restoration_test.dart
View file @
b554f893
...
...
@@ -257,7 +257,7 @@ void main() {
rootBucket2
=
bucket
;
});
expect
(
rootBucket2
,
isNotNull
);
expect
(
rootBucket2
!
,
isNot
(
same
(
rootBucket
)));
expect
(
rootBucket2
,
isNot
(
same
(
rootBucket
)));
expect
(
manager
.
isReplacing
,
isTrue
);
expect
(
rootBucket2
!.
isReplacing
,
isTrue
);
await
tester
.
idle
();
...
...
packages/flutter/test/widgets/editable_text_test.dart
View file @
b554f893
...
...
@@ -4861,7 +4861,7 @@ void main() {
);
expect
(
selection
!
,
selection
,
equals
(
const
TextSelection
(
baseOffset:
0
,
...
...
@@ -4884,7 +4884,7 @@ void main() {
);
expect
(
selection
!
,
selection
,
equals
(
const
TextSelection
(
baseOffset:
0
,
...
...
@@ -4912,7 +4912,7 @@ void main() {
);
expect
(
selection
!
,
selection
,
equals
(
const
TextSelection
(
baseOffset:
0
,
...
...
@@ -4938,7 +4938,7 @@ void main() {
platform:
platform
,
);
expect
(
selection
!
,
selection
,
equals
(
const
TextSelection
(
baseOffset:
0
,
...
...
@@ -4959,7 +4959,7 @@ void main() {
platform:
platform
,
);
expect
(
selection
!
,
selection
,
equals
(
const
TextSelection
(
baseOffset:
0
,
...
...
@@ -7715,7 +7715,7 @@ class NoImplicitScrollPhysics extends AlwaysScrollableScrollPhysics {
@override
NoImplicitScrollPhysics
applyTo
(
ScrollPhysics
?
ancestor
)
{
return
NoImplicitScrollPhysics
(
parent:
buildParent
(
ancestor
)
!
);
return
NoImplicitScrollPhysics
(
parent:
buildParent
(
ancestor
));
}
}
...
...
packages/flutter/test/widgets/focus_scope_test.dart
View file @
b554f893
...
...
@@ -263,7 +263,7 @@ void main() {
);
// Add the child focus scope to the focus tree.
final
FocusAttachment
childAttachment
=
childFocusScope
.
attach
(
key
.
currentContext
!
);
final
FocusAttachment
childAttachment
=
childFocusScope
.
attach
(
key
.
currentContext
);
parentFocusScope
.
setFirstFocus
(
childFocusScope
);
await
tester
.
pumpAndSettle
();
expect
(
childFocusScope
.
isFirstFocus
,
isTrue
);
...
...
packages/flutter/test/widgets/scroll_aware_image_provider_test.dart
View file @
b554f893
...
...
@@ -417,7 +417,7 @@ class RecordingPhysics extends ScrollPhysics {
@override
RecordingPhysics
applyTo
(
ScrollPhysics
?
ancestor
)
{
return
RecordingPhysics
(
parent:
buildParent
(
ancestor
)
!
);
return
RecordingPhysics
(
parent:
buildParent
(
ancestor
));
}
@override
...
...
@@ -437,7 +437,7 @@ class ControllablePhysics extends ScrollPhysics {
@override
ControllablePhysics
applyTo
(
ScrollPhysics
?
ancestor
)
{
return
ControllablePhysics
(
parent:
buildParent
(
ancestor
)
!
);
return
ControllablePhysics
(
parent:
buildParent
(
ancestor
));
}
@override
...
...
packages/flutter/test/widgets/shortcuts_test.dart
View file @
b554f893
...
...
@@ -26,7 +26,7 @@ class TestDispatcher extends ActionDispatcher {
@override
Object
?
invokeAction
(
Action
<
TestIntent
>
action
,
Intent
intent
,
[
BuildContext
?
context
])
{
final
Object
?
result
=
super
.
invokeAction
(
action
,
intent
,
context
);
postInvoke
?.
call
(
action:
action
,
intent:
intent
,
context:
context
!
,
dispatcher:
this
);
postInvoke
?.
call
(
action:
action
,
intent:
intent
,
context:
context
,
dispatcher:
this
);
return
result
;
}
}
...
...
packages/flutter_test/lib/src/test_async_utils.dart
View file @
b554f893
...
...
@@ -307,8 +307,9 @@ class TestAsyncUtils {
do
{
// skip past frames that are from this class
index
+=
1
;
assert
(
index
<
stack
.
length
);
lineMatch
=
getClassPattern
.
matchAsPrefix
(
stack
[
index
])
!
;
lineMatch
=
getClassPattern
.
matchAsPrefix
(
stack
[
index
]);
assert
(
lineMatch
!=
null
);
lineMatch
=
lineMatch
!;
assert
(
lineMatch
.
groupCount
==
1
);
}
while
(
lineMatch
.
group
(
1
)
==
_className
);
// try to parse the stack to find the interesting frame
...
...
packages/flutter_tools/lib/src/dart/analysis.dart
View file @
b554f893
...
...
@@ -137,7 +137,7 @@ class AnalysisServer {
}
}
else
if
(
response
[
'error'
]
!=
null
)
{
// Fields are 'code', 'message', and 'stackTrace'.
final
Map
<
String
,
dynamic
>
error
=
castStringKeyedMap
(
response
[
'error'
]
!
)!;
final
Map
<
String
,
dynamic
>
error
=
castStringKeyedMap
(
response
[
'error'
])!;
_logger
.
printError
(
'Error response from the server:
${error['code']}
${error['message']}
'
);
if
(
error
[
'stackTrace'
]
!=
null
)
{
...
...
packages/fuchsia_remote_debug_protocol/lib/src/fuchsia_remote_connection.dart
View file @
b554f893
...
...
@@ -210,7 +210,7 @@ class FuchsiaRemoteConnection {
SshCommandRunner
(
address:
address
,
interface
:
interface
,
sshConfigPath:
sshConfigPath
!
,
sshConfigPath:
sshConfigPath
,
),
);
}
...
...
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