Unverified Commit 4049460d authored by Alexandre Ardhuin's avatar Alexandre Ardhuin Committed by GitHub

implicit-casts:false in flutter/lib/src/semantics (#45722)

parent 1c7a1c38
...@@ -129,10 +129,10 @@ class CustomSemanticsAction { ...@@ -129,10 +129,10 @@ class CustomSemanticsAction {
bool operator ==(dynamic other) { bool operator ==(dynamic other) {
if (other.runtimeType != runtimeType) if (other.runtimeType != runtimeType)
return false; return false;
final CustomSemanticsAction typedOther = other; return other is CustomSemanticsAction
return typedOther.label == label && other.label == label
&& typedOther.hint == hint && other.hint == hint
&& typedOther.action == action; && other.action == action;
} }
@override @override
...@@ -422,32 +422,30 @@ class SemanticsData extends Diagnosticable { ...@@ -422,32 +422,30 @@ class SemanticsData extends Diagnosticable {
@override @override
bool operator ==(dynamic other) { bool operator ==(dynamic other) {
if (other is! SemanticsData) return other is SemanticsData
return false; && other.flags == flags
final SemanticsData typedOther = other; && other.actions == actions
return typedOther.flags == flags && other.label == label
&& typedOther.actions == actions && other.value == value
&& typedOther.label == label && other.increasedValue == increasedValue
&& typedOther.value == value && other.decreasedValue == decreasedValue
&& typedOther.increasedValue == increasedValue && other.hint == hint
&& typedOther.decreasedValue == decreasedValue && other.textDirection == textDirection
&& typedOther.hint == hint && other.rect == rect
&& typedOther.textDirection == textDirection && setEquals(other.tags, tags)
&& typedOther.rect == rect && other.scrollChildCount == scrollChildCount
&& setEquals(typedOther.tags, tags) && other.scrollIndex == scrollIndex
&& typedOther.scrollChildCount == scrollChildCount && other.textSelection == textSelection
&& typedOther.scrollIndex == scrollIndex && other.scrollPosition == scrollPosition
&& typedOther.textSelection == textSelection && other.scrollExtentMax == scrollExtentMax
&& typedOther.scrollPosition == scrollPosition && other.scrollExtentMin == scrollExtentMin
&& typedOther.scrollExtentMax == scrollExtentMax && other.platformViewId == platformViewId
&& typedOther.scrollExtentMin == scrollExtentMin && other.maxValueLength == maxValueLength
&& typedOther.platformViewId == platformViewId && other.currentValueLength == currentValueLength
&& typedOther.maxValueLength == maxValueLength && other.transform == transform
&& typedOther.currentValueLength == currentValueLength && other.elevation == elevation
&& typedOther.transform == transform && other.thickness == thickness
&& typedOther.elevation == elevation && _sortedListsEqual(other.customSemanticsActionIds, customSemanticsActionIds);
&& typedOther.thickness == thickness
&& _sortedListsEqual(typedOther.customSemanticsActionIds, customSemanticsActionIds);
} }
@override @override
...@@ -564,9 +562,9 @@ class SemanticsHintOverrides extends DiagnosticableTree { ...@@ -564,9 +562,9 @@ class SemanticsHintOverrides extends DiagnosticableTree {
bool operator ==(dynamic other) { bool operator ==(dynamic other) {
if (other.runtimeType != runtimeType) if (other.runtimeType != runtimeType)
return false; return false;
final SemanticsHintOverrides typedOther = other; return other is SemanticsHintOverrides
return typedOther.onTapHint == onTapHint && other.onTapHint == onTapHint
&& typedOther.onLongPressHint == onLongPressHint; && other.onLongPressHint == onLongPressHint;
} }
@override @override
...@@ -1500,10 +1498,10 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin { ...@@ -1500,10 +1498,10 @@ class SemanticsNode extends AbstractNode with DiagnosticableTreeMixin {
// AbstractNode OVERRIDES // AbstractNode OVERRIDES
@override @override
SemanticsOwner get owner => super.owner; SemanticsOwner get owner => super.owner as SemanticsOwner;
@override @override
SemanticsNode get parent => super.parent; SemanticsNode get parent => super.parent as SemanticsNode;
@override @override
void redepthChildren() { void redepthChildren() {
...@@ -3080,7 +3078,7 @@ class SemanticsConfiguration { ...@@ -3080,7 +3078,7 @@ class SemanticsConfiguration {
set onMoveCursorForwardByCharacter(MoveCursorHandler value) { set onMoveCursorForwardByCharacter(MoveCursorHandler value) {
assert(value != null); assert(value != null);
_addAction(SemanticsAction.moveCursorForwardByCharacter, (dynamic args) { _addAction(SemanticsAction.moveCursorForwardByCharacter, (dynamic args) {
final bool extentSelection = args; final bool extentSelection = args as bool;
assert(extentSelection != null); assert(extentSelection != null);
value(extentSelection); value(extentSelection);
}); });
...@@ -3099,7 +3097,7 @@ class SemanticsConfiguration { ...@@ -3099,7 +3097,7 @@ class SemanticsConfiguration {
set onMoveCursorBackwardByCharacter(MoveCursorHandler value) { set onMoveCursorBackwardByCharacter(MoveCursorHandler value) {
assert(value != null); assert(value != null);
_addAction(SemanticsAction.moveCursorBackwardByCharacter, (dynamic args) { _addAction(SemanticsAction.moveCursorBackwardByCharacter, (dynamic args) {
final bool extentSelection = args; final bool extentSelection = args as bool;
assert(extentSelection != null); assert(extentSelection != null);
value(extentSelection); value(extentSelection);
}); });
...@@ -3118,7 +3116,7 @@ class SemanticsConfiguration { ...@@ -3118,7 +3116,7 @@ class SemanticsConfiguration {
set onMoveCursorForwardByWord(MoveCursorHandler value) { set onMoveCursorForwardByWord(MoveCursorHandler value) {
assert(value != null); assert(value != null);
_addAction(SemanticsAction.moveCursorForwardByWord, (dynamic args) { _addAction(SemanticsAction.moveCursorForwardByWord, (dynamic args) {
final bool extentSelection = args; final bool extentSelection = args as bool;
assert(extentSelection != null); assert(extentSelection != null);
value(extentSelection); value(extentSelection);
}); });
...@@ -3137,7 +3135,7 @@ class SemanticsConfiguration { ...@@ -3137,7 +3135,7 @@ class SemanticsConfiguration {
set onMoveCursorBackwardByWord(MoveCursorHandler value) { set onMoveCursorBackwardByWord(MoveCursorHandler value) {
assert(value != null); assert(value != null);
_addAction(SemanticsAction.moveCursorBackwardByWord, (dynamic args) { _addAction(SemanticsAction.moveCursorBackwardByWord, (dynamic args) {
final bool extentSelection = args; final bool extentSelection = args as bool;
assert(extentSelection != null); assert(extentSelection != null);
value(extentSelection); value(extentSelection);
}); });
...@@ -3157,7 +3155,7 @@ class SemanticsConfiguration { ...@@ -3157,7 +3155,7 @@ class SemanticsConfiguration {
assert(value != null); assert(value != null);
_addAction(SemanticsAction.setSelection, (dynamic args) { _addAction(SemanticsAction.setSelection, (dynamic args) {
assert(args != null && args is Map); assert(args != null && args is Map);
final Map<String, int> selection = args.cast<String, int>(); final Map<String, int> selection = (args as Map<dynamic, dynamic>).cast<String, int>();
assert(selection != null && selection['base'] != null && selection['extent'] != null); assert(selection != null && selection['base'] != null && selection['extent'] != null);
value(TextSelection( value(TextSelection(
baseOffset: selection['base'], baseOffset: selection['base'],
...@@ -3356,7 +3354,7 @@ class SemanticsConfiguration { ...@@ -3356,7 +3354,7 @@ class SemanticsConfiguration {
} }
void _onCustomSemanticsAction(dynamic args) { void _onCustomSemanticsAction(dynamic args) {
final CustomSemanticsAction action = CustomSemanticsAction.getAction(args); final CustomSemanticsAction action = CustomSemanticsAction.getAction(args as int);
if (action == null) if (action == null)
return; return;
final VoidCallback callback = _customSemanticsActions[action]; final VoidCallback callback = _customSemanticsActions[action];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment