A beautiful and intuitive Flutter mobile application for tracking personal expenses with smart analytics, salary management, and detailed expense history.
β¨ Smart Expense Tracking
- Add expenses with title, amount, and category
- Automatic date and time recording
- Real-time expense list with filtering options
- Organized by categories
π³ Salary & Savings Management
- Set monthly salary with one-time entry restriction
- Track remaining savings after expenses
- Automatic calculation of available balance
- Monthly salary lock to prevent re-entry
π Advanced Analytics
- Dynamic pie chart showing spending by category
- Monthly, weekly, and yearly period filters
- Trend analysis with bar charts
- Average daily spending calculation
- Top spending category insights
π Expense History
- Complete history of all transactions
- Date range filtering
- Category-based filtering
- Detailed transaction view with timestamps
- Easy navigation and search
π¨ Beautiful UI/UX
- Modern gradient design
- Smooth animations and transitions
- Responsive layout for all screen sizes
- Polished cards and interactive elements
- Professional color palette
- Framework: Flutter 3.x
- Language: Dart 3.x
- State Management: Flutter Riverpod
- Backend: REST API (http package)
- Local Storage: Hive
- Charts: FL Chart
- Date Formatting: Intl
- UI Components: Material Design 3
lib/
βββ core/
β βββ constants/
β β βββ app_colors.dart # App color palette
β βββ theme/ # Theme configuration
β βββ utils/ # Utility functions
βββ data/
β βββ datasources/
β β βββ local/ # Local storage logic
β βββ models/ # Data models
β βββ remote/
β β βββ api_service.dart # API service
β βββ repositories/ # Repository implementations
βββ domain/
β βββ entities/
β β βββ expense_entity.dart # Expense model
β βββ repositories/ # Repository interfaces
β βββ usecases/ # Business logic
βββ presentation/
β βββ providers/
β β βββ expense_provider.dart # Riverpod providers
β βββ screens/
β β βββ home/
β β βββ analytics/
β β βββ history/
β β βββ add_expense/
β β βββ main_navigation/
β βββ widgets/ # Reusable widgets
βββ main.dart # App entry point
- Flutter SDK 3.0 or higher
- Dart SDK 3.0 or higher
- Android Studio or Xcode (for emulator)
- An active internet connection for backend API
-
Clone the repository
git clone https://github.com/yourusername/expense_tracker.git cd expense_tracker -
Get dependencies
flutter pub get
-
Configure Backend API
- Update the base URL in
lib/data/remote/api_service.dart:static const String baseUrl = "http://your-backend-url:8000";
- For local development with Android Emulator:
http://10.0.2.2:8000 - For real device: Use your server's IP address (e.g.,
http://192.168.1.100:8000)
- Update the base URL in
-
Run the app
flutter run
- Tap the floating action button (+) on the Home screen
- Enter expense details:
- Title
- Amount
- Category (select from dropdown)
- Tap "Save Expense"
- Go to Home screen
- Look for the salary card
- Tap "Add Salary" button
- Enter your monthly salary
- Confirm - you can only set this once per month
- Navigate to the Analytics tab
- Use period filters (Monthly, Weekly, Yearly)
- View:
- Pie chart by category
- Spending trends
- Average daily spending
- Top spending category
- Go to History tab
- Filter by date range using the calendar picker
- Filter by category using chips
- View detailed transaction information
The app communicates with a REST backend. Required endpoints:
Returns list of all expenses
Response:
[
{
"id": "1",
"title": "Groceries",
"amount": 500,
"category": "Food",
"date": "2024-04-02T10:30:00Z"
}
]Creates a new expense
Request:
{
"title": "Groceries",
"amount": 500,
"category": "Food"
}Response: Returns created expense with ID and date
- Primary:
#5B67FF(Blue) - Secondary:
#FF9D55(Orange) - Background:
#F6F8FC(Light Gray) - Surface:
#FFFFFF(White) - Error:
#FF6B6B(Red)
The app uses Riverpod for state management with the expenseProvider:
final expenseProvider = StateNotifierProvider<ExpenseNotifier, List<ExpenseEntity>>((ref) {
return ExpenseNotifier();
});fetchExpenses()- Load expenses from APIaddExpense(title, amount, category)- Create new expensedeleteExpense(id)- Remove expense
Hive is used for lightweight local storage:
- settings box: Stores monthly salary and salary entry month
- expenses box: Cached expense data (for future offline support)
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Verify backend server is running
- Check base URL configuration matches your environment
- Ensure device/emulator can reach the backend IP
- Check network logs in Flutter DevTools
- Clear app cache and try again
- Ensure Hive boxes are initialized in
main.dart - Check device storage permissions
- Pull down to refresh (if implemented)
- Verify backend API responses
- Check Riverpod provider logs
- Ensure date/time on device is correct
- Monthly salary can only be set once per calendar month
- Requires backend API for full functionality
- Expense history limited to 5 years
- Offline mode not yet implemented
- Offline expense tracking
- Recurring expense templates
- Budget alerts and limits
- Export to PDF/CSV
- Dark mode implementation
- Push notifications for spending alerts
- Multi-currency support
- Expense notes and attachments
This project is licensed under the MIT License - see the LICENSE file for details.
For support, email support@expensetracker.com or open an issue on GitHub.
Made with Flutter π