null-annotate native calls in lib/ui/semantics.dart (#18436)
Also covers counterparts of these calls in web_ui.
diff --git a/lib/ui/semantics.dart b/lib/ui/semantics.dart
index 508e001..c0b3245 100644
--- a/lib/ui/semantics.dart
+++ b/lib/ui/semantics.dart
@@ -793,24 +793,28 @@
/// For overridden standard actions, `overrideId` corresponds with a
/// [SemanticsAction.index] value. For custom actions this argument should not be
/// provided.
- void updateCustomAction({int id, String label, String hint, int overrideId = -1}) {
+ void updateCustomAction({/*required*/ int/*!*/ id, String/*?*/ label, String/*?*/ hint, int/*!*/ overrideId = -1}) {
assert(id != null);
assert(overrideId != null);
_updateCustomAction(id, label, hint, overrideId);
}
- void _updateCustomAction(int id, String label, String hint, int overrideId) native 'SemanticsUpdateBuilder_updateCustomAction';
+ void _updateCustomAction(
+ int/*!*/ id,
+ String/*?*/ label,
+ String/*?*/ hint,
+ int/*!*/ overrideId) native 'SemanticsUpdateBuilder_updateCustomAction';
/// Creates a [SemanticsUpdate] object that encapsulates the updates recorded
/// by this object.
///
/// The returned object can be passed to [Window.updateSemantics] to actually
/// update the semantics retained by the system.
- SemanticsUpdate build() {
+ SemanticsUpdate/*!*/ build() {
final SemanticsUpdate semanticsUpdate = SemanticsUpdate._();
_build(semanticsUpdate);
return semanticsUpdate;
}
- void _build(SemanticsUpdate outSemanticsUpdate) native 'SemanticsUpdateBuilder_build';
+ void _build(SemanticsUpdate/*!*/ outSemanticsUpdate) native 'SemanticsUpdateBuilder_build';
}
/// An opaque object representing a batch of semantics updates.
diff --git a/lib/web_ui/lib/src/ui/semantics.dart b/lib/web_ui/lib/src/ui/semantics.dart
index b04c644..a2a02b4 100644
--- a/lib/web_ui/lib/src/ui/semantics.dart
+++ b/lib/web_ui/lib/src/ui/semantics.dart
@@ -725,7 +725,7 @@
}
void updateCustomAction(
- {int id, String label, String hint, int overrideId = -1}) {
+ {/*required*/ int/*!*/ id, String/*?*/ label, String/*?*/ hint, int/*!*/ overrideId = -1}) {
// TODO(yjbanov): implement.
}
@@ -734,7 +734,7 @@
///
/// The returned object can be passed to [Window.updateSemantics] to actually
/// update the semantics retained by the system.
- SemanticsUpdate build() {
+ SemanticsUpdate/*!*/ build() {
return SemanticsUpdate._(
nodeUpdates: _nodeUpdates,
);