null-annotate native calls in lib/ui/semantics.dart (flutter/engine#18436)

Also covers counterparts of these calls in web_ui.
This commit is contained in:
Chris Bracken
2020-05-15 16:28:00 -07:00
committed by GitHub
parent c76923c65a
commit f51d36301a
2 changed files with 10 additions and 6 deletions

View File

@@ -793,24 +793,28 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 {
/// 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.

View File

@@ -725,7 +725,7 @@ class SemanticsUpdateBuilder {
}
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 @@ class SemanticsUpdateBuilder {
///
/// 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,
);