I'm teaching myself Flutter, and while the tutorials I'm using (Udemy) explain the actual coding well enough, I've come close to giving up at several points while trying to get programs and other basic tools up and running.
Today I learned about the coding challenges at Exercism, in many languages including Dart (awesome)! I also spent a couple of hours attempting to actually run them on my computer, and was about to give up before I finally figured it out.
In case anybody else is in a similar boat, here's what I learned. FWIW, I have a mac, and this is pretty much all I know about this-not sure how much of this will translate to others.
- First of all, though, you need to have Dart installed on your computer in a way that Terminal can access. Having the extensions for Android Studio and/or IntelliJ is not the same thing. If you type "dart" into terminal and it has no idea what you're talking about, this is probably you. In order to install it, you probably also need Homebrew. Type "brew -v" to see if your computer knows anything about this.
Here are the instructions to install Homebrew: https://brew.sh/
Here are the instructions to install a Dart SDK: https://dart.dev/get-dart (What's an SDK? I have no idea–but I still know far more about how to do this than any comprehensive articles I could find, and I do know that my stuff is running now).
Use this tutorial to install actual Exercism: https://exercism.io/cli-walkthrough
Go to the language track you want to try and click on the "Hello World" module. Get the download link from the right column, copy and paste it into terminal. This will download the project to your computer and tell you what directory it's going into.
Open IntelliJ, choose "open" and navigate to the "hello world" folder on your computer. Open the terminal window at the bottom of IntelliJ and type "pub get" to get any additional files (and check for other top of screen notices about importing things). Click on the dart file and complete the challenge.
When you think you have it, type "pub run test" and your work will be checked. If it fails, you get some clues.
When it passes, you can submit your solution by using "cd" to navigate to the folder that contains your file in terminal, then typing "exercism submit [yourfile].dart". There are a few more things to click, but they're pretty self-explanatory.