Flutter Installation Bundles
Flutter has installation bundles which you can download and install for both the Beta and Dev channels. These bundles are the easiest way to set up and get going with Flutter development, but they are not the only way.
Notably, if you would like to work using the unstable master
branch instead of the Beta or Dev channel code, you will need to construct your installation using the more detailed steps below.
The installation bundles were designed to allow you to have a completely populated environment.
To recreate what an installation bundle provides, do this:
-
OPTIONAL: Set and export the
PUB_CACHE
environment variable to point to the location where you would like your pub cache to be stored. If you don't set this, it will be stored in pub's default location in your home directory (varies based on your OS). Alternatively, if you create theflutter/.pub-cache
directory before any commands that invokepub
(e.g. theflutter packages
command), then the flutter tool will automatically use it, and you won't have to set PUB_CACHE in your environment. - WINDOWS ONLY: Download and install a command line version of Git. Windows doesn't come with git pre-installed, so you'll have to download it from one of the many sources on the Internet.
-
git clone -b master https://github.com/flutter/flutter.git
to clone the Flutter Git repo into the directory "flutter" in the current directory. - Change directories into the newly created "flutter" directory.
- Add the Flutter
bin
directory to your path:- Windows:
set PATH="%PATH%;%CD%/bin/flutter"
- Other platforms:
export PATH="$PATH:$PWD/flutter"
- Windows:
-
flutter doctor
to check your installation and build the initial snapshot of theflutter
tool. Install any missing software it tells you about, such as the Android SDK, or XCode tools. -
flutter update-packages
will download all of the pub package dependencies needed to build any of the packages in the Flutter main distribution. -
flutter precache
will make sure that theflutter
tool's cache of binary artifacts is up-to-date. -
OPTIONAL:
flutter ide-config --overwrite
will generate and update IDE configuration files for the Flutter repo. You only need to do this if you are using an IDE like IntelliJ or VS Code. - In a temporary directory, run
flutter create --template=app app_sample
,flutter create --template=package package_sample
, andflutter create --template=plugin plugin_sample
. You may then remove the app_sample, package_sample, and plugin_sample directories. This will populate the pub cache with any additional packages needed for creating new flutter projects using each of those templates.
These steps will set up your machine to pre-cache all of the necessary components for working offline, or for avoiding large downloads on slow connections.
Another alternative to the above steps is to run the prepare_package.dart script directly (which is what we use to create the installation bundles in the first place). You would invoke that script like this:
- Go as far as the
flutter doctor
step in the above steps (or if you have a working flutter repo already, you can skip that: it can be from another channel, but use a fairly current one for best results). - Invoke
./bin/cache/dart-sdk/bin/dart ./dev/bots/prepare_package.dart --temp_dir $TMPDIR --revision $REVISION --branch master --output $PWD
, from theflutter
root, whereTMPDIR
is set to a directory where there are several gigabytes of free space, andREVISION
is set to the 40-character git hash of the revision you wish to be working on.
This will build an archive bundle in $PWD that has done all of the above steps, and contains the master
branch.
- Home of the Wiki
- Roadmap
- API Reference (stable)
- API Reference (main)
- Glossary
- Contributor Guide
- Chat on Discord
- Design documents
- Code of Conduct
- Issue triage reports (latest)
- Our Values
- Tree hygiene
- Issue hygiene and Triage
- Style guide for Flutter repo
- Project teams
- Contributor access
- What should I work on?
- Popular issues
- Running and writing tests
- Release process
- Flutter Framework Gardener Rotation
- Rolling Dart
- Manual Engine Roll with Breaking Commits
- Updating Material Design Fonts & Icons
- Postmortems and Retrospectives
- Hotfix Documentation Best Practices
- In case of emergency
- Landing Changes With Autosubmit
- Setting up the Framework development environment
- The Framework architecture
- API Docs code block generation
- Running examples
- Using the Dart analyzer
- The flutter run variants
- Test coverage for package:flutter
- Writing a golden-file test for package:flutter
- Managing template image assets
- Setting up the Engine development environment
- Compiling the engine
- Debugging the engine
- Using Sanitizers with the Flutter Engine
- Testing the engine
- The Engine architecture
- Flutter's modes
- Crashes
- more...
- Setting up the Packages development environment
- Plugins and Packages repository structure
- Contributing to Plugins and Packages
- Understanding Packages tests
- Plugin Tests
- Releasing a Plugin or Package
- more...