Homebrew Flutter



  1. Homebrew Flutter Guide
  2. Homebrew Flutter Game
  3. Homebrew Flutter Pokemon
  4. Homebrew Flutter Game
  5. Homebrew Flutter Sdk Path

Setting up a Flutter development environment on Mac OSX

Homebrew installs the stuff you need that Apple (or your Linux system) didn’t. $ brew install wget Homebrew installs packages to their own directory and then symlinks their files into /usr/local. Jan 28, 2020 The official way to install the flutter and its dependencies is a mishmash of brew install, binary downloads alongside relying on system installed versions of ruby. I became particularly frustrated when trying to setup flutter on macOS Mojave and macOS Catalina.

Here is the the steps I’m usually taking when reinstalling my Mac OS from scratch (or when buying a new Mac) to have a completed environment to Flutter development.

Install and run Xcode

If you want to write and test your Flutter code for iOS you’l definitely need Xcode.

So open the AppStore application and search for “xcode”:

It’ll take a long time to download and install it depending on your Internet connection and machine speed.

When Xcode downloaded and installed, run it for the first time. Accept ro the License Agreement:

Xcode then will install additional components:

After installation of components is completed continue to Install Flutter.

Install Flutter

Go to official Flutter site and Download a Flutter binaries

Create a folder to keep Flutter binaries. Personally I prefer to create “Developer” folder in my home directory because it have a cute “Developer” icon 🙂

Open Mac OS Terminal: Go to Applications -> Utilities -> Terminal

!!! Keep the Terminal App open, we’ll need a lot of tasks there !!!

In Terminal unpack the downloaded Flutter files:

% cd ~/Developer

$ unzip ~/Downloads/flutter-<version_here>.zip

Developer % tar xvf ~/Downloads/flutter_macos_v1.12.13+hotfix.8-stable.zip

If you using Safari with default preferences it’ll unpack the archive automatically after download. In such case simply drag “flutter” folder from your “Downloads” to the directory you created (in my case it’s “Developer” folder).

Next setup a PATH for Mac OS for Flutter binaries.

I’m using a Mac OSX Catalina, and they have changed the default shell to zsh, previously it was a bash. So, for Catalina we need to create a .zshrc file in our home directory, for older version you’ll need to edit or create a .bash_profile file. Look for the PATH section on Flutter download page for details.

Execute the following command in Terminal:

% nano -w ~/.zshrc

Put the following line in nano text editor:

export PATH='$HOME/Developer/flutter/bin:$PATH'

(Change the Flutter path for the directory where you put your Flutter binaries)

This file will be loaded after the next login. To check this and to move further with Flutter, let’s execute some commands in Terminal. First let’s use .zshrc for current Terminal session:

% source ~/.zshrc

Let’s check if we have access to Flutter binaries:

% which flutter

You’ll receive a line like this:

/Users/ikarelin/Developer/flutter/bin/flutter

Let’s make Flutter precache:

% flutter precache

If you don’t have a Java JDK installed on your machine, you’ll receive a next message:

And Mac OS will offer to to install a JDK:

Flutter

If you click on “More Info” you’ll be directed to Adobe Flash Plugin site, which useless for us now 🙂 So, to get Java JDK go to:

Find a Mac OS installer file:

Accept Agreement and download Installer.

Install downloaded package. After the installation check if you have java on your machine:

You can run “flutter precache” again to check if there is no more Java warnings if you want 🙂

Install Cocoapods

Cocoapods is used for Flutter iOS development. Not actually only in Flutter, also when you’re making an apps in Xcode for iOS.

As for Flutter, when you’re adding a Dart packages to your project in pubsec.yaml, they are “translating” to Cocoapods libraries for iOS build.

So, let’s install Cocoapods. Open Terminal and paste:

% sudo gem install cocoapods

After the installation check Cocoapods version:

(My current version is 1.9.1)

Install Homebrew

Homebrew contains additional libraries to connect to your iOS Simulator or for real iPhone/iPad device, if you’re testing on real gadgets.

Official page of Homebrew:

Copy and paste the following command to Terminal to install Homebrew:

% /bin/bash -c '$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)'

Installation of Homebrew will take some time,

Mac will show an alert that you have updates to install (Xcode command line tools).

Don’t install the updates, the alert will go away soon.

Install Intellij IDEA

Let’s install IntelliJ IDEA . Go to the downloads page and get it:

Mac

Community Edition is enough to developing in Flutter and it’s FREE.

Install it as usual on Mac – just drag it into your Application folder:

We don’t need to import anything, it’s a fresh instal, just press “OK”l:

Choose appearance, plugins of your choice, I’m just clicking “Next” there.

Now let’s push “Configure” and select “Plugins” from menu:

Type “Flutter” in the Search Field:

Press “Install” on the top “Flutter”, it’ll ask for install a Dart plugin, accept all what it’s asking.

I strongly recommend to install “Flutter Snippets” plugin and “Flutter Enhancement Suite”.

They’ll save you a lot of typing and mistypings 🙂

After installing plugins press “Restart IDE”. IDEA will be restarted for sure 🙂

Adding Android SDK

Now it’s time to run “flutter doctor” command in Terminal:

You’ll receive the next output:

The items marked with the Red Cross must to be fixed. So, we missed Android SDK.

Let’s fix it. Open IDEA and select “Create a new project”:

Select “Flutter” and click “Next”:

Type som project name and click “Finish::

Go To InelliJ IDEA – > Preferences:

In the Search field type “SDK”:

Press “Edit” at “Android SDK Location:

You’ll be presented with “SDK Components Setup” window, press “Next” here.

The next window is “Verify Settings”, press “Next”.

After the process of downloading/installing is complete, press “Finish” button.

Homebrew Flutter Guide

I’m STRONGLY recommend on this step to install “Android 9.0 (Pie), API level 28 here.

A lot of Dart plugins depends on it and you’ll receive a lot of compilation errors when you’ll start compiling your Flutter code to Android.

So just check “Android 9.0 (Pie) and press “Apply”. It’ll take some additional space on your Hard Drive though 🙂

Accept the licenses.

Now you are ready to write a cool Flutter Apps in Mac and IDEA IDE.

Hope you’ll write a lot of cool Flutter code 🙂

Contents
  • Get the Flutter SDK
  • Android setup

System requirements

To install and run Flutter,your development environment must meet these minimum requirements:

  • Operating Systems: Windows 7 SP1 or later (64-bit), x86-64 based
  • Disk Space: 1.64 GB (does not include disk space for IDE/tools).
  • Tools: Flutter depends on these tools being available in your environment.
    • Windows PowerShell 5.0 or newer (this is pre-installed with Windows 10)
    • Git for Windows 2.x, with theUse Git from the Windows Command Prompt option.

      If Git for Windows is already installed, make sure you can run git commands from the command prompt or PowerShell.

Get the Flutter SDK

  1. Download the following installation bundle to get the lateststable release of the Flutter SDK:

    For other release channels, and older builds, see theSDK releases page.

  2. Extract the zip file and place the contained flutterin the desired installation location for the Flutter SDK(for example, C:srcflutter).

Warning: Do not install Flutter in a directory like C:Program Files that requires elevated privileges.

If you don’t want to install a fixed version of the installation bundle, you can skip steps 1 and 2. Instead, get the source code from the Flutter repo on GitHub, and change branches or tags as needed. For example:

You are now ready to run Flutter commands in the Flutter Console.

Update your path

If you wish to run Flutter commands in the regular Windows console,take these steps to add Flutter to the PATH environment variable:

  • From the Start search bar, enter ‘env’and select Edit environment variables for your account.
  • Under User variables check if there is an entry called Path:
    • If the entry exists, append the full path to flutterbin using; as a separator from existing values.
    • If the entry doesn’t exist,create a new user variable named Path withthe full path to flutterbin as its value.

You have to close and reopen any existing console windowsfor these changes to take effect.

Homebrew Flutter Game

Note: As of Flutter’s 1.19.0 dev release, the Flutter SDK contains the dart command alongside the flutter command so that you can more easily run Dart command-line programs. Downloading the Flutter SDK also downloads the compatible version of Dart, but if you’ve downloaded the Dart SDK separately, make sure that the Flutter version of dart is first in your path, as the two versions might not be compatible. The following command tells you whether the flutter and dart commands originate from the same bin directory and are therefore compatible.

As shown above, the command dart from the Flutter SDK doesn’t come first. Update your path to use commands from C:path-to-flutter-sdkbin before commands from C:path-to-dart-sdkbin (in this case). After restarting your shell for the change to take effect, running the where command again should show that the flutter and dart commands from the same directory now come first.

However, if you are using PowerShell, in it where is an alias of Where-Object command, so you need to use where.exe instead.

To learn more about the dart command, run dart -h from the command line, or see the dart tool page.

Homebrew Flutter Pokemon

Run flutter doctor

From a console window that has the Flutter directory in thepath (see above), run the following command to see if thereare any platform dependencies you need to complete the setup:

This command checks your environment and displays a report of the statusof your Flutter installation. Check the output carefully for othersoftware you might need to install or further tasks to perform(shown in bold text).

For example:

The following sections describe how to perform these tasks andfinish the setup process. Once you have installed any missingdependencies, you can run the flutter doctor command again toverify that you’ve set everything up correctly.

Note: If flutter doctor returns that either the Flutter plugin or Dart plugin of Android Studio are not installed, move on to Set up an editor to resolve this issue.

Warning: The flutter tool uses Google Analytics to anonymously report feature usage statistics and basic crash reports. This data is used to help improve Flutter tools over time.

Flutter tool analytics are not sent on the very first run. To disable reporting, type flutter config --no-analytics. To display the current setting, type flutter config. If you opt out of analytics, an opt-out event is sent, and then no further information is sent by the Flutter tool.

By downloading the Flutter SDK, you agree to the Google Terms of Service. Note: The Google Privacy Policy describes how data is handled in this service.

Moreover, Flutter includes the Dart SDK, which may send usage metrics and crash reports to Google.

Android setup

Note: Flutter relies on a full installation of Android Studio to supply its Android platform dependencies. However, you can write your Flutter apps in a number of editors; a later step discusses that.

Install Android Studio

  1. Download and install Android Studio.
  2. Start Android Studio, and go through the ‘Android Studio Setup Wizard’.This installs the latest Android SDK, Android SDK Command-line Tools,and Android SDK Build-Tools, which are required by Flutterwhen developing for Android.

Set up your Android device

To prepare to run and test your Flutter app on an Android device,you need an Android device running Android 4.1 (API level 16) or higher.

  1. Enable Developer options and USB debugging on your device.Detailed instructions are available in theAndroid documentation.
  2. Windows-only: Install the Google USBDriver.
  3. Using a USB cable, plug your phone into your computer. If prompted on yourdevice, authorize your computer to access your device.
  4. In the terminal, run the flutter devices command to verify thatFlutter recognizes your connected Android device. By default,Flutter uses the version of the Android SDK where your adbtool is based. If you want Flutter to use a different installationof the Android SDK, you must set the ANDROID_SDK_ROOT environmentvariable to that installation directory.

Homebrew Flutter Game

Set up the Android emulator

To prepare to run and test your Flutter app on the Android emulator,follow these steps:

Homebrew Flutter Sdk Path

  1. EnableVM accelerationon your machine.
  2. Launch Android Studio, click the AVD Managericon, and select Create Virtual Device…
    • In older versions of Android Studio, you should insteadlaunch Android Studio > Tools > Android > AVD Manager and selectCreate Virtual Device…. (The Android submenu is only presentwhen inside an Android project.)
    • If you do not have a project open, you can choose Configure > AVD Manager and select Create Virtual Device…
  3. Choose a device definition and select Next.
  4. Select one or more system images for the Android versions you wantto emulate, and select Next.An x86 or x86_64 image is recommended.
  5. Under Emulated Performance, select Hardware - GLES 2.0 to enablehardwareacceleration.
  6. Verify the AVD configuration is correct, and select Finish.

    For details on the above steps, see ManagingAVDs.

  7. In Android Virtual Device Manager, click Run in the toolbar.The emulator starts up and displays the default canvas for yourselected OS version and device.

Web setup

Flutter has support for building web applications in thestable channel. Any app created in Flutter 2 automaticallybuilds for the web. To add web support to an existing app, followthe instructions on Building a web application with Flutter when you’ve completed the setup above.

Next step

Set up your preferred editor.