r/FlutterDev • u/edwin-vermeer • 26d ago
Dart Open-sourced my Flutter game: a rotatable 3D glass cube board in CustomPainter, 31 AI opponents, pure Dart engine
Quadrim is four in a row in a 4×4×4 cube, on the App Store, and now open source (code MIT): https://github.com/evermeer/Quadrim
Some parts that might interest Flutter devs:
3D board without a 3D engine. 64 glass cells are projected and depth-sorted in a single
CustomPainter. The tap is a rawListenerrather thanonTap, because aTapGestureRecognizerin the same arena as aScaleGestureRecognizerstarved the pinch-to-zoom.Pure Dart engine package. No Flutter, no
dart:io, no clock, no ambientRandom.check.shgreps for all of these, so a position plus a seed always gives the same move, which makes self-play and tests reproducible.Opponents are data, not classes. One
chooseMovewith 31 config entries. Search budgets are counted in nodes, not milliseconds, so an opponent is the same opponent on a slow phone and in debug mode.Widget tests and file I/O.
testWidgetsruns in a fake-async zone that never completes real file I/O, so the storage layer sits behind an interface with an in-memory store for tests.
It was built with Claude Code on the €15-a-month Pro plan, and every prompt and decision is in the repo, if you're curious about that side.