getting started with flutter on macos mojave, part 3

I moved on to the next step in the Flutter getting started tutorial, managing to create a new app project with a bit more functionality.

While the directions were for the most part correct and complete, they were a bit murkier in some spots than in the earlier tutorial sections. In particular:

  • Before you create a new project, close the prior project by closing VS Code. If you create a new project with the old project still open then VS Code will spawn a new window with the new project, detached from the simulator. Just close VS Code and reopen it, then create the new project for this step.
  • In Step 1 you’re advised to “delete all the code from lib/main.dart”. That’s wrong. Do that and you pretty much cripple the entire project. Instead delete class MyApp’s build() method in the project and copy/past the build() method code in the tutorial into its place.
  • In Step 2 you learn to add and reference an external package. The writer assumes you’re using Android Studio when you update pubspec.yaml. Since I’m in VS Code, when the instructions tell you to click “Packages get” in Android, press [Shift][Command][P] (remember I’m on a Mac) to bring up VS Code’s Command Palette (the menu View | Command Palette… does the same thing) and type “Flutter: Get Packages” to perform the same exact function.

The rest of the steps were uneventful and correct. At the end I had a working app that looked exactly like the view in the tutorial running in the simulator. Hurray for me.

getting started with flutter on macos mojave, part 2

It’s been a little while since getting all the Flutter bits installed, running, and working together. I finally found a few moments this Sunday morning to spin it up and go farther into the Flutter Getting Started demo on the Flutter website.

I’ve gotten into the habit of running ‘flutter doctor’ every time I open a shell because I’ve found that, for whatever reason, the Android SDK licensing check gives me an “Android license status unknown” for 26.0.2, even though I run tools/bin/sdkmanager from the shell. That seems to clear up any licensing issues, at least from the command line. Run ‘flutter doctor’ from within Visual Studio Code and it pops back up again.

Another problem is with libimobiledevice, a library that is a royal pain to get installed cleanly along with its dependencies. And you need that to talk to XCode and Apple mobile devices. The last time I had a problem with libimobiledevice I finally got it straightened out with ‘brew doctor’ and then installing libimobiledevice yet again. So far, right now (as you can see above), everything is OK.

My second set of initial impressions:

  • I got this up and running without writing a single line of code so far. The app running on the iPhone simulator is equivalent to your “Hello world” examples everywhere else.
  • It is interesting that I’m using Microsoft’s editor to debug an iOS application in an Apple simulator running on macOS. If I were really into cross-development I’d use the Android simulator as well, and I have no doubt it would work.
  • Hot reload works a treat. Starting the simulator takes more than a few seconds, but hot reload is very fast and does not require a simulator restart.

My overall impression is that it is very much still a work in progress. It feels fragile, especially when the Flutter doctor keeps reporting Android licensing and imobiledevice issues at odd times, either at the shell or within Visual Studio Code.

Having said that, it’s remarkable to see all this major systems lashed together into a decently working development environment. There is great potential in Flutter. If I can write better iOS applications within Flutter and do so with less frustration and at a faster pace, then I’m all for this and want to see it succeed. In the past, app development has (and still is) heavily siloed, where you get the development environment unique to each platform (XCode for iOS, Android Studio/IntelliJ for Android) and dealt with cross-platform development as best as possible. Now we’ve got the emergence of Flutter with its largely open source underpinnings. As long as Google keeps serious Flutter development going to at least a solid 1.0 release, then I think it will succeed.

And I personally want to see it succeed.