Remove uses of deprecated constants and change int.parse to int.tryParse (#19575)
* Remove uses of deprecated constants * Change int.parse to int.tryParse where appropriate
This commit is contained in:
@@ -176,8 +176,8 @@ class FlutterProject {
|
||||
final File buildScript = new File(
|
||||
path.join(androidPath, 'app', 'build.gradle'),
|
||||
);
|
||||
// ignore: deprecated_member_use
|
||||
buildScript.openWrite(mode: FileMode.APPEND).write('''
|
||||
|
||||
buildScript.openWrite(mode: FileMode.append).write('''
|
||||
|
||||
android {
|
||||
buildTypes {
|
||||
@@ -193,8 +193,8 @@ android {
|
||||
final File buildScript = new File(
|
||||
path.join(androidPath, 'app', 'build.gradle'),
|
||||
);
|
||||
// ignore: deprecated_member_use
|
||||
buildScript.openWrite(mode: FileMode.APPEND).write('''
|
||||
|
||||
buildScript.openWrite(mode: FileMode.append).write('''
|
||||
|
||||
android {
|
||||
flavorDimensions "mode"
|
||||
|
||||
@@ -52,7 +52,7 @@ Future<Null> _patchXcconfigFilesIfNotPatched(String flutterProjectPath) async {
|
||||
final String contents = await file.readAsString();
|
||||
final bool alreadyPatched = contents.contains(include);
|
||||
if (!alreadyPatched) {
|
||||
final IOSink patchOut = file.openWrite(mode: FileMode.APPEND); // ignore: deprecated_member_use
|
||||
final IOSink patchOut = file.openWrite(mode: FileMode.append);
|
||||
patchOut.writeln(); // in case EOF is not preceded by line break
|
||||
patchOut.writeln(include);
|
||||
await patchOut.close();
|
||||
|
||||
@@ -73,14 +73,14 @@ Future<Map<String, dynamic>> runTask(String taskName, { bool silent = false }) a
|
||||
await runner.exitCode.timeout(const Duration(seconds: 1));
|
||||
return taskResult;
|
||||
} on TimeoutException catch (timeout) {
|
||||
runner.kill(ProcessSignal.SIGINT); // ignore: deprecated_member_use
|
||||
runner.kill(ProcessSignal.sigint);
|
||||
return <String, dynamic>{
|
||||
'success': false,
|
||||
'reason': 'Timeout waiting for $waitingFor: ${timeout.message}',
|
||||
};
|
||||
} finally {
|
||||
if (!runnerFinished)
|
||||
runner.kill(ProcessSignal.SIGKILL); // ignore: deprecated_member_use
|
||||
runner.kill(ProcessSignal.sigkill);
|
||||
await stdoutSub.cancel();
|
||||
await stderrSub.cancel();
|
||||
}
|
||||
|
||||
@@ -124,8 +124,8 @@ Future<Map<String, double>> _readJsonResults(Process process) {
|
||||
jsonStarted = false;
|
||||
processWasKilledIntentionally = true;
|
||||
resultsHaveBeenParsed = true;
|
||||
// ignore: deprecated_member_use
|
||||
process.kill(ProcessSignal.SIGINT); // flutter run doesn't quit automatically
|
||||
|
||||
process.kill(ProcessSignal.sigint); // flutter run doesn't quit automatically
|
||||
try {
|
||||
completer.complete(new Map<String, double>.from(json.decode(jsonOutput)));
|
||||
} catch (ex) {
|
||||
|
||||
Reference in New Issue
Block a user