DEV Community

Cover image for How to install Flutter + My Flutter Experience so far
Ryan Lucas
Ryan Lucas

Posted on

How to install Flutter + My Flutter Experience so far

In my job @twiage, we have a flutter project called STAT, which is a rewrite of an native implementation. I've never liked Flutter/Dart and was always uncomfortable working with it.

I've been playing with Flutter and React Native since 2020 and until the last couple of days, React Native was go to solution and Flutter was something that i considered "crappy".

It was so comfortable with React Native and had a chance to work in the RN@0.72.0 (i tell this everyone πŸ₯Ή)

Here's why i loved React Native:

  • Typescript
  • Massive community
  • 99% of JS libraries work with RN
  • Easy to install
  • Expo

Flutter problems

I had hard feelings about Flutter because the language (JS/Dart) differences and for being an React Native direct competitor.

Dart

I could never pardon Dart for trying to replace Javascript. This almost made us enemies for life.

Dart is a whole new language, not tied to Javascript, neither trying to keep backwards compatibility.

Dart compilation guide

Flutter Installation

Don't get too carried away thinking that you're going to run your package manager install command with ease. Flutter installation is way more complex

To get things done, i've used my loyal companion asdf, so a big part of the pain went away.

So here's my step by step way to do it:

1. Install Flutter

asdf plugin add flutter
asdf install flutter latest
Enter fullscreen mode Exit fullscreen mode

2. Get mad at Flutter for not telling you the correct JDK version from start

Actually, this is my fault, if you run flutter doctor, the CLI will give you a warning about the mismatching JDK version. (this is still pretty annoying tho)

Install JDK 17 (or whatever version is required by Flutter by the time you're reading this)

asdf plugin add java
asdf install java adoptopenjdk-17.0.0+12
asdf local java adoptopenjdk-17.0.0+12 # will create your .tool-versions
Enter fullscreen mode Exit fullscreen mode

you can set the JDK that Flutter will use by passing the --jdk-dir flag -- and you can get this value by running asdf where java

flutter config --jdk-dir $(asdf where java)
Enter fullscreen mode Exit fullscreen mode

3. Create a new Flutter project

flutter create myapp
cd myapp
flutter run
Enter fullscreen mode Exit fullscreen mode

Conclusion

This guide should help you installing the Flutter SDK and the required JDK using asdf, which is a really handy tool.

asdf can be used with a big variety of languages and runtimes, take a look at their website for more information.

Thank you very much for readying my article, let me know if I can help with anything in your projects.

Linkedin: https://www.linkedin.com/in/ryangst/

Top comments (0)