From 18af7ba14eb6ec79fb6c7855f16eeada81ad969f Mon Sep 17 00:00:00 2001 From: gaaclarke <30870216+gaaclarke@users.noreply.github.com> Date: Wed, 16 Sep 2020 14:50:32 -0700 Subject: [PATCH] [Pigeon] fixed dart linter problem (#207) --- packages/pigeon/CHANGELOG.md | 4 ++++ packages/pigeon/lib/dart_generator.dart | 4 ++-- packages/pigeon/lib/generator_tools.dart | 2 +- packages/pigeon/pubspec.yaml | 2 +- packages/pigeon/run_tests.sh | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/pigeon/CHANGELOG.md b/packages/pigeon/CHANGELOG.md index 98090e959e..6bf55de635 100644 --- a/packages/pigeon/CHANGELOG.md +++ b/packages/pigeon/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.6 + +* Fixed unused variable linter warning in Dart code under certain conditions. + ## 0.1.5 * Made array datatypes correctly get imported and exported avoiding the need to diff --git a/packages/pigeon/lib/dart_generator.dart b/packages/pigeon/lib/dart_generator.dart index 47884ef032..763c961556 100644 --- a/packages/pigeon/lib/dart_generator.dart +++ b/packages/pigeon/lib/dart_generator.dart @@ -92,12 +92,12 @@ void _writeFlutterApi(Indent indent, Api api, indent.scoped('{', '});', () { final String argType = func.argType; final String returnType = func.returnType; - indent.writeln( - 'final Map mapMessage = message as Map;'); String call; if (argType == 'void') { call = 'api.${func.name}()'; } else { + indent.writeln( + 'final Map mapMessage = message as Map;'); indent.writeln( 'final $argType input = $argType._fromMap(mapMessage);'); call = 'api.${func.name}(input)'; diff --git a/packages/pigeon/lib/generator_tools.dart b/packages/pigeon/lib/generator_tools.dart index 92ccbdd2a6..33b39cfe94 100644 --- a/packages/pigeon/lib/generator_tools.dart +++ b/packages/pigeon/lib/generator_tools.dart @@ -8,7 +8,7 @@ import 'dart:mirrors'; import 'ast.dart'; /// The current version of pigeon. -const String pigeonVersion = '0.1.5'; +const String pigeonVersion = '0.1.6'; /// Read all the content from [stdin] to a String. String readStdin() { diff --git a/packages/pigeon/pubspec.yaml b/packages/pigeon/pubspec.yaml index 60ce6722ca..712a8a757c 100644 --- a/packages/pigeon/pubspec.yaml +++ b/packages/pigeon/pubspec.yaml @@ -1,5 +1,5 @@ name: pigeon -version: 0.1.5 +version: 0.1.6 description: Code generator tool to make communication between Flutter and the host platform type-safe and easier. homepage: https://github.com/flutter/packages/tree/master/packages/pigeon dependencies: diff --git a/packages/pigeon/run_tests.sh b/packages/pigeon/run_tests.sh index 47cfe5fe54..9650f6d4d5 100755 --- a/packages/pigeon/run_tests.sh +++ b/packages/pigeon/run_tests.sh @@ -42,7 +42,7 @@ test_pigeon_ios() { -o $temp_dir/pigeon.o dartfmt -w $temp_dir/pigeon.dart - dartanalyzer $temp_dir/pigeon.dart --packages ./e2e_tests/test_objc/.packages + dartanalyzer $temp_dir/pigeon.dart --fatal-infos --fatal-warnings --packages ./e2e_tests/test_objc/.packages rm -rf $temp_dir }