Free

Expense Tracker in Flutter

Dart’s int becomes a JavaScript number on the web — the app tells you which one it is running on.

  • Flutter
  • Dart
  • CustomPainter

About this project

Record expenses in rupees with a category and a date, see totals per category and per month, and a donut chart drawn by hand rather than by a charting package. Saved to disk, and it runs on Android, Windows and the web from one source.

The idea it is built around is money in a framework that compiles to two different number systems. Amounts are whole paise in an int, never a double — but Dart’s int is a true 64-bit integer on a phone and becomes a JavaScript number once compiled for the web, where integers stop being exact above 2^53. The app detects which one it is running on and shows you: on the web it prints int.parse("9007199254740993") coming back as 9007199254740992, rounded down by one. It also says plainly why this does not matter for an expense tracker — a crore of rupees is 10^9 paise, far inside the safe range — and where it would begin to matter.

The second theme is that a chart is arithmetic and a canvas, not a library. The donut is drawn with CustomPainter, so the angles are yours, and the empty case says there is nothing to show rather than drawing an empty ring.

What you will learn

  • Store money as whole paise in an int, and know exactly where that stops being exact
  • Understand that Dart’s int is 64-bit natively and a double once compiled to JavaScript
  • Format for an Indian audience with lakh grouping rather than thousands
  • Draw a chart yourself with CustomPainter, and handle the empty case honestly
  • Group and total records by category and by month without a database

Before you start

  • Some Flutter — widgets, state and a list view
  • Flutter 3.19 or newer, and any one target including just Chrome

Academic integrity notice

These projects are provided for learning, experimentation and reference. Understand the code, modify it for your own requirements, and acknowledge external work according to your institution’s academic policies. Priodemy does not supply work to be submitted as your own.