Add the required keyword (if present) in the ToSourceVisitor

Change-Id: Iae0d7cbbc81aebc7be1178e02efff63de7544bd6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203286
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
diff --git a/pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart b/pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart
index a9d231b..61cbd65 100644
--- a/pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart
+++ b/pkg/analyzer/lib/src/dart/ast/to_source_visitor.dart
@@ -497,6 +497,7 @@
   @override
   void visitFieldFormalParameter(FieldFormalParameter node) {
     safelyVisitNodeListWithSeparatorAndSuffix(node.metadata, ' ', ' ');
+    safelyVisitTokenWithSuffix(node.requiredKeyword, " ");
     safelyVisitTokenWithSuffix(node.covariantKeyword, ' ');
     safelyVisitTokenWithSuffix(node.keyword, " ");
     safelyVisitNodeWithSuffix(node.type, " ");
@@ -638,6 +639,7 @@
   @override
   void visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
     safelyVisitNodeListWithSeparatorAndSuffix(node.metadata, ' ', ' ');
+    safelyVisitTokenWithSuffix(node.requiredKeyword, ' ');
     safelyVisitTokenWithSuffix(node.covariantKeyword, ' ');
     safelyVisitNodeWithSuffix(node.returnType, " ");
     safelyVisitNode(node.identifier);