Game of Life with Flutter

Christian Muehle
Flutter Community
Published in
7 min readNov 10, 2019

--

Photo by Heather McKean on Unsplash

I would like to show you a version of Game of Life build with Flutter. My intention was to get some insights on the following topics:

  • Custom drawing — create your own UI-elements
  • Very basic “game” approach — game loop

About the game

Let’s first start with a brief intro explaining what “Game of Life” is actually about. In case you know the board game called “Game of Life” I have to disappoint you — the game we are building here is a bit different. Below is the summary in my words, feel free to skip this and check the great Wikipedia article directly.

The rules

The game shows a board of cells which can either be alive or dead. Every turn, each cell gets checked and a new state (dead, alive) is calculated based on the current game board. The rules are quite simple — a cell will only change the state based on the following rules:

  1. Any living cell with < 2 live neighbors will be changed to dead in the next round
  2. If a dead cell has 3 living neighbors…

--

--

Christian Muehle
Flutter Community

Software developer in the marine industry — Technical writer and Flutter enthusiast — Happy user of Apache CouchDB and big fan of the .NET Framework