A professional and production-ready mobile app to generate invoices, built with Flutter. This project is a complete overhaul of the original, focusing on a robust architecture, clean code, and a better user experience.
- Modern UI/UX: A clean and user-friendly interface.
- State Management: Uses the
providerpackage for scalable and maintainable state management. - Robust Backend: Fully integrated with Cloud Firestore for all database operations.
- PDF Generation: Generate, preview, and share professional-looking invoices as PDFs.
- Error Handling & Logging: Implemented robust error handling and logging for easier debugging.
- Tested: Includes unit and widget tests to ensure functionality and prevent regressions.
- Flutter & Dart
- Firebase: Cloud Firestore for the database.
- Provider: For state management.
- PDF & Printing: For PDF generation and handling.
- Logger: For logging.
- Mockito: For testing.
The project has been refactored into a clean and scalable architecture:
lib/
├── models/ # Data models for the app (Invoice, Product, etc.)
├── providers/ # ChangeNotifier classes for state management
├── screens/ # UI screens for the app
├── services/ # Services for interacting with external resources (Firebase, PDF)
└── main.dart # The main entry point of the app
To get a local copy up and running, follow these simple steps.
- Flutter SDK: Make sure you have the Flutter SDK installed.
- A Firebase project: You'll need a Firebase project to connect the app to a backend.
- Clone the repo
git clone https://github.com/your_username_/your_repository.git
- Install packages
flutter pub get
- Set up Firebase
- Create a new Firebase project at https://console.firebase.google.com/.
- Add an Android and/or iOS app to your Firebase project.
- Follow the instructions to download the
google-services.json(for Android) andGoogleService-Info.plist(for iOS) files. - Place the
google-services.jsonfile in theandroid/app/directory. - Place the
GoogleService-Info.plistfile in theios/Runner/directory.
- Set up Firestore
- In your Firebase project, create a Cloud Firestore database.
- Create the following collections with some sample data:
products: with fieldsProduct Name,Type,Pack size,Unit Price.customers: with fieldsParty Name,Address.resources: with a document namedconfigand a fieldsignURL(a URL to an image for the signature).
Run the app using the following command:
flutter runContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request