Flutter Clock - Submission Follow Up

Feb 25, 2020

I’m very sad to see that my Flutter Clock didn’t even make it to the Honorable Mentions section of the Flutter Clock contest. I’m thinking maybe I made some mistake, like they could nto test it somehow. I look at the positive side and I’ll use some experience I gathered to rewrite the Deal-O-RoundPlayN game with Flutter.

In the first part I emphasized how I modularized the widget hierarchy, and how I used InheritedWidget to communicate information between widgets. That post became big enough that I concentrated on the practices I actually used. However I went through some thinking and iterations before I got to the end result.

One principle I follow when I design and implement solutions is to discover existing solutions and possibly not reinvent the wheel unnecessarily. I did describe that I examined many fonts which can be good candidates for the Nixie or the VFD part. That is also one form of the "do not reinvent the wheel" principle: by using a font I can save a lot of time by not designing every digit and letter I will use, I can just type the information by the fonts.

I also have to talk about the hexagonal grid, which is part of the Nixie tube illumination physics. I did not want to develop my own hexagonal grid drawing logic if I don’t have to. So I looked for a package which can help. Flutter package repository (pub.dev) contains many thousands of packages. These cover every kind of use-cases you can ever imagine. For example if my clock would need GPS location to pull weather data, or other location based information, there are multiple packages for that, some of them cover all three platforms: Android, iOS, web. If my clock would want to pull weather information on it’s own, there are packages for that, like so: weather package. If I want to display sunset and daylight information there’s a package for that.

Regarding drawing hexagonal patterns first I came across a package which is capable of drawing all kinds of geometric shapes: geo pattern package. However that package focuses on the coloring, and filled patterns. In my case I’d only need the grid, I don’t need filling or color palette. At most I’d need to change the color of the grid structure as a whole in a gradient manner mimicking the illumination at the center. I focused on hexagonal pattern and saw hexagonal_grid and accompanying hexagonal_grid_widget. Unfortunately these still haven’t fully satisfied my needs, so I ended up spinning out and debugging my own grid drawer logic. But the bottom line is first I looked for packages, because oftentimes it’s a good idea to rely on a tested package instead of spending time debugging your own.

Comments loading...