mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
null-annotate lerp.dart, annotations.dart, channel_buffers.dart, hash_codes.dart (flutter/engine#18348)
This commit is contained in:
parent
91f67b420c
commit
5db8fe0da7
@ -39,7 +39,7 @@ part of dart.ui;
|
||||
/// }
|
||||
/// }
|
||||
/// ```
|
||||
const _KeepToString keepToString = _KeepToString();
|
||||
const _KeepToString/*!*/ keepToString = _KeepToString();
|
||||
|
||||
class _KeepToString {
|
||||
const _KeepToString();
|
||||
|
||||
@ -130,7 +130,7 @@ class ChannelBuffers {
|
||||
}
|
||||
|
||||
/// Returns true on overflow.
|
||||
bool push(String channel, ByteData data, PlatformMessageResponseCallback callback) {
|
||||
bool push(String/*!*/ channel, ByteData/*!*/ data, PlatformMessageResponseCallback/*!*/ callback) {
|
||||
_RingBuffer<_StoredMessage> queue = _messages[channel];
|
||||
if (queue == null) {
|
||||
queue = _makeRingBuffer(kDefaultBufferSize);
|
||||
@ -182,7 +182,7 @@ class ChannelBuffers {
|
||||
///
|
||||
/// This should be called once a channel is prepared to handle messages
|
||||
/// (i.e. when a message handler is setup in the framework).
|
||||
Future<void> drain(String channel, DrainChannelCallback callback) async {
|
||||
Future<void> drain(String/*!*/ channel, DrainChannelCallback/*!*/ callback) async {
|
||||
while (!_isEmpty(channel)) {
|
||||
final _StoredMessage message = _pop(channel);
|
||||
await callback(message.data, message.callback);
|
||||
@ -204,7 +204,7 @@ class ChannelBuffers {
|
||||
/// Arity: 2
|
||||
/// Format: `resize\r<channel name>\r<new size>`
|
||||
/// Description: Allows you to set the size of a channel's buffer.
|
||||
void handleMessage(ByteData data) {
|
||||
void handleMessage(ByteData/*!*/ data) {
|
||||
final List<String> command = _getString(data).split('\r');
|
||||
if (command.length == /*arity=*/2 + 1 && command[0] == 'resize') {
|
||||
_resize(command[1], int.parse(command[2]));
|
||||
@ -220,4 +220,4 @@ class ChannelBuffers {
|
||||
///
|
||||
/// See also:
|
||||
/// * [BinaryMessenger] - The place where ChannelBuffers are typically read.
|
||||
final ChannelBuffers channelBuffers = ChannelBuffers();
|
||||
final ChannelBuffers/*!*/ channelBuffers = ChannelBuffers();
|
||||
|
||||
@ -40,14 +40,14 @@ class _Jenkins {
|
||||
/// ```dart
|
||||
/// int hashCode => hashValues(foo, bar, hashList(quux), baz);
|
||||
/// ```
|
||||
int hashValues(
|
||||
Object arg01, Object arg02, [ Object arg03 = _hashEnd,
|
||||
Object arg04 = _hashEnd, Object arg05 = _hashEnd, Object arg06 = _hashEnd,
|
||||
Object arg07 = _hashEnd, Object arg08 = _hashEnd, Object arg09 = _hashEnd,
|
||||
Object arg10 = _hashEnd, Object arg11 = _hashEnd, Object arg12 = _hashEnd,
|
||||
Object arg13 = _hashEnd, Object arg14 = _hashEnd, Object arg15 = _hashEnd,
|
||||
Object arg16 = _hashEnd, Object arg17 = _hashEnd, Object arg18 = _hashEnd,
|
||||
Object arg19 = _hashEnd, Object arg20 = _hashEnd ]) {
|
||||
int/*!*/ hashValues(
|
||||
Object/*?*/ arg01, Object/*?*/ arg02, [ Object/*?*/ arg03 = _hashEnd,
|
||||
Object/*?*/ arg04 = _hashEnd, Object/*?*/ arg05 = _hashEnd, Object/*?*/ arg06 = _hashEnd,
|
||||
Object/*?*/ arg07 = _hashEnd, Object/*?*/ arg08 = _hashEnd, Object/*?*/ arg09 = _hashEnd,
|
||||
Object/*?*/ arg10 = _hashEnd, Object/*?*/ arg11 = _hashEnd, Object/*?*/ arg12 = _hashEnd,
|
||||
Object/*?*/ arg13 = _hashEnd, Object/*?*/ arg14 = _hashEnd, Object/*?*/ arg15 = _hashEnd,
|
||||
Object/*?*/ arg16 = _hashEnd, Object/*?*/ arg17 = _hashEnd, Object/*?*/ arg18 = _hashEnd,
|
||||
Object/*?*/ arg19 = _hashEnd, Object/*?*/ arg20 = _hashEnd ]) {
|
||||
int result = 0;
|
||||
result = _Jenkins.combine(result, arg01);
|
||||
result = _Jenkins.combine(result, arg02);
|
||||
@ -112,7 +112,7 @@ int hashValues(
|
||||
/// Combine the [Object.hashCode] values of an arbitrary number of objects from
|
||||
/// an [Iterable] into one value. This function will return the same value if
|
||||
/// given null as if given an empty list.
|
||||
int hashList(Iterable<Object> arguments) {
|
||||
int/*!*/ hashList(Iterable<Object/*?*/>/*!*/ arguments) {
|
||||
int result = 0;
|
||||
if (arguments != null) {
|
||||
for (Object argument in arguments)
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
part of dart.ui;
|
||||
|
||||
/// Linearly interpolate between two numbers.
|
||||
double lerpDouble(num a, num b, double t) {
|
||||
double/*!*/ lerpDouble(num/*?*/ a, num/*?*/ b, double/*!*/ t) {
|
||||
if (a == null && b == null)
|
||||
return null;
|
||||
a ??= 0.0;
|
||||
|
||||
@ -39,7 +39,7 @@ part of ui;
|
||||
/// }
|
||||
/// }
|
||||
/// ```
|
||||
const _KeepToString keepToString = _KeepToString();
|
||||
const _KeepToString/*!*/ keepToString = _KeepToString();
|
||||
|
||||
class _KeepToString {
|
||||
const _KeepToString();
|
||||
|
||||
@ -130,7 +130,7 @@ class ChannelBuffers {
|
||||
}
|
||||
|
||||
/// Returns true on overflow.
|
||||
bool push(String channel, ByteData data, PlatformMessageResponseCallback callback) {
|
||||
bool push(String/*!*/ channel, ByteData/*!*/ data, PlatformMessageResponseCallback/*!*/ callback) {
|
||||
_RingBuffer<_StoredMessage> queue = _messages[channel];
|
||||
if (queue == null) {
|
||||
queue = _makeRingBuffer(kDefaultBufferSize);
|
||||
@ -182,7 +182,7 @@ class ChannelBuffers {
|
||||
///
|
||||
/// This should be called once a channel is prepared to handle messages
|
||||
/// (i.e. when a message handler is setup in the framework).
|
||||
Future<void> drain(String channel, DrainChannelCallback callback) async {
|
||||
Future<void> drain(String/*!*/ channel, DrainChannelCallback/*!*/ callback) async {
|
||||
while (!_isEmpty(channel)) {
|
||||
final _StoredMessage message = _pop(channel);
|
||||
await callback(message.data, message.callback);
|
||||
@ -204,7 +204,7 @@ class ChannelBuffers {
|
||||
/// Arity: 2
|
||||
/// Format: `resize\r<channel name>\r<new size>`
|
||||
/// Description: Allows you to set the size of a channel's buffer.
|
||||
void handleMessage(ByteData data) {
|
||||
void handleMessage(ByteData/*!*/ data) {
|
||||
final List<String> command = _getString(data).split('\r');
|
||||
if (command.length == /*arity=*/2 + 1 && command[0] == 'resize') {
|
||||
_resize(command[1], int.parse(command[2]));
|
||||
@ -220,4 +220,4 @@ class ChannelBuffers {
|
||||
///
|
||||
/// See also:
|
||||
/// * [BinaryMessenger] - The place where ChannelBuffers are typically read.
|
||||
final ChannelBuffers channelBuffers = ChannelBuffers();
|
||||
final ChannelBuffers/*!*/ channelBuffers = ChannelBuffers();
|
||||
|
||||
@ -42,14 +42,14 @@ class _Jenkins {
|
||||
/// ```dart
|
||||
/// int hashCode => hashValues(foo, bar, hashList(quux), baz);
|
||||
/// ```
|
||||
int hashValues(
|
||||
Object arg01, Object arg02, [ Object arg03 = _hashEnd,
|
||||
Object arg04 = _hashEnd, Object arg05 = _hashEnd, Object arg06 = _hashEnd,
|
||||
Object arg07 = _hashEnd, Object arg08 = _hashEnd, Object arg09 = _hashEnd,
|
||||
Object arg10 = _hashEnd, Object arg11 = _hashEnd, Object arg12 = _hashEnd,
|
||||
Object arg13 = _hashEnd, Object arg14 = _hashEnd, Object arg15 = _hashEnd,
|
||||
Object arg16 = _hashEnd, Object arg17 = _hashEnd, Object arg18 = _hashEnd,
|
||||
Object arg19 = _hashEnd, Object arg20 = _hashEnd ]) {
|
||||
int/*!*/ hashValues(
|
||||
Object/*?*/ arg01, Object/*?*/ arg02, [ Object/*?*/ arg03 = _hashEnd,
|
||||
Object/*?*/ arg04 = _hashEnd, Object/*?*/ arg05 = _hashEnd, Object/*?*/ arg06 = _hashEnd,
|
||||
Object/*?*/ arg07 = _hashEnd, Object/*?*/ arg08 = _hashEnd, Object/*?*/ arg09 = _hashEnd,
|
||||
Object/*?*/ arg10 = _hashEnd, Object/*?*/ arg11 = _hashEnd, Object/*?*/ arg12 = _hashEnd,
|
||||
Object/*?*/ arg13 = _hashEnd, Object/*?*/ arg14 = _hashEnd, Object/*?*/ arg15 = _hashEnd,
|
||||
Object/*?*/ arg16 = _hashEnd, Object/*?*/ arg17 = _hashEnd, Object/*?*/ arg18 = _hashEnd,
|
||||
Object/*?*/ arg19 = _hashEnd, Object/*?*/ arg20 = _hashEnd ]) {
|
||||
int result = 0;
|
||||
result = _Jenkins.combine(result, arg01);
|
||||
result = _Jenkins.combine(result, arg02);
|
||||
@ -114,7 +114,7 @@ int hashValues(
|
||||
/// Combine the [Object.hashCode] values of an arbitrary number of objects from
|
||||
/// an [Iterable] into one value. This function will return the same value if
|
||||
/// given null as if given an empty list.
|
||||
int hashList(Iterable<Object> arguments) {
|
||||
int/*!*/ hashList(Iterable<Object/*?*/>/*!*/ arguments) {
|
||||
int result = 0;
|
||||
if (arguments != null) {
|
||||
for (Object argument in arguments)
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
part of ui;
|
||||
|
||||
/// Linearly interpolate between two numbers.
|
||||
double lerpDouble(num a, num b, double t) {
|
||||
double/*!*/ lerpDouble(num/*?*/ a, num/*?*/ b, double/*!*/ t) {
|
||||
if (a == null && b == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user