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
304e2c57
Unverified
Commit
304e2c57
authored
Oct 05, 2020
by
Alexandre Ardhuin
Committed by
GitHub
Oct 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix nullability issues (#67306)
parent
c14ab91f
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
64 additions
and
102 deletions
+64
-102
animations.dart
packages/flutter/lib/src/animation/animations.dart
+2
-2
picker.dart
packages/flutter/lib/src/cupertino/picker.dart
+2
-2
tab_view.dart
packages/flutter/lib/src/cupertino/tab_view.dart
+1
-1
paragraph.dart
packages/flutter/lib/src/rendering/paragraph.dart
+11
-17
proxy_box.dart
packages/flutter/lib/src/rendering/proxy_box.dart
+1
-2
table.dart
packages/flutter/lib/src/rendering/table.dart
+1
-2
semantics.dart
packages/flutter/lib/src/semantics/semantics.dart
+18
-32
text_input.dart
packages/flutter/lib/src/services/text_input.dart
+2
-2
container.dart
packages/flutter/lib/src/widgets/container.dart
+1
-6
focus_scope.dart
packages/flutter/lib/src/widgets/focus_scope.dart
+2
-6
layout_builder.dart
packages/flutter/lib/src/widgets/layout_builder.dart
+15
-17
navigator.dart
packages/flutter/lib/src/widgets/navigator.dart
+3
-3
nested_scroll_view.dart
packages/flutter/lib/src/widgets/nested_scroll_view.dart
+1
-4
sliver.dart
packages/flutter/lib/src/widgets/sliver.dart
+1
-1
widget_inspector.dart
packages/flutter/lib/src/widgets/widget_inspector.dart
+3
-5
No files found.
packages/flutter/lib/src/animation/animations.dart
View file @
304e2c57
...
...
@@ -495,7 +495,7 @@ class TrainHoppingAnimation extends Animation<double>
:
assert
(
_currentTrain
!=
null
)
{
if
(
_nextTrain
!=
null
)
{
if
(
_currentTrain
!.
value
==
_nextTrain
!.
value
)
{
_currentTrain
=
_nextTrain
!
;
_currentTrain
=
_nextTrain
;
_nextTrain
=
null
;
}
else
if
(
_currentTrain
!.
value
>
_nextTrain
!.
value
)
{
_mode
=
_TrainHoppingMode
.
maximize
;
...
...
@@ -557,7 +557,7 @@ class TrainHoppingAnimation extends Animation<double>
_currentTrain
!
..
removeStatusListener
(
_statusChangeHandler
)
..
removeListener
(
_valueChangeHandler
);
_currentTrain
=
_nextTrain
!
;
_currentTrain
=
_nextTrain
;
_nextTrain
=
null
;
_currentTrain
!.
addStatusListener
(
_statusChangeHandler
);
_statusChangeHandler
(
_currentTrain
!.
status
);
...
...
packages/flutter/lib/src/cupertino/picker.dart
View file @
304e2c57
...
...
@@ -186,7 +186,7 @@ class CupertinoPicker extends StatefulWidget {
/// This can be called during scrolls and during ballistic flings. To get the
/// value only when the scrolling settles, use a [NotificationListener],
/// listen for [ScrollEndNotification] and read its [FixedExtentMetrics].
final
ValueChanged
<
int
>
onSelectedItemChanged
;
final
ValueChanged
<
int
>
?
onSelectedItemChanged
;
/// A delegate that lazily instantiates children.
final
ListWheelChildDelegate
childDelegate
;
...
...
@@ -247,7 +247,7 @@ class _CupertinoPickerState extends State<CupertinoPicker> {
}
if
(
widget
.
onSelectedItemChanged
!=
null
)
{
widget
.
onSelectedItemChanged
(
index
);
widget
.
onSelectedItemChanged
!
(
index
);
}
}
...
...
packages/flutter/lib/src/cupertino/tab_view.dart
View file @
304e2c57
...
...
@@ -172,7 +172,7 @@ class _CupertinoTabViewState extends State<CupertinoTabView> {
WidgetBuilder
?
routeBuilder
;
String
?
title
;
if
(
name
==
Navigator
.
defaultRouteName
&&
widget
.
builder
!=
null
)
{
routeBuilder
=
widget
.
builder
!
;
routeBuilder
=
widget
.
builder
;
title
=
widget
.
defaultTitle
;
}
else
if
(
widget
.
routes
!=
null
)
{
routeBuilder
=
widget
.
routes
![
name
];
...
...
packages/flutter/lib/src/rendering/paragraph.dart
View file @
304e2c57
...
...
@@ -46,7 +46,7 @@ class TextParentData extends ContainerBoxParentData<RenderBox> {
@override
String
toString
()
{
final
List
<
String
>
values
=
<
String
>[
if
(
offset
!=
null
)
'offset=
$offset
'
,
'offset=
$offset
'
,
if
(
scale
!=
null
)
'scale=
$scale
'
,
super
.
toString
(),
];
...
...
@@ -819,14 +819,12 @@ class RenderParagraph extends RenderBox
String
?
workingLabel
;
for
(
final
InlineSpanSemanticsInformation
info
in
_semanticsInfo
!)
{
if
(
info
.
requiresOwnNode
)
{
if
(
workingText
!=
null
)
{
combined
.
add
(
InlineSpanSemanticsInformation
(
workingText
,
semanticsLabel:
workingLabel
??
workingText
,
));
workingText
=
''
;
workingLabel
=
null
;
}
combined
.
add
(
InlineSpanSemanticsInformation
(
workingText
,
semanticsLabel:
workingLabel
??
workingText
,
));
workingText
=
''
;
workingLabel
=
null
;
combined
.
add
(
info
);
}
else
{
workingText
+=
info
.
text
;
...
...
@@ -838,14 +836,10 @@ class RenderParagraph extends RenderBox
}
}
}
if
(
workingText
!=
null
)
{
combined
.
add
(
InlineSpanSemanticsInformation
(
workingText
,
semanticsLabel:
workingLabel
,
));
}
else
{
// ignore: dead_code
assert
(
workingLabel
!=
null
);
}
combined
.
add
(
InlineSpanSemanticsInformation
(
workingText
,
semanticsLabel:
workingLabel
,
));
return
combined
;
}
...
...
packages/flutter/lib/src/rendering/proxy_box.dart
View file @
304e2c57
...
...
@@ -4481,8 +4481,7 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
void
describeSemanticsConfiguration
(
SemanticsConfiguration
config
)
{
super
.
describeSemanticsConfiguration
(
config
);
config
.
isSemanticBoundary
=
container
;
if
(
explicitChildNodes
!=
null
)
config
.
explicitChildNodes
=
explicitChildNodes
;
config
.
explicitChildNodes
=
explicitChildNodes
;
assert
((
scopesRoute
==
true
&&
explicitChildNodes
==
true
)
||
scopesRoute
!=
true
,
'explicitChildNodes must be set to true if scopes route is true'
);
assert
(!(
toggled
==
true
&&
checked
==
true
),
...
...
packages/flutter/lib/src/rendering/table.dart
View file @
304e2c57
...
...
@@ -1085,8 +1085,7 @@ class RenderTable extends RenderBox {
final
TableCellParentData
childParentData
=
child
.
parentData
!
as
TableCellParentData
;
switch
(
childParentData
.
verticalAlignment
??
defaultVerticalAlignment
)
{
case
TableCellVerticalAlignment
.
baseline
:
if
(
baselines
[
x
]
!=
null
)
childParentData
.
offset
=
Offset
(
positions
[
x
],
rowTop
+
beforeBaselineDistance
-
baselines
[
x
]);
childParentData
.
offset
=
Offset
(
positions
[
x
],
rowTop
+
beforeBaselineDistance
-
baselines
[
x
]);
break
;
case
TableCellVerticalAlignment
.
top
:
childParentData
.
offset
=
Offset
(
positions
[
x
],
rowTop
);
...
...
packages/flutter/lib/src/semantics/semantics.dart
View file @
304e2c57
...
...
@@ -510,15 +510,7 @@ class _SemanticsDiagnosticableNode extends DiagnosticableNode<SemanticsNode> {
final
DebugSemanticsDumpOrder
childOrder
;
@override
List
<
DiagnosticsNode
>
getChildren
()
{
if
(
value
!=
null
)
return
value
.
debugDescribeChildren
(
childOrder:
childOrder
);
// `value` has a non-nullable return type, but might be null when
// running with weak checking, so we need to null check it above (and
// ignore the warning below that the null-handling logic is dead code).
return
const
<
DiagnosticsNode
>[];
// ignore: dead_code
}
List
<
DiagnosticsNode
>
getChildren
()
=>
value
.
debugDescribeChildren
(
childOrder:
childOrder
);
}
/// Provides hint values which override the default hints on supported
...
...
@@ -1419,11 +1411,9 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin {
for
(
final
SemanticsNode
child
in
_children
!)
child
.
_dead
=
true
;
}
if
(
newChildren
!=
null
)
{
for
(
final
SemanticsNode
child
in
newChildren
)
{
assert
(!
child
.
isInvisible
,
'Child
$child
is invisible and should not be added as a child of
$this
.'
);
child
.
_dead
=
false
;
}
for
(
final
SemanticsNode
child
in
newChildren
)
{
assert
(!
child
.
isInvisible
,
'Child
$child
is invisible and should not be added as a child of
$this
.'
);
child
.
_dead
=
false
;
}
bool
sawChange
=
false
;
if
(
_children
!=
null
)
{
...
...
@@ -1438,21 +1428,19 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin {
}
}
}
if
(
newChildren
!=
null
)
{
for
(
final
SemanticsNode
child
in
newChildren
)
{
if
(
child
.
parent
!=
this
)
{
if
(
child
.
parent
!=
null
)
{
// we're rebuilding the tree from the bottom up, so it's possible
// that our child was, in the last pass, a child of one of our
// ancestors. In that case, we drop the child eagerly here.
// TODO(ianh): Find a way to assert that the same node didn't
// actually appear in the tree in two places.
child
.
parent
?.
dropChild
(
child
);
}
assert
(!
child
.
attached
);
adoptChild
(
child
);
sawChange
=
true
;
for
(
final
SemanticsNode
child
in
newChildren
)
{
if
(
child
.
parent
!=
this
)
{
if
(
child
.
parent
!=
null
)
{
// we're rebuilding the tree from the bottom up, so it's possible
// that our child was, in the last pass, a child of one of our
// ancestors. In that case, we drop the child eagerly here.
// TODO(ianh): Find a way to assert that the same node didn't
// actually appear in the tree in two places.
child
.
parent
?.
dropChild
(
child
);
}
assert
(!
child
.
attached
);
adoptChild
(
child
);
sawChange
=
true
;
}
}
if
(!
sawChange
&&
_children
!=
null
)
{
...
...
@@ -1966,10 +1954,8 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin {
mergedTags
??=
<
SemanticsTag
>{};
mergedTags
!.
addAll
(
node
.
tags
!);
}
if
(
node
.
_customSemanticsActions
!=
null
)
{
for
(
final
CustomSemanticsAction
action
in
_customSemanticsActions
.
keys
)
customSemanticsActionIds
.
add
(
CustomSemanticsAction
.
getIdentifier
(
action
));
}
for
(
final
CustomSemanticsAction
action
in
_customSemanticsActions
.
keys
)
customSemanticsActionIds
.
add
(
CustomSemanticsAction
.
getIdentifier
(
action
));
if
(
node
.
hintOverrides
!=
null
)
{
if
(
node
.
hintOverrides
!.
onTapHint
!=
null
)
{
final
CustomSemanticsAction
action
=
CustomSemanticsAction
.
overridingAction
(
...
...
packages/flutter/lib/src/services/text_input.dart
View file @
304e2c57
...
...
@@ -790,7 +790,7 @@ abstract class TextInputClient {
const
TextInputClient
();
/// The current state of the [TextEditingValue] held by this client.
TextEditingValue
get
currentTextEditingValue
;
TextEditingValue
?
get
currentTextEditingValue
;
/// The [AutofillScope] this [TextInputClient] belongs to, if any.
///
...
...
@@ -1164,7 +1164,7 @@ class TextInput {
if
(
method
==
'TextInputClient.requestExistingInputState'
)
{
assert
(
_currentConnection
!.
_client
!=
null
);
_attach
(
_currentConnection
!,
_currentConfiguration
);
final
TextEditingValue
editingValue
=
_currentConnection
!.
_client
.
currentTextEditingValue
;
final
TextEditingValue
?
editingValue
=
_currentConnection
!.
_client
.
currentTextEditingValue
;
if
(
editingValue
!=
null
)
{
_setEditingState
(
editingValue
);
}
...
...
packages/flutter/lib/src/widgets/container.dart
View file @
304e2c57
...
...
@@ -105,12 +105,7 @@ class DecoratedBox extends SingleChildRenderObjectWidget {
break
;
}
properties
.
add
(
EnumProperty
<
DecorationPosition
>(
'position'
,
position
,
level:
DiagnosticLevel
.
hidden
));
properties
.
add
(
DiagnosticsProperty
<
Decoration
>(
label
,
decoration
,
ifNull:
'no decoration'
,
showName:
decoration
!=
null
,
));
properties
.
add
(
DiagnosticsProperty
<
Decoration
>(
label
,
decoration
));
}
}
...
...
packages/flutter/lib/src/widgets/focus_scope.dart
View file @
304e2c57
...
...
@@ -527,9 +527,7 @@ class _FocusState extends State<Focus> {
// _createNode is overridden in _FocusScopeState.
_internalNode
??=
_createNode
();
}
if
(
widget
.
descendantsAreFocusable
!=
null
)
{
focusNode
.
descendantsAreFocusable
=
widget
.
descendantsAreFocusable
;
}
focusNode
.
descendantsAreFocusable
=
widget
.
descendantsAreFocusable
;
if
(
widget
.
skipTraversal
!=
null
)
{
focusNode
.
skipTraversal
=
widget
.
skipTraversal
!;
}
...
...
@@ -615,9 +613,7 @@ class _FocusState extends State<Focus> {
if
(
widget
.
canRequestFocus
!=
null
)
{
focusNode
.
canRequestFocus
=
widget
.
canRequestFocus
!;
}
if
(
widget
.
descendantsAreFocusable
!=
null
)
{
focusNode
.
descendantsAreFocusable
=
widget
.
descendantsAreFocusable
;
}
focusNode
.
descendantsAreFocusable
=
widget
.
descendantsAreFocusable
;
}
else
{
_focusAttachment
!.
detach
();
focusNode
.
removeListener
(
_handleFocusChanged
);
...
...
packages/flutter/lib/src/widgets/layout_builder.dart
View file @
304e2c57
...
...
@@ -116,23 +116,21 @@ class _LayoutBuilderElement<ConstraintType extends Constraints> extends RenderOb
void
_layout
(
ConstraintType
constraints
)
{
owner
!.
buildScope
(
this
,
()
{
Widget
?
built
;
if
(
widget
.
builder
!=
null
)
{
try
{
built
=
widget
.
builder
(
this
,
constraints
);
debugWidgetBuilderValue
(
widget
,
built
);
}
catch
(
e
,
stack
)
{
built
=
ErrorWidget
.
builder
(
_debugReportException
(
ErrorDescription
(
'building
$widget
'
),
e
,
stack
,
informationCollector:
()
sync
*
{
yield
DiagnosticsDebugCreator
(
DebugCreator
(
this
));
},
),
);
}
Widget
built
;
try
{
built
=
widget
.
builder
(
this
,
constraints
);
debugWidgetBuilderValue
(
widget
,
built
);
}
catch
(
e
,
stack
)
{
built
=
ErrorWidget
.
builder
(
_debugReportException
(
ErrorDescription
(
'building
$widget
'
),
e
,
stack
,
informationCollector:
()
sync
*
{
yield
DiagnosticsDebugCreator
(
DebugCreator
(
this
));
},
),
);
}
try
{
_child
=
updateChild
(
_child
,
built
,
null
);
...
...
packages/flutter/lib/src/widgets/navigator.dart
View file @
304e2c57
...
...
@@ -3603,11 +3603,11 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin, Res
assert
(
previousOldPageRouteEntry
!=
null
);
final
List
<
_RouteEntry
>
pagelessRoutes
=
pageRouteToPagelessRoutes
.
putIfAbsent
(
previousOldPageRouteEntry
!
,
previousOldPageRouteEntry
,
()
=>
<
_RouteEntry
>[],
);
pagelessRoutes
.
add
(
potentialEntryToRemove
);
if
(
previousOldPageRouteEntry
.
isWaitingForExitingDecision
)
if
(
previousOldPageRouteEntry
!
.
isWaitingForExitingDecision
)
potentialEntryToRemove
.
markNeedsExitingDecision
();
continue
;
}
...
...
@@ -3651,7 +3651,7 @@ class NavigatorState extends State<Navigator> with TickerProviderStateMixin, Res
assert
(
previousOldPageRouteEntry
!=
null
);
final
List
<
_RouteEntry
>
pagelessRoutes
=
pageRouteToPagelessRoutes
.
putIfAbsent
(
previousOldPageRouteEntry
!
,
previousOldPageRouteEntry
,
()
=>
<
_RouteEntry
>[]
);
pagelessRoutes
.
add
(
oldEntry
);
...
...
packages/flutter/lib/src/widgets/nested_scroll_view.dart
View file @
304e2c57
...
...
@@ -808,10 +808,7 @@ class _NestedScrollCoordinator implements ScrollActivityDelegate, ScrollHoldCont
return
false
;
}
void
updateShadow
()
{
if
(
_onHasScrolledBodyChanged
!=
null
)
_onHasScrolledBodyChanged
();
}
void
updateShadow
()
{
_onHasScrolledBodyChanged
();
}
ScrollDirection
get
userScrollDirection
=>
_userScrollDirection
;
ScrollDirection
_userScrollDirection
=
ScrollDirection
.
idle
;
...
...
packages/flutter/lib/src/widgets/sliver.dart
View file @
304e2c57
...
...
@@ -1107,7 +1107,7 @@ class SliverMultiBoxAdaptorElement extends RenderObjectElement implements Render
if
(
childParentData
!=
null
)
childParentData
.
layoutOffset
=
null
;
newChildren
[
newIndex
]
=
_childElements
[
index
]
!
;
newChildren
[
newIndex
]
=
_childElements
[
index
];
// We need to make sure the original index gets processed.
newChildren
.
putIfAbsent
(
index
,
()
=>
null
);
// We do not want the remapped child to get deactivated during processElement.
...
...
packages/flutter/lib/src/widgets/widget_inspector.dart
View file @
304e2c57
...
...
@@ -970,7 +970,7 @@ mixin WidgetInspectorService {
void
initServiceExtensions
(
_RegisterServiceExtensionCallback
registerServiceExtensionCallback
)
{
_structuredExceptionHandler
=
_reportError
;
if
(
isStructuredErrorsEnabled
())
{
FlutterError
.
onError
=
_structuredExceptionHandler
!
;
FlutterError
.
onError
=
_structuredExceptionHandler
;
}
_registerServiceExtensionCallback
=
registerServiceExtensionCallback
;
assert
(!
_debugServiceExtensionsRegistered
);
...
...
@@ -2284,10 +2284,8 @@ class _WidgetInspectorState extends State<WidgetInspector>
if
(
_lastPointerLocation
!=
null
)
{
_inspectAt
(
_lastPointerLocation
!);
if
(
selection
!=
null
)
{
// Notify debuggers to open an inspector on the object.
developer
.
inspect
(
selection
.
current
);
}
// Notify debuggers to open an inspector on the object.
developer
.
inspect
(
selection
.
current
);
}
setState
(()
{
// Only exit select mode if there is a button to return to select mode.
...
...
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