diff --git a/Dockerfile b/Dockerfile
index 026ba93b8befd066ead8616c53ddb17bdc357e99..b11f02a8da52d3e347d6bd92fc59c666dd77fe60 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -10,20 +10,20 @@ ARG USER_GID=$USER_UID
 
 # Install packages
 RUN apt-get update \
-    && apt-get -y install --no-install-recommends ca-certificates git nodejs unzip wget xz-utils \
+    && apt-get -y install --no-install-recommends apt-transport-https ca-certificates git nodejs unzip wget xz-utils \
     # Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user.
     && groupadd --gid $USER_GID $USERNAME \
     && useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
+    # Install Dart
+    && sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -' \
+    && sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list' \
+    && apt-get update \
+    && apt-get install -y dart \
     # Clean up
     && apt-get autoremove -y \
     && apt-get clean -y \
     && rm -rf /var/lib/apt/lists/*
 
-## Note to editors: Make sure name of USER and its WORKDIR path matches with
-## the value of USERNAME above
-USER $USERNAME
-WORKDIR /home/$USERNAME/workspace
-
 # Configure Sonar Scanner CLI
 ARG SONAR_SCANNER_CLI_VERSION=4.0.0.1744
 RUN wget -qO sonar-scanner-cli.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_CLI_VERSION-linux.zip \
@@ -41,15 +41,15 @@ RUN wget -qO /opt/shellcheck-${SHELLCHECK_VERSION}.tar.xz https://shellcheck.sto
     && chmod +x /opt/shellcheck-${SHELLCHECK_VERSION}/shellcheck \
     && ln -s /opt/shellcheck-${SHELLCHECK_VERSION}/shellcheck /usr/local/bin/shellcheck
 
+## Note to editors: Make sure name of USER and its WORKDIR path matches with
+## the value of USERNAME above
+USER $USERNAME
+WORKDIR /home/$USERNAME/workspace
+
 # Install Flutter
 ARG FLUTTER_VERSION="https://storage.googleapis.com/flutter_infra/releases/stable/linux/flutter_linux_v1.12.13+hotfix.8-stable.tar.xz"
 ENV PATH="$PATH:/usr/lib/dart/bin:/flutter/bin"
-RUN wget --quiet --output-document=flutter.tar.xz $FLUTTER_VERSION && tar xf flutter.tar.xz -C / \
-    && apt-get install apt-transport-https \
-    && sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -' \
-    && sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list' \
-    && apt-get update \
-    && apt-get install -y dart
+RUN wget --quiet --output-document=flutter.tar.xz $FLUTTER_VERSION && tar xf flutter.tar.xz -C /
 
 # Switch back to dialog for any ad-hoc use of apt-get
 ENV DEBIAN_FRONTEND=''