Remove the rest of the uses of Number.tryParse() (#16568)

This commit is contained in:
Hans Muller
2018-04-13 09:39:01 -07:00
committed by GitHub
parent 1c3f6a851f
commit e7154bee1a
3 changed files with 8 additions and 4 deletions

View File

@@ -197,7 +197,8 @@ class FuchsiaRemoteConnection {
final int lastSpace = trimmed.lastIndexOf(' ');
final String lastWord = trimmed.substring(lastSpace + 1);
if ((lastWord != '.') && (lastWord != '..')) {
final int value = int.tryParse(lastWord);
// ignore: deprecated_member_use
final int value = int.parse(lastWord, onError: (_) => null);
if (value != null) {
ports.add(value);
}