A simple and intuitive voting application built with Flutter using Provider state management. This app allows users to vote for candidates and view real-time results with a clean, modern interface.
Click to view screenshots
- Main interface where users can cast their votes
- Shows list of candidates with vote buttons
- Bottom navigation to results page
- Displays vote counts for each candidate
- Highlights the winning candidate
- Shows percentage of total votes
- π Real-time vote counting and results
- π₯ Easy-to-use candidate listing
- π― One-tap voting system
- π± Responsive Material Design UI
- π State management using Provider
- π Dynamic result calculation
- π Automatic winner declaration
- β‘ Fast and lightweight
Before you begin, ensure you have the following installed:
- Flutter (2.0.0 or higher)
- Dart (2.12.0 or higher)
- Git
- IDE with Flutter support (VS Code, Android Studio, etc.)
- Clone the repository:
git clone https://github.com/yourusername/flutter_voting_app.git
- Navigate to the project directory:
cd flutter_voting_app
- Install dependencies:
flutter pub get
- Run the app:
flutter run
Add these dependencies to your pubspec.yaml
:
dependencies:
flutter:
sdk: flutter
provider: ^6.0.5 # For state management
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
project_root/
βββ lib/
β βββ main.dart # App entry point
β βββ models/
β β βββ candidate_model.dart # Candidate data model
β βββ providers/
β β βββ vote_provider.dart # State management
β βββ screens/
β βββ voting_screen.dart # Main voting interface
β βββ result_screen.dart # Results display
βββ screenshots/ # App screenshots
β βββ voting_screen.png
β βββ results_screen.png
βββ test/ # Test files
βββ pubspec.yaml # Dependencies
βββ README.md # Documentation
-
Launch the app:
- The main screen displays a list of candidates
- Each candidate has a 'Vote' button in the trailing position
-
Casting a Vote:
- Tap the 'Vote' button next to a candidate's name
- A confirmation snackbar will appear
- The vote count is updated in real-time
-
Viewing Results:
- Tap the 'View Result' button at the bottom
- Navigate to the results screen
- See vote counts and percentages
- The winner is highlighted
# Run all unit tests
flutter test
# Run tests with coverage
flutter test --coverage
# Generate coverage report
genhtml coverage/lcov.info -o coverage/html
We welcome contributions! Here's how you can help:
- Fork the repository
- 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
- Follow Flutter's style guide
- Run
flutter analyze
before committing - Format code using
flutter format .
See the GitHub Issues section to report any bugs or feature requests.
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) [year] [your name]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software...
- Flutter team for the amazing framework
- Provider package for state management
- Material Design for UI guidelines
- All contributors who participate in this project
- β Android
- β iOS
- β Web
- β Windows
- β macOS
- β Linux
- 1.0.0
- Initial Release
- Basic voting functionality
- Results display
Want to contribute? Great!
To fix a bug or enhance an existing module, follow these steps:
- Fork the repo
- Create a new branch (
git checkout -b improve-feature
) - Make the appropriate changes in the files
- Add changes to reflect the changes made
- Commit your changes (
git commit -am 'Improve feature'
) - Push to the branch (
git push origin improve-feature
) - Create a Pull Request
- Authentication system
- Multiple voting categories
- Vote history
- Export results
- Dark mode support
- Offline support
Q: Can I modify and redistribute this app? A: Yes, under the terms of the MIT license.
Q: How can I contribute to the project? A: See the Contributing section above.
Q: Is this app production-ready? A: This is a sample project but can be enhanced for production use.