Pass FLUTTER_TOOL_ARGS to snapshot command. (#29938)

diff --git a/bin/flutter b/bin/flutter
index 178994f..dc9425d 100755
--- a/bin/flutter
+++ b/bin/flutter
@@ -121,7 +121,7 @@
 
     retry_upgrade
 
-    "$DART" --snapshot="$SNAPSHOT_PATH" --snapshot-kind=app-jit --packages="$FLUTTER_TOOLS_DIR/.packages" "$SCRIPT_PATH" training
+    "$DART" $FLUTTER_TOOL_ARGS --snapshot="$SNAPSHOT_PATH" --snapshot-kind=app-jit --packages="$FLUTTER_TOOLS_DIR/.packages" "$SCRIPT_PATH" training
     echo "$revision" > "$STAMP_PATH"
   fi
   # The exit here is duplicitous since the function is run in a subshell,
diff --git a/bin/flutter.bat b/bin/flutter.bat
index 7aa7020..3ee58af 100644
--- a/bin/flutter.bat
+++ b/bin/flutter.bat
@@ -152,7 +152,11 @@
 
     POPD
 
-    "%dart%" --snapshot="%snapshot_path%" --snapshot-kind=app-jit --packages="%flutter_tools_dir%\.packages" "%script_path%"
+    IF "%FLUTTER_TOOL_ARGS%" == "" (
+      "%dart%" --snapshot="%snapshot_path%" --snapshot-kind=app-jit --packages="%flutter_tools_dir%\.packages" "%script_path%"
+    ) else (
+      "%dart%" "%FLUTTER_TOOL_ARGS%" --snapshot="%snapshot_path%" --snapshot-kind=app-jit --packages="%flutter_tools_dir%\.packages" "%script_path%"
+    )
     IF "%ERRORLEVEL%" NEQ "0" (
       ECHO Error: Unable to create dart snapshot for flutter tool.
       SET exit_code=%ERRORLEVEL%