setState(2025) – Developing with Flutter 3.0

It is 2025 and developing with Flutter 3.0 seems like a great approach to building a macOS desktop app. It has been a couple of years since I have last worked with Flutter. What I would like to do is use Flutter to build a desktop app that combines data from my new Davis Instruments Vantage Vue weather station with data from public weather sites like those managed by the National Weather Service or National Oceanographic and Atmospheric Administration.

About the Equipment and Development Machine Configuration

I recently got some weather equipment from Davis Instruments. Specifically I have a Davis Vantage Vue Wireless weather station and a Davis Instruments AirLinkIQ air quality sensor. Both of these devices communicate data to a Davis Instruments WeatherLink console. They connect over WiFI to my local network and send data to the WeatherLink cloud platform. The Davis platform has a set of REST APIs that I will use to build a custom app or custom reports. I’ll be using V2 of this API.

I’ll be using my standard MacBook – you need to use a Mac Book to build Flutter apps for macOS (and iOS apps too). I have XCode already configured with all of its command line tools. The Flutter SDK was installed following the instructions on their website. I have Android Studio installed, but MS VSCode (VSC) is what I am using as my IDE. In VSC I have the standard Flutter and Dart extensions installed. Building an app in VSC is super straightforward and works exactly as stated in the Flutter documentation.

Flutter 3.0: Tips, Tricks, and Hidden Gems

To allow iOS/macOS app to get font data from Google, or any other network resources, you need to enable client network connections in the *.entitlements files in the macOS/runner folder – per this note.

<key>com.apple.security.network.client</key> <true/>

Helpful notes on macOS publishing can be found here: https://docs.flutter.dev/platform-integration/macos/building

Theme’s can be tricky. Flutter seems to be stuck between the original themeing setup and a new method that draws heavily on ThemeData().copyWith() to inherit most of the current theme, but then allow you to override just the bits that you want to.

final theme = ThemeData().copyWith(
  scaffoldBackgroundColor: colorScheme.surface,
  colorScheme: colorScheme,
  textTheme: GoogleFonts.ubuntuCondensedTextTheme().copyWith(
  titleSmall: GoogleFonts.ubuntuCondensed(fontWeight: FontWeight.bold),
  titleMedium: GoogleFonts.ubuntuCondensed(fontWeight: FontWeight.bold),
  titleLarge: GoogleFonts.ubuntuCondensed(fontWeight: FontWeight.bold),
  ),
);

When manipulating widgets, it definitely seems like this is a lot of code:

style: TextStyle(
  color: Theme.of(context).colorScheme.onSurface,
),

to get my form field to use the default foreground color. Good news is that this method will respect light or dark themes and automatically change to whatever the user’s device is set to. Flutter 3 does have very nice support for themes on all platforms.

Developing with Flutter in MS VSCode

If you are seeing an error/problem related to Java building and Gradle. This is most likely some kind of mis-match in your JDK and what gradle is expecting/supports. I guess I didn’t really care about this since I’m not building an Android app, so I did not bother to resolve it. It is surprising that Google cannot keep Gradle up to date with the latest JDK. More on this below…

To change the target device, look at the blue bar in the lower right hand corner and click where it says “macOS” and then you can change it.

When you launch your app in debug mode, all of the advanced Flutter tools will activate on the left hand side, use the buttons to switch to the widget inspector, ui inspector, etc. Super cool!You can always still use the web app in Chrome as well at: 127.0.0.1:9100/home?your app. Us the command palette to open the tools in your browser. These tools show you CPU performance and memory consumption data, layout conflicts, network data, and more. Very cool stuff for sure.

Do you use GitHub Copilot? Generally, it works fine, but you waste a ton of tokens while it guesses and displays suggestions. Tokens consume even when you reject the suggestion. I extensively use the snooze function when I work on a function and/or non-boilerplate code because the suggestions break my train of thought. It definitely takes some getting used to. Overall, CoPilot works pretty well with Dart/Flutter, which surprises me.

  • Flutter DevTools in Chrome
    Flutter DevTools in Chrome

The VSCode debugger is getting to be pretty powerful; remember VC Code is just a “text editor”? Ha, right? For example, you can set breakpoint and then hover over something like an array and see all the members in a popup! Pretty cool. Definitely worthwhile spending some time learning the debugger.

Flutter 3.0: Areas to Improve

Styles and Themes

This is just growing pains with components using the current or past patterns for APIs to set styles. It can make it difficult to know, without consulting documentation for each widget, which pattern to use.

Gradle Integration

This one seems odd, but the most flaky part of Flutter is the Gradle integration. Gradle is deeply connected with Google and the Android ecosystem. They should fix this quickly. Basically Flutter cannot deal with Gradle/Java incompatibilities and is very sensitive to version differences in both.

This fairly cryptic message means that someone is not happy with a Java – Gradle version conflict. I basically stopped trying to fix this knowing that for my current project that I did not care about Android. macOS deployments were working just fine.

Digging into platform specific configuration files

While it is nice to know that I can go into the iOS, macOS, etc. platform configurations and change permissions or fine tune the title bar, it seems to me that it would be more efficient to have a master properties file that Flutter’s build process would refer to and make these changes for you. Having to set network permissions for each platfomr individually, for exmaple, is a pain to remember and do for each project.

What the ! ?

I find that you often need to apply a “!” to reassure the compiler that a value cannot be null even when it is completely obvious that it cannot be null. Annoying! Why isn’t the compiler smarter? The way to solve this problems of course is with another notation, the “?”.

Final Thoughts on Flutter 3

With the third release of Flutter, Google has a stable and performant platform that supports one code-base and run anywhere. Unlike prior versions, things are very stable across these platforms. Hot-reloads in development also work very reliably. Strong support for VSCode also means that you can leave Android Studio and all of its bloat behind. Flutter is also enjoyable because it is an internet first language with strong native support for futures. You can use as much OOP as you want, mixing with more procedural style as you like. Hopefully we will see continued consolidation of styling and theming methodologies over time.

Leave a Reply