CODEX
Flutter Perfect SetUp
The perfect flutter SDK and project setup for both intermediate and flutter beginning developers!

I am going to show you a superior flutter project setup including flutter SDK that gets you started right away coding no matter if you are a beginning flutter developer or an intermediate flutter developer. It’s somewhat a longer article but I have some free stuff along with that is linked in this article.
And yes, this gets remixed, expanded, and finally released as part of a flutter development book I will self-publish in the summer of 2021. As I gear up for these longer articles, you get the benefit of getting free code. This time around you get a free flutter_setup app code template that has everything set up and some added basics such as a flexible semi-automated workflow to make flutter app development and learning about flutter somewhat easier. Before I get into the meat-of-the-article I have to explain about the edition of flutter I amusing, ie whether it’s stable, beta, dev, or master.
Flutter Release Channels
Flutter comes in the following release channel editions of stable, beta, dev, or master. Of course, every SDK team of every framework ever created has always stated that you should use the stable release for production application development. But, we are dealing with a fast-changing framework. And, in that case, actually using the beta release channel instead has some benefits of: 1. You get a heads-up on upcoming features. In my case of writing several flutter development books this year, it helps me get ready to explain those new features to my audience, namely you. 2. It helps you weed-out all the flutter plugins that are not updating and keeping up with the flutter framework releases. And, often introduces you to an easier way to do something. An example is that instead of using the hard gherkin-BDD which requires knowing the gherkin step language I can instead use just test unit groups and dart all because the dart gherkin plugins are not keeping up with flutter framework changes.
In other words, think of it as you get to see things early from 2 months ahead when you view my sample flutter app code. Now, let’s get to the pre-requirements.
Pre-Requirements
The reason why I am repeating how to install the flutter and dart SDKs and the mobile SDKs and IDEs is that I see so many open and closed issues in the flutter GitHub pertaining to the in-precise details of who to install them in the first place. I feel that if I give exact details then it prevents you from running around in circles after installing them improperly.
Flutter SDK And Dart SDK
You are in luck as the dart SDK is included with the flutter SDK. But, there are some tricks. First, if on MS Windows then you cannot and should not install the Flutter SDK in the Program Files directory or any other MS Windows directory that can be locked-out via the folder change prevention setting, and that generally means the Program Files, Program Files(86), AppData, and ProgramData directories.
No matter what OS-platform you will install the Flutter SDK in a folder that does not have spaces in the name. Then open up your virus program’s setting and make sure to set an exclusion on virus scanning for that folder you installed the flutter SDK into. Now we are into the setting of environmental variables and path settings.
Env Variables And Path Settings For The Flutter SDK
Now let’s get down to setting the env variables and the path settings for the flutter-and-dart SDK combination. The only env variable you have to set is for the integration testing VM-URL setting, ie:
VM_SERVICE_URL http://127.0.0.1:8888/Now for the path settings:
D:\fluttersdk\myfluttersdk\flutter\bin
D:\fluttersdk\myfluttersdk\flutter\.pub-cache\binThat does two things. It set’s the path both to the dart executable and the flutter executable in the bin sub-folder. Two, it sets the path for the dart executable’s so that we do not have to type such things as flutter pub DartExecutableName. For example, instead of typing:
flutter pub run dcdgI just instead type:
dcdgto generate UML diagrams.
SIDE NOTE: When installing the flutter SDK and mobile SDK's if you are making-do with a laptop with only 8 gigs of RAM then you should adjust your virtual page file size to 4 times your actual RAM, ie 32 gigs as that in most cases with that cheap laptop will end up putting the actual location of the virtual page file on the n2d non-boot HD that the typical cheap laptop has which improves the launch times of the android emulator and Android Studio.
Now let’s deal with the easy way to get at least one front-end platform SDK, in this case at least one mobile SDK.
Mobile SDK’s
The easiest way to get at least one of the mobile SDK frameworks is to download and install the IDE associated with the mobile SDK framework. Let’s deal with Mac first.
If you are on Mac let’s get XCode so that we have the iOS SDK:
Keep in mind in early 2021 that the iOS simulator on m1 macs is not supported just yet and you will need a physical ios device(firebase labs for example ). And do a print env command to make sure your SDKROOT is set with this in the terminal:
$ prtinenv $SDKROOTMake sure to configure XCode via this in your terminal:
$ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
$ sudo xcodebuild -runFirstLaunch
$ sudo xcodebuild -licenseDo this command so the simulator opens up to verify it’s a 64bit simulator:
$ open -a SimulatorNow let’s deal with the other mobile SDK, Android SDK download along with android studio at the android studio download. You want the left beta build as that keeps up with the emulator updates and the new android releases each year:
https://developer.android.com/studio/preview
The Android Studio will let you download the latest Android SDK release. Typically, the flutter SDK team supports the same android SDK's as native android(right now that means android 8.1, 9,10,11,12). At some point, you should download them via the project settings(appearance->system settings->sdk) but no need to do that right now.
The plugins you will need() are: 1. PlantUML 2. Flutter(it will prompt you to install dart as well) 3. markdown Now let’s set the env variable and the path settings for the Android SDK:
VM_SERVICE_URL http://127.0.0.1:8888/ env varD:\androidstuff\androidsdk\platforms
D:\androidstuff\androidsdk\tools
D:\androidstuff\androidsdk\platform-toolsAnd the last step is if you will be using VSCode to download and configure it with the plugins: If you are on the Mac M1 machines then you want the insider edition which is at:
https://code.visualstudio.com/insiders/
And the plugins you need are: 1. flutter and dart 2. ios emulator 3. android emulator 4. terminal
Now let’s run the tool flutter doctor in the terminal with:
flutter doctor
Now we are at the part where we can install the rest of the dependencies to the flutter perfect setup app template. Namely, LCOV, JUNIT2HTML, PLANTUML, and the dart binary tools we will be using. I am calling my flutter app template flutter_setup and you will get that resource to download at the end of this article.
Flutter SetUp Dependencies
Let’s take care of the non-dart binary tool dependencies first. Code coverage is outputted in the LCOV info file format so we need a processing tool to convert that info file output to a human-readable HTML output. The set of Perl scripts are nicknamed LCOV. If you are on Mac or Linux or Unix then you get those Perl scripts by downloading the normal devtools compiling set and most of the time that is somewhat automatic. But, on MS Windows we have to manually find it and install it.
MS Windows LCOV
The Linux Test Project distributes a windows version of the LCOV set of Perl scripts that have the right processing of MS-Windows paths. It can be downloaded and installed via Chocolatey:
https://chocolatey.org/packages/lcov
and the choco terminal command to install is:
choco install lcovAnd the last step is to set up an env variable that points to the path to the genhtml script that is part of the lcov on windows install which is usually at:
GENHTM C:\ProgramData\chocolatey\lib\lcov\tools\bin\genhtmlIf on Mac, Unix, or Linux then find where lcov was installed as you need to set that GENHTML env variable.
Let’s verify it to make sure it works, download this brief info file:




