Enforce and fix lints from package:pedantic (#2291)

- always_declare_return_types
- annotate_overrides
- curly_braces_in_flow_control_structures
- prefer_for_elements_to_map_fromiterable
- prefer_if_null_operators
- prefer_single_quotes
- prefer_spread_collections
- unawaited_futures
- use_function_type_syntax_for_parameters

Rename a method starting with `get` to use a more accurately descriptive
verb.

Tighten the types on some methods highlighted by the
`always_declare_return_types` lint by making them generic instead of
returning `dynamic`.
diff --git a/lib/src/git.dart b/lib/src/git.dart
index b8a8cc1..96f36b8 100644
--- a/lib/src/git.dart
+++ b/lib/src/git.dart
@@ -21,10 +21,12 @@
   /// The standard error emitted by git.
   final String stderr;
 
+  @override
   String get message => 'Git error. Command: git ${args.join(" ")}\n$stderr';
 
   GitException(Iterable<String> args, this.stderr) : args = args.toList();
 
+  @override
   String toString() => message;
 }
 
@@ -38,15 +40,15 @@
 Future<List<String>> run(List<String> args,
     {String workingDir, Map<String, String> environment}) async {
   if (!isInstalled) {
-    fail("Cannot find a Git executable.\n"
-        "Please ensure Git is correctly installed.");
+    fail('Cannot find a Git executable.\n'
+        'Please ensure Git is correctly installed.');
   }
 
   log.muteProgress();
   try {
     var result = await runProcess(command, args,
         workingDir: workingDir, environment: environment);
-    if (!result.success) throw GitException(args, result.stderr.join("\n"));
+    if (!result.success) throw GitException(args, result.stderr.join('\n'));
     return result.stdout;
   } finally {
     log.unmuteProgress();
@@ -57,13 +59,13 @@
 List<String> runSync(List<String> args,
     {String workingDir, Map<String, String> environment}) {
   if (!isInstalled) {
-    fail("Cannot find a Git executable.\n"
-        "Please ensure Git is correctly installed.");
+    fail('Cannot find a Git executable.\n'
+        'Please ensure Git is correctly installed.');
   }
 
   var result = runProcessSync(command, args,
       workingDir: workingDir, environment: environment);
-  if (!result.success) throw GitException(args, result.stderr.join("\n"));
+  if (!result.success) throw GitException(args, result.stderr.join('\n'));
   return result.stdout;
 }
 
@@ -72,10 +74,10 @@
 String get command {
   if (_commandCache != null) return _commandCache;
 
-  if (_tryGitCommand("git")) {
-    _commandCache = "git";
-  } else if (_tryGitCommand("git.cmd")) {
-    _commandCache = "git.cmd";
+  if (_tryGitCommand('git')) {
+    _commandCache = 'git';
+  } else if (_tryGitCommand('git.cmd')) {
+    _commandCache = 'git.cmd';
   } else {
     return null;
   }
@@ -90,8 +92,8 @@
 bool _tryGitCommand(String command) {
   // If "git --version" prints something familiar, git is working.
   try {
-    var result = runProcessSync(command, ["--version"]);
-    var regexp = RegExp("^git version");
+    var result = runProcessSync(command, ['--version']);
+    var regexp = RegExp('^git version');
     return result.stdout.length == 1 && regexp.hasMatch(result.stdout.single);
   } on ProcessException catch (error, stackTrace) {
     var chain = Chain.forTrace(stackTrace);