My wife and I play Catan regularly with our neighbors and I wanted a way to track the dice stats to see if my poor results were due to bad strategy or bad luck.
Some requirements:
Implementation
This app was pretty simple to implement and only took a couple hours. I tracked dice roll history in two data structures:
Third party libraries:
I've found state management to be a bit of a pain in flutter, so I tried out a package called getx that handles state management by wrapping widgets in a stateful widget that listens for changes to a controller object. This makes the flow of information much easier to manage, since everything is tracked in a central place.
I also used get_storage to manage data persistence, so when the app closes it doesn't lose all the dice stats
The plotting is all done using fl_chart
Some requirements:
- Ability to see dice stats as both a histogram and time series
- Quick roll entry
- Ability to undo accidental entries
Implementation
This app was pretty simple to implement and only took a couple hours. I tracked dice roll history in two data structures:
- A map of dice value to count
- An array of dice rolls over time
Third party libraries:
I've found state management to be a bit of a pain in flutter, so I tried out a package called getx that handles state management by wrapping widgets in a stateful widget that listens for changes to a controller object. This makes the flow of information much easier to manage, since everything is tracked in a central place.
I also used get_storage to manage data persistence, so when the app closes it doesn't lose all the dice stats
The plotting is all done using fl_chart