Skip to content

Installing Flutter, VS Code and Android Studio on Debian 11

Flutter, Dart, and Andriod Studio are specifically used for mobile application development.

When you install Flutter, you also get the Dart SDK installed on your system. This means that you can use the Dart programming language to write Flutter apps without needing to install the Dart SDK separately.

Flutter relies heavily on Dart for its development, and many of the key Flutter concepts, such as widgets, are implemented using Dart classes and objects. By using Dart, Flutter can take advantage of features like hot reload, which allows you to see changes to your app in real-time as you make code edits, and compile-time optimizations that can improve the performance of your app.

Dart is an integral part of the Flutter development environment and is included with the Flutter SDK. If you’re developing Flutter apps, you’ll be using Dart for your coding.

Visual Studio Code is used because it is a lightweight IDE that will be good for Flutter App development.

Android Studio is installed because Flutter will need some of its components for Android application development. Further, the emulators that are bundled with Android Studio SDK can be used for emulating Android devices to test the applications developed using Flutter and those emulators can be accessed from VS Code environment also.  That is why we will need Android Studio.

The Hardware Requirements

The following are the hardware requirements for installing Flutter, VS Code, and Android Studio on Debian:

  1. Flutter:
  • Disk space: The Flutter SDK requires approximately 600 MB of disk space for the installation. However, you may need additional space for storing the Android SDK and other development tools.
  • RAM: Flutter can run on systems with as little as 4 GB of RAM, but 8 GB or more is recommended for optimal performance.
  • CPU: A multi-core CPU is recommended, but a dual-core CPU should suffice.
  1. VS Code:
  • Disk space: VS Code requires approximately 200 MB of disk space for the installation.
  • RAM: VS Code can run on systems with as little as 1 GB of RAM, but 4 GB or more is recommended for optimal performance.
  • CPU: A dual-core CPU is recommended, but a single-core CPU should suffice.
  1. Android Studio:
  • Disk space: The Android Studio installation requires approximately 2-3 GB of disk space, but you may need additional space for storing the Android SDK and other development tools.
  • RAM: Android Studio can run on systems with as little as 4 GB of RAM, but 8 GB or more is recommended for optimal performance.
  • CPU: A quad-core CPU is recommended, but a dual-core CPU should suffice.

The specific hardware and storage requirements may vary depending on the size and complexity of your projects and the components needed for your application.

Flutter

Flutter is a mobile app SDK (Software Development Kit) created by Google that allows developers to build high-performance, visually attractive, and natively compiled applications for mobile, web, and desktop platforms, using a single codebase. Flutter uses the Dart programming language, which was also developed by Google and comes with its own set of libraries, widgets, and tools for developing applications.

One of the key benefits of Flutter is that it enables developers to build beautiful, responsive, and fluid user interfaces (UIs) quickly and easily, with the help of its extensive library of customizable widgets. Flutter also has a hot-reload feature, which allows developers to see the results of changes they make to the code in real-time, without having to restart the app. This makes the development process faster and more efficient.

Flutter also has several other features that make it a popular choice for mobile app development, including its ability to integrate with other programming languages and platforms, its strong community support, and its ability to create apps that run seamlessly on multiple platforms. Overall, Flutter is a powerful and flexible tool for building high-quality mobile, web, and desktop apps, and it is becoming increasingly popular among developers around the world.

Dart

Dart is an object-oriented, garbage-collected programming language created by Google in 2011. It was designed to be fast, efficient, and scalable, and was initially intended to be used for building web applications. However, with the introduction of the Flutter SDK, Dart has gained popularity as a programming language for building mobile and desktop applications as well.

Dart is similar in syntax to other programming languages like Java and C++, but it also has several unique features that set it apart. For example, Dart has a concise and easy-to-read syntax, which makes it easy to learn and use. It also supports both just-in-time (JIT) and ahead-of-time (AOT) compilation, which makes it fast and efficient for running code on different platforms.

One of the key features of Dart is its support for asynchronous programming, which allows developers to write code that runs in the background while the main thread of the application continues to execute. This is particularly useful for building mobile and web applications, where responsiveness and performance are critical.

Overall, Dart is a versatile and powerful programming language that is well-suited for building a wide range of applications, from web and mobile apps to server-side applications and beyond. Its clean syntax, support for asynchronous programming, and strong type system make it a popular choice for developers around the world.

It is possible to use Flutter and Dart without any IDE environment. But, for better development, we may use Flutter and Dart under Visual Studio Code. For the installation of Visual Studio Code, one may follow a procedure like the below one (without the ns-3 configuration part)

Visual Studio Code

Visual Studio Code, often abbreviated as VS Code, is a free and open-source code editor developed by Microsoft. It is widely used by developers for a variety of programming languages and platforms, including web development, mobile development, and cloud computing.

VS Code offers a number of features that make it a popular choice among developers, including a highly customizable user interface, support for debugging and testing code, and built-in support for popular version control systems like Git.

One of the key features of VS Code is its extension marketplace, which allows developers to add new features and functionality to the editor by installing extensions. There are thousands of extensions available in the marketplace, including syntax highlighting for new languages, code snippets, and integration with popular development tools like Docker and Kubernetes.

VS Code also includes a range of productivity features, such as IntelliSense, which provides smart code completion suggestions based on the context of the code, and the ability to split the editor window into multiple panes for viewing and editing multiple files simultaneously.

Overall, Visual Studio Code is a versatile and powerful code editor that is well-suited for a wide range of programming tasks. Its highly customizable interface, an extensive marketplace of extensions, and a range of productivity features make it a popular choice among developers around the world.

Installing VS Code under chroot and configuring it for ns-3

Install Flutter Extension on VS Code

Installing the Dependencies

$ sudo apt update
$sudo apt install curl file git unzip xz-utils zip libglu1-mesa 
$ sudo apt install clang cmake ninja-build pkg-config libgtk-3-dev

Android Studio

Android Studio is an integrated development environment (IDE) created by Google, specifically for developing Android applications. It provides a complete set of tools and features to help developers build, test, and debug Android apps, and it is widely considered to be one of the best tools available for Android development.

Android Studio is based on the IntelliJ IDEA IDE, and it provides a user-friendly interface that makes it easy to create and manage Android projects. It includes a code editor with advanced features like syntax highlighting, code completion, and refactoring tools, as well as a visual layout editor that allows developers to create the UI for their apps using drag-and-drop tools.

In addition to these core features, Android Studio also provides a range of other tools and features to help developers build high-quality Android apps. These include tools for debugging and profiling apps, a built-in emulator for testing apps on different Android devices, and integration with version control systems like Git.

Android Studio also comes with a range of templates and code samples to help developers get started with their projects quickly, as well as comprehensive documentation and tutorials to help developers learn how to use the IDE effectively.

Overall, Android Studio is an essential tool for any Android developer, and it is constantly updated with new features and improvements to help developers build better and more innovative Android apps.

Installing Android Studio 

For the example app shown in this article, we need to install Android Studio only to use some of its components from the VS Code environment. So, after completion of this, we will not use its IDE for this example app development. Here, the IDE is only used to install the necessary components and configure it; so that it can be used from  VS Code environment for a Flutter/Dart Project.

We may download Android Studio using this link and install it as follows:

 $ cd Downloads
 $ tar xvf android-studio-*-linux.tar.gz
 $ sudo mv android-studio /opt/
 $ /opt/android-studio/bin/./studio.sh

We have to add the following environment variable in .bashrc and restart the shell.

export PATH=$PATH:~/Android/Sdk/cmdline-tools/latest/bin

We may start the Android Studio IDE as follows :

$ /opt/android-studio/bin/./studio.sh

Android Studio and the necessary SDK components will be bulk in nature. In fact, most of the components will automatically get installed during running the IDE of the first time. After that, we may install additional components.

The following screenshot shows the way to install SDK command line tools from the settings menu (this will be needed by VS Code environment).

Optional

If you wish to use Flutter and Dart under Android Studio IDE, then you have to install Flutter Extension as follows:
If you wish to start a new Flutter project on Android Studio IDE, then you have to start is by pressing “File -> New Flutter Project” from the top menu and configure it as shown below:
But, before trying to start a Flutter project on Android Studio IDE we have to complete the installation of Flutter as shown below. Keep in mind that, using Flutter it self will need some components of Android Studio. So, we may successfully able to compile and run a Flutter Project on VS Code IDE only after successfully completing the installation of  VS Code, Android Studio (and its components), Flutter.

Install Flutter

Download Flutter

Download Flutter From the following link:

https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.7.11-stable.tar.xz

Extract it

$ cd /home/yourhome 
$ tar xvf ~/Downloads/flutter_linux_3.7.11-stable.tar.xz

The following screenshot shows the successful installation of Flutter under the home folder.

 

Export the Flutter Path

Add the following line in the .bashrc file and restart the shell.

export PATH="$PATH:/home/jason/flutter/bin"

Test Flutter Version

$ flutter --version

 

The following screenshot shows the output of the command “flutter –version”

Diagnose Flutter Installation

$ flutter doctor

The following output of the command “flutter doctor” shows some of the problems with the installation.

Set Environment Variables

Check your version of JDK and its installation path and set the environment variables accordingly.

Check your java version as follows:

 

If there is no Java/JDK available, then install it as follows :

$sudo apt install default-jre

 

Add the necessary environment variable in the .bashrc file.

JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
# set PATH so it includes user's private bin directories
PATH="$HOME/bin:$HOME/.local/bin:$PATH"
export PATH=$PATH:~/Android/Sdk/cmdline-tools/latest/bin

If we resolve all the missing things and path-related discrepancies and SDK related discrepancies, the command “flutter doctor” will show the following output.

Starting an Example Application using VS Code

The following screenshot shows the example application of Flutter/Dart that was compiled on Visual Studio Code as a Linux Application and running on the emulator.

The following screenshot shows the example application of Flutter/Dart that was compiled on Visual Studio Code as a Web Application and running on the emulator.

 

The following screenshot shows the example application of Flutter/Dart that was compiled on Visual Studio Code as an Android Application and running on the Android Mobile Emulator. Here it is running on a simulated Google Pixel mobile!

 

 

Note: This article is nothing but my learning log.  Since it is not related to any serious research or research simulation, no further support will be provided on this area. So, please do not ask any questions through e-mail regarding this article or related to this area – simply you will not get any answers from me.

 

References

  1. https://dev.to/fullstackhacker/install-flutter-on-debian-3g3h
  2. https://docs.flutter.dev/get-started/install/linux
  3. https://codelabs.developers.google.com/codelabs/flutter-codelab-first#0

    Hidden Section! Contact Charles  

    The key/passphrase will be given once you have been approved for getting paid research support/assistance from Charles. To get paid support, you may start a 'free' research discussion.  

    WhatsApp chatDiscuss Through WhatsApp
     

WhatsApp Discuss Through WhatsApp