Flutter is Google’s mobile app SDK for crafting high-quality native interfaces on iOS and Android in record time. Flutter works with existing code, is used by developers and organizations around the world, and is free and open source.
Top articles for flutter
Building a news app
Best Video Tutorials Of Flutter To Develop Application For Android & ios
Music Player in Flutter
Weather forecast with rain app in Flutter
Flutter — Container Cheat Sheet
Image Credit: Google
As per Flutter documentation you should fulfill below requirement to run Flutter development environment on your machine.
- Operating Systems: Linux (64-bit)
- Disk Space: 600 MB (does not include disk space for IDE/tools).
- Tools: Flutter depends on these command-line tools being available in your environment.
Install Flutter SDK
Flutter is currently in Beta, you can download latest version of Flutter from this url
While writing this article, the current version is 0.3.2 beta
Go to directory where you want to extract the file. For example I want to extract this in my Documents directory.
Now run below command to extract the file in the current directory
$ tar xf ~/Downloads/flutter_linux_v0.3.2-beta.tar.xz<span style="font-size: 1rem;"> </span>
To be able to run flutter command from terminal we need to add it to our path.
This will temporarily add flutter to path, we need to make it permanent so that it will be available on restart also.
$ source $HOME/.bash_profile
To check if it has been added to path
You should see the flutter path in the output.
Flutter comes with a handy doctor command through which you can see if all dependencies have been installed or not on your computer to run a flutter development environment.
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.3.2, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[✓] Android Studio (version 3.1)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.23.1)
[!] Connected devices
! No devices available
! Doctor found issues in 1 category.
You can upgrade flutter by running
Setup Android Studio
You should have android studio installed on your machine. To install the latest version of it, visit https://developer.android.com/studio/
Configure Text Editors
Refer this link to setup Flutter in Android Studio –
To setup flutter in Visual Studio Code, refer this link
Setup Device to run the application (From flutter.io)
To prepare to run and test your Flutter app on an Android device, you’ll need an Android device running Android 4.1 (API level 16) or higher.
- Enable Developer options and USB debugging on your device. Detailed instructions are available in the Android documentation.
- Windows-only: Install the Google USB Driver
- Using a USB cable, plug your phone into your computer. If prompted on your device, authorize your computer to access your device.
- In the terminal, run the
flutter devices command to verify that Flutter recognizes your connected Android device.
- Start your app by running
By default, Flutter uses the version of the Android SDK where your
adb tool is based. If you want Flutter to use a different installation of the Android SDK, you must set the
ANDROID_HOME environment variable to that installation directory.
Set up the Android emulator
To prepare to run and test your Flutter app on the Android emulator, follow these steps:
- Enable VM acceleration on your machine.
- Launch Android Studio>Tools>Android>AVD Manager and select Create Virtual Device.
- Choose a device definition and select Next.
- Select one or more system images for the Android versions you want to emulate, and select Next. An x86 or x86_64 image is recommended.
- Under Emulated Performance, select Hardware – GLES 2.0 to enable hardware acceleration.
- Verify the AVD configuration is correct, and select Finish.For details on the above steps, see Managing AVDs.
- In Android Virtual Device Manager, click Run in the toolbar. The emulator starts up and displays the default canvas for your selected OS version and device.
- Start your app by running
flutter run. The connected device name is
Android SDK built for <platform>, where platform is the chip family, such as x86.
The tar command in Linux is used to compress or create an archive of a directory with .tar.gz or .tgz archive files, they are also called “tarballs”.
tar -zcvf archive-file-name.tar.gz source-directory-name
Here tar is creating a archive named “archive-file-name.tar.gz” of “source-directory-name”.
-z = Compress the archive with gzip
-c = Creates a new .tar archive file
-v = Verbose, show .tar file progress
-f = Archive File name
Exclude particular directory or file
To exclude a file or directory from being added in the archive use –exclude option
tar -czvf archive-file-name.tar.gz /images/wallpaper --exclude /images/wallpaper/dogs
Compress multiple directories in single archive
tar -czvf archive-file-name.tar.gz /images/wallpaper /home/deven/Documents/notes.txt
You can add any no of directories or files you want to achive
How to Extract Archive
tar -xzvf archive-file-name.tar.gz
As you can see the only difference between creating an archive and extracting an archive is -x switch replace -c switch.
If you want to move your git repository from one server to another or say from github.com to gitlab.com or from your own server to another server, follow below steps to transfer your repo.
Step 1 – Create a bare clone of your existing git repository
$ git clone --bare https://github.com/your-existing-git-repo-link.git
Step 2 – Now cd into the newly created directory ‘your-existing-git-repo-link.git‘ and fetch all branches
Step 3 – We have all the branches on our local machine, lets push it to new server
$ git push --mirror https://gitlab.com/your-new-repository.git
That’s it, you have shifted your git repo.
Moving a website having large number of files from one server to another can be a can be a daunting task. If you are not using any version control like Git then you need to first download the whole application on your local computer and then upload to the designation server.
This is a time consuming process considering the number of files. So in this post I am going to tell you a much faster approach to tackle this problem using a utility called ‘rsync’.
Run this command to check if it is already installed on your machine,
If you see something like then it is already installed on your machine
You need to install it if it the output is blank.
Copyright (C) 1996-2014 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
append, ACLs, xattrs, iconv, symtimes, preallocrsync comes with ABSOLUTELY NO WARRANTY. This is free software, and you
are welcome to redistribute it under certain conditions. See the GNU
General Public Licence for details.
To install Rsync on your machine
Now to communicate between your old VPS and new VPS we need to have Rsync installed on your old VPS as well. So log into your old VPS and check if Rsync is installed on it, if not then follow above step to install it.
Rysnc needs to be able log into your new server from your old server to transfer files. Run below command to generate a key, if you do not have one generated already.
ssh-keygen -t rsa -b 4096 -v
Lets transfer the key from your old server to new one through below command
ssh-copy-id 101.201.301.401 ( Replace IP with your server's ip address)
Now you are ready to start transfer of files from your old VPS to new VPS, log into your old VPS and enter below command
rsync -avP my-project <span class="highlight">190.201.303.404</span>:/var/www/html/my-project
in the above command
my-project = is the directory that you want to transfer
190.201.303.404 = destination VPS IP address
/var/www/html/my-project = path where you want to store the files on destination server.
You can use –progress option to see the progress.
If you are building a React Native application for Android by running
and you are still getting the default React native screen,
follow below steps to fix this issue.
1.Create assets directory in android/app/src/main
<span class="pln">mkdir android</span><span class="pun">/</span><span class="pln">app</span><span class="pun">/</span><span class="pln">src</span><span class="pun">/</span><span class="pln">main</span><span class="pun">/</span><span class="pln">assets</span>
2. Clear your build cache by running below command from root of your application
react-native start --reset-cache
3. After this run
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
4. Now build the application by running, you should see the changes
If you are switching from Windows to Linux based operating system, then it might be difficult in early days to get hang of it. Here are some commands that will be useful.
- If you want to find out size of current directory, just type
2. Check your disk usage
$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 1.9G 0 1.9G 0% /dev
tmpfs 388M 12M 377M 3% /run
/dev/sda6 407G 59G 328G 16% /
tmpfs 1.9G 83M 1.9G 5% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/sda2 96M 32M 65M 34% /boot/efi
tmpfs 388M 60K 388M 1% /run/user/1000
3. See all files and directory size in current path
$ ls -lh
-rw-r--r-- 1 deven deven 75K Jul 4 2017 1470493410_1499166814.jpg
drwxrwxr-x 15 deven deven 4.0K Mar 17 11:54 ach-hq
-rw-rw-r-- 1 deven deven 35K Jun 28 2017 address.php
drwxrwxr-x 4 deven deven 4.0K Jul 15 2017 bil 2
-rw-rw-r-- 1 deven deven 355K Jul 15 2017 bill 2.zip
drwxrwxr-x 3 deven deven 4.0K Jul 29 2017 book_ge_api
-rw-rw-r-- 1 deven deven 96K Aug 8 2017 cities.sql
drwxrwxr-x 13 deven deven 4.0K Jun 27 2017 clon
4. Truncate log files
truncate -s 0 /path-to-log-file/log.log
5. List content of a directory using ls command
6. If you want to know about a command, you can take of man command, for example if you want to go into details of ls command, just type
It will give you an output something similar to this
ls - list directory contents
ls [OPTION]... [FILE]...
List information about the FILEs (the current directory by default). Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.
Mandatory arguments to long options are mandatory for short options too.
do not ignore entries starting with .
do not list implied . and ..
with -l, print the author of each file
I will be updating this with more useful commands as and when I found.
I run a web development agency and most of the time it happens that we create servers for client in our own Digital Ocean account during the development phase. When project gets over we usually transfer the ownership of the droplet to client. I have seen Digital Ocean customers
struggling with the transfer of ownership of droplet.
So here is I am giving a simple step by step guide to transfer a droplet from one Digital Ocean account to another.
Step 1: Take a snapshot of droplet
We need to first take a snapshot of the droplet that you want to transfer. You can either take a live snapshot which doesn’t require shutting down the droplet or to avoid any data loss just power off the droplet before taking snapshot. You can power off the droplet from the control panel or by logging into server through ssh.
Enter the name of snapshot and click on “Take Snapshot” button.
Step 2: Enter recipient owner digital account email address
Once the snapshot is ready, click on “Change Owner” option. It will prompt to enter recipient email address. Enter the address of the account to which you want to transfer the droplet.
Step 3: Accept snapshot transfer
Now log into the control panel of the recipient account. Go to Images and then Snapshots. You will see the snapshot that you had transferred to this account. Click on Accept to complete the transfer process.
Step 4: Create a new droplet from snapshot
Since we have the snapshot with us now, we need to create a droplet from this snapshot. To Click on “Create Droplet” option from menu and select the appropriate plan for your droplet, and your droplet is ready!
Comodo offers a wide range of SSL certificates to suit a diverse range of business requirements and budgets.
Follow below steps to install comodo positive ssl certificate on your ubuntu server.
Step 1 – Before applying for a certificate we need to submit Certificate Signing Request (CSR) to Certificate Authority (CA). Run below command on your server
openssl req -new -newkey rsa:2048 -nodes -keyout example_com.key -out example_com.csr
* replace example_com with your domain name if you want to
It will ask following details
- Organization Name
- Organizational Unit
- Country Code
- State / Province
- Common Name – This is the domain name for which you want to purchase SSL certificate
After providing above mentioned details this command will create two files
- example_com.key – Your private key which you need to configure Apache or Nginx
- example_com.csr – CSR
Step 2 – Apply for the certificate and provide content of CSR file
Step 3 – After submitting CSR, CA will send you an email on email selected by you. You should get your SSL certificate after verifying your domain.
Your certificate zip file will contain
example_com.crt – Your ssl certificate
AddTrustExternalCARoot.crt – Root CA certificate
COMODORSAAddTrustCA.crt – Intermediate CA certificate
COMODORSADomainValidationSecureServerCA.crt – Intermediate CA certificate
Step 4 – Create a bundle of all crt files
cat www_example_com.crt COMODORSADomainValidationSecureServerCA.crt COMODORSAAddTrustCA.crt AddTrustExternalCARoot.crt > ssl-bundle.crt
Step 5 – Configuring Apache web server to serve website over HTTPS
Step 6 (Optional) – Configure Nginx to serve website over HTTPS
Using nvmNVM, which stands for “Node.js version manager” we can install multiple versions of nodejs on Ubuntu.
or using Wget:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
Run the script by running
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
To get the list of available Node.js versions
nvm install 6.0.0
nvm use 6.0.0