Note: Dash the hummingbird is the mascot for the Dart language and the Flutter framework. Flutter and the related logo are trademarks of Google LLC. We are not endorsed by or affiliated with Google LLC. Card image by Before i Go licensed via Shutterstock.

The Flutter Casual Games Toolkit

Developing for Multi-Platform Support

Mike Riley
3 min readApr 3, 2023

--

https://pragprog.com/newsletter/

I recently had the burning desire to digitally recreate a favorite card game that leveraged OpenAI’s API for the AI opponent. Having been coding in Go and Rust for a while, I initially sought out 2D game engines specifically developed with those languages. Go’s Oak and Pixel projects looked promising, as did Rust’s Piston game engine. While these engines would satisfy my desire to compile and run the results on Linux, Mac, and Windows desktops, the languages they were built with do not offer an easy migration/compilation for Android and iOS devices.

Of course, one option that supports all these platforms is Google’s Flutter framework. As I mentioned in a previous Medium article, Flutter is my current go-to language for multi-OS application development. While I find the underlying Dart language beneath the Flutter framework to be a bit on the obtuse side, it’s certainly easier to grok than Rust.

I am not interested in rolling my own game engine into Flutter, especially since I will be spending most of my time focusing on the interactions with the OpenAI API for the solo game opponent. Fortunately, I don’t have to, because the Flutter team has already created a 2D gaming engine specifically for my needs. It’s called the Flutter Casual Games Toolkit, and it’s incredibly easy to implement and use. The toolkit even includes support for achievements, in-app purchases, and in-game ads (yuck). Flutter developer Filip Hracek even posted a nearly hour-long Quick Start video showing how easy it is to include these features in your own Flutter-powered games.

After spending a few hours with the documentation and running a couple samples, I set out for my game making journey. I have no intention of making this a commercial project. So, for now, it will be maintained on my home network’s Go-based Gitea server and will be like building a model airplane that will take months — perhaps even years — to complete. But at least when that final source code is ready for compilations, I will be comfortable knowing that it will run on Linux (including newer Raspberry Pi devices), Mac, Windows, Android, iOS, and any other OS that Flutter supports in the future. Good times ahead!

📢 Have you built a game using the Flutter Casual Games Toolkit? Share details in the comments.

--

--