Setting up flutter development env and project — macOS

Aishwary Raj
Codalyze
Published in
3 min readApr 3, 2020
Flutter — reasons to get into flutter development

Background: I have been working on mobile application development with react-native and native android in past. So, If you are coming from React Native background, some references could be there.

The story will be in the steps followed to get started rather than more descriptive. For any cross platform development, we need to ensure couple of things while getting started.

  • Pre-requisite tools for android and iOS development.
  • Install dependencies/update platform tools.
  • Check flutter installations and validate the installation.
  • Create a new project.
  • Run the project
  • Measure release APK size [this should be in consideration to know how we can reduce the size]

Let’s start with the steps:

Pre-requisite tools for android and iOS development, dependencies/update platform tools:

Android Studio — I would recommend installing with Jetbrains toolbox for easy updates and other tools [https://www.jetbrains.com/toolbox-app/].
Install latest Android Studio, SDK and platform-tools if you don’t have already.

Xcode — At the time of installation, I have Xcode11 installed. (Install from appstore or developer account if not already installed).

Check flutter installations and validate the installation:

Now, We can follow getting started steps mentioned on “flutter.dev” [https://flutter.dev/docs/get-started/install/macos]

- Download flutter sdk from the link
https://storage.googleapis.com/flutter_infra/releases/stable/macos/flutter_macos_v1.12.13+hotfix.9-stable.zip
- Unzip flutter SDK
cd ~/development
unzip ~/Downloads/flutter_macos_v1.12.13+hotfix.9-stable.zip
- Add path in bash file to use flutter command[sdk]
export PATH="$PATH:${HOME}/dev/flutter-dev/flutter/bin"
- Platform specific binaries installation(optional):
flutter precache

After installing dependencies, You will get to see similar screen.

flutter precache

Check development tools installed correctly.

  • Run “flutter doctor”

There could be some warnings and issues, that we will need to be resolved.
In my case, licenses were not updated. to update them run “flutter doctor — android-licenses”

After successful installation, flutter doctor command should return following results.

flutter doctor

Creating a flutter project:

  1. New flutter project.

2. add project configurations

3. Finish and run the project(I ran it on iOS simulator from android studio itself, it’s quite handy to run from studio).

4. At this point, You will be able to run the flutter project in debug mode.

Measure release APK size:

Now let’s check for the release APK size. What’s the initial size for applications built with flutter ?

I’m building the APK for arm architecture. Below is command to generate it:

It generated 5.1MB apk. Size can be reduced by removing flutter unused libs or generating split apks/bundle that i will be covering in the upcoming blogs.

Try flutter mobile development [android and iOS], If you find any issues following up above steps to setup your environment, Please drop comments or you can write me at https://twitter.com/aishwary0912

--

--

Aishwary Raj
Codalyze

ApplicationDeveloper@Codalyze. #ReactNative #React #JsDev #AWS