Using Flutter to teach the next generation

Software developmentFlutter

Using Flutter to teach the next generation

What I already tried

I have 3 kids at the age of 12, 10 and 2.
Without trying to be one of the parents that really insists on the kids having to do what the parents enjoy doing I still want to provide enough opportunities for them to get hooked by software development.
The tries I had to this point didn’t really work out:

Board games

I used board games that encourage “programmer thinking” (Robot Turtles). While it was quite funny to play it never stuck, so now it is waiting in the drawer for the 2y old to pick it up one day.

Educational Hardware pieces

I thought “maybe this is too theoretical and there is no connection to the real world” so I bought some hardware that is meant to be controlled by high level visual programming languages (Makeblock).

This also was fun only for a short period of time and then the kids lost interest.

Next plan: Apps

As the older kids are quite tied to their smartphones and given the battle that we as parents have almost every day regarding the smartphone usage (the kids have a very strict screen time with their smartphones) I thought “maybe it would be a good idea if they would be able to create a useful app for their smartphone”.

At least the idea of creating something that I always have with me is what me originally pulled into mobile software development (Windows CE 😀)

So I started thinking about an app that is easy to make but useful as well. An app that can be shown to friends to spark that “I have built this” feeling.

So I came up with the idea to create a tic-tac-toe app. Easy rule set, visuals can be easily built with the standard set of functionality of a UI toolkit.

Development environment

The question was what development environment to use.
The idea quickly spread, so friends of my kids are also interested in “how to build an app” so we will have a mixture of iOS and Android as target platforms.

The only reasonable solution to this is to use a cross-platform Framework. What a coincidence that I’m currently digging into Flutter 😀

There are other cross-platform frameworks, but I think as a first app and without understanding all the concepts of a programming language Flutter will be one of the easiest ways to build this app. I did a quick test implementation. Very easy and without using too many “more complex” features like Classes and the app is ~250 lines of code.

Plan for the “big day”

For the big day (in roughly one week) I plan to start with one computer (mine) were we together create the app. Starting from the Flutter hello world example adding the 9 cells of the game and using hot reload to have a live preview of what we are doing.
I will stop at certain points to explain the concept of methods so that the content of each cell doesn’t have to be created 9 times.

Once the visual representation is done I will explain how taps can be detected and reacted to in Flutter going very briefly into the fact that Flutter re-creates the Widgets every time something in the app changed that affects it. I won’t go into any details about state management or what a lambda is. I think this will be one of the places where the kids have to accept that “you have to write it that way” to not completely loose them.

After we are finished with that we will define the model for the cells and implement the tap logic (without any rules beside switching the active player, so the kids can see that the app does not behave like it has to).

After implementing some rules that will ignore taps we will focus on the “game over” state. We will implement a set of rules that can detect if one of the players won and set an appropriate state to visualize it.

The last step will be to implement a reset functionality into the floating action button that is already part of the hello world app.

After we have this working tic-tac-toe game we will switch from the Desktop target and load the current version to all the devices of the kids.

Depending on how much time we have left after that we will either configure laptops that the kids brought with them (so that they can tinker with it at home) or extend the app by introducing some fun game over animations or stuff like that.

I hope that this will work out! Currently, I don’t even know how many kids will be here (currently 4 and counting). I’m curious to see if I completely loose them or if actually throwing them in the middle of unknowns but having “something to touch” in the end is more interesting than the approaches before.

I will let you know 😀🤞