DEV Community

Cover image for Flutter Development for Low end PCs
Chamal Randika
Chamal Randika

Posted on

Flutter Development for Low end PCs

This is a dead simple and minimal dev workflow setup for flutter development.

Aight first up, let's see the memory footprint

These screenshots are taken from my Hyprland setup which is a very minimal Desktop Setup.

FLutter-with-low-end-pc

You can see that neovim is taking only 41mb of RAM while scrcpy is taking 181mb of RAM. These two apps replaces the VsCode and Android emulator which results in like 90% memory freeing.

With Hyprland, my complete setup when running the emulator and code editor is still under 4GB of RAM.

And with everything configured, this is how the setup looks;

Neovim and flutter with scrcpy

Ingredients:

  1. A package manager - to install stuff easily
  2. Neovim - for code editing
  3. Android studio - for managing the android sdk
  4. Flutter sdk - duh.!
  5. Scrcpy - android screen mirroring tool
  6. Your android phone - for the emulation (assuming it is above android version 5)

Steps:

  1. Setup package manager.

    Linux:
    you already have a package manager built in!

    macOS:

    # skip the first command if you already have  homebrew installed.
    /bin/bash -c "$(curl -fssl https://raw.githubusercontent.com/homebrew/install/head/install.sh)"
    

    Windows:

  2. Install neovim (skip if deciding to use VsCode).

    Install neovim and configure it work with flutter. if you aren't familier with vim motions, you can swap this step with vscode but it will increase the memory footprint when running everything. But it will still be better than running the emulator with VsCode.

    Linux:

    sudo pacman -s neovim # if you're on arch linux, for other distros, google it up
    
    

    macOS:

    brew install neovim
    

    Windows:

    choco install neovim
    
  3. Install android studio.

    Linux:

    yay -s android-studio # if you're on arch linux, for other distros, google it up
    

    macOS:

    brew install --cask android-studio
    

    Windows:

    choco install androidstudio
    
  4. Install flutter sdk.

    Linux:

    yay -s flutter-bin
    

    macOS:

    brew install --cask flutter
    

    Windows:

    choco install flutter
    
  5. Flutter Setup (skip if you're VsCode and Install dart and flutter extensions instead):
    Follow this guide to setup flutter tools with neovim (yeah it is lengthy but it's worth for the profit) - https://www.etiennetheodore.com/building-flutter-application-with-neovim/.

  6. Install scrcpy.

    Linux:

    yay -s scrcpy
    

    macOS:

    brew install scrcpy
    

    Windows:

    choco install scrcpy
    
  7. Enable usb debugging in your android device.

    a. Tap build number 7 times and enable developer. options
    b. Go to it and enable usb debugging.

  8. Authorize your phone with adb.

    a. Connect your phone via a usb cable to your pc/mac.
    b. Type adb devices.
    c. A prompt will come in your phone to authorize the device.
    d. After that just plug out and re-plug your device to computer.

  9. Now create a new flutter project or open and existing one with neovim.

    a. cd into your flutter project folder and type nvim ..
    b. Then press : symbol and type flutterRun in neovim. this is a command provided by flutter-tools neovim plugin. you can learn all the commands it offers through their GitHub repo.

  10. Mirror the screen using scrcpy.

    scrcpy --turn-screen-off
    
  11. that's it!
    You now have a very fast flutter emulator just beside your code editor. this can also setup to connect wirelessly. more on that in a future article.

Thank You for reading. Share if you think this is useful.

Top comments (0)