Expense Splitter
Build a Flutter app for splitting shared expenses among friends, for example on a trip. You create a group, add people, and log each expense with who paid and who it was for, split equally or by exact amounts. The app keeps a running balance for everyone and works out the fewest payments needed to settle up (for example Ana pays Mihai 45 and Dan pays Mihai 20). App state is managed with Riverpod, and data is saved on the phone, so it's all there next time. You'll learn Flutter forms and lists, Riverpod state management, exact money calculations without rounding errors, a settlement algorithm, saving data locally, and testing the logic that matters.
- Estimate
- ~11h
- Steps
- 6
- Completed by
- 0
- Proposed by
- codeseed.app
Flutter · Riverpod
Project roadmap
- 01
Define the rules
~1.5hWrite README.md: a group has members and expenses; an expense has a description, an amount, a payer, the members it's shared by, and a split type (equal or exact amounts). Amounts are stored in cents as whole numbers. Describe exactly how an equal split handles leftover cents (100 split three ways is 34, 33 and 33) and what settling up means. Create the project and add flutter_riverpod. Done when: README.md defines the data, the split rules and settlement.
- 02
Write the core logic
~2hWrite pure Dart classes and functions, with no Flutter code: splitting an expense into shares (checking exact amounts add up to the total), calculating each member's balance (paid minus owed), and a greedy settlement algorithm that repeatedly matches the biggest debtor with the biggest creditor. Done when: unit tests show balances always sum to zero, and settlements bring everyone to zero.
- 03
Build the screens with Riverpod
~2.5hCreate Riverpod providers (Notifier classes) for groups and their expenses. Build a groups list, a group screen with its members, expenses (newest first) and balances, and a form to add or edit an expense with the payer, the members to split between, and the split type. Validate the form: the amount is above 0, at least one member is selected, and exact amounts add up. Done when: expenses can be added, edited and deleted, and balances update immediately.
- 04
Show the settlement
~1.5hBuild a Settle up screen listing the suggested payments with names and amounts, and a button to record a payment, which is saved as a special expense so the balances change. Show a message when everyone is settled. Done when: recording all suggested payments brings every balance to zero.
- 05
Save data on the device
~1.5hSave groups and expenses as JSON (with shared_preferences or a file in the app's documents folder using path_provider) whenever they change, and load them at startup. Include a version number in the saved data, and handle unreadable data by starting empty with a warning. Prevent removing a member who still has expenses. Done when: all data is still there after restarting the app.
- 06
Test it
~2hWrite unit tests: splits with leftover cents, exact splits that don't add up, balances, settlements for two people, a circle of debts, and random groups where you check that everyone ends at zero. Add a widget test that adds an expense and checks the balances shown. Done when: flutter test passes.
Ready to build this?
Get a GitHub repo and start building. Your AI reviewer checks each step as you go.
Tech stack