Implement on clauses (#152706)
This pull request removes an `// ignore: avoid_catches_without_on_clauses` comment. > [!NOTE] > Diffs are super tiny if you do "hide whitespace"!
This commit is contained in:
@@ -132,11 +132,8 @@ _Debounceable<S, T> _debounce<S, T>(_Debounceable<S?, T> function) {
|
||||
debounceTimer = _DebounceTimer();
|
||||
try {
|
||||
await debounceTimer!.future;
|
||||
} catch (error) {
|
||||
if (error is _CancelException) {
|
||||
return null;
|
||||
}
|
||||
rethrow;
|
||||
} on _CancelException {
|
||||
return null;
|
||||
}
|
||||
return function(parameter);
|
||||
};
|
||||
|
||||
@@ -71,14 +71,13 @@ class _AsyncAutocompleteState extends State<_AsyncAutocomplete > {
|
||||
late final Iterable<String> options;
|
||||
try {
|
||||
options = await _FakeAPI.search(_currentQuery!, _networkEnabled);
|
||||
} catch (error) {
|
||||
if (error is _NetworkException) {
|
||||
} on _NetworkException {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_networkError = true;
|
||||
});
|
||||
return <String>[];
|
||||
}
|
||||
rethrow;
|
||||
return <String>[];
|
||||
}
|
||||
|
||||
// If another search happened after this one, throw away these options.
|
||||
@@ -189,11 +188,8 @@ _Debounceable<S, T> _debounce<S, T>(_Debounceable<S?, T> function) {
|
||||
debounceTimer = _DebounceTimer();
|
||||
try {
|
||||
await debounceTimer!.future;
|
||||
} catch (error) {
|
||||
if (error is _CancelException) {
|
||||
return null;
|
||||
}
|
||||
rethrow;
|
||||
} on _CancelException {
|
||||
return null;
|
||||
}
|
||||
return function(parameter);
|
||||
};
|
||||
|
||||
@@ -139,11 +139,8 @@ _Debounceable<S, T> _debounce<S, T>(_Debounceable<S?, T> function) {
|
||||
debounceTimer = _DebounceTimer();
|
||||
try {
|
||||
await debounceTimer!.future;
|
||||
} catch (error) {
|
||||
if (error is _CancelException) {
|
||||
return null;
|
||||
}
|
||||
rethrow;
|
||||
} on _CancelException {
|
||||
return null;
|
||||
}
|
||||
return function(parameter);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user