https://github.com/siraajul/voting
๐ฑ A modern Flutter voting app showcasing clean architecture and real-time vote tracking. Built with Provider state management and Material Design 3, featuring instant vote counting, results visualization, and winner declaration. Perfect for learning Flutter best practices or implementing in real voting scenarios.
https://github.com/siraajul/voting
andoird ios provider-state-management voting-app
Last synced: over 1 year ago
JSON representation
๐ฑ A modern Flutter voting app showcasing clean architecture and real-time vote tracking. Built with Provider state management and Material Design 3, featuring instant vote counting, results visualization, and winner declaration. Perfect for learning Flutter best practices or implementing in real voting scenarios.
- Host: GitHub
- URL: https://github.com/siraajul/voting
- Owner: siraajul
- Created: 2024-10-27T14:46:36.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-27T16:40:11.000Z (over 1 year ago)
- Last Synced: 2025-02-01T00:32:40.085Z (over 1 year ago)
- Topics: andoird, ios, provider-state-management, voting-app
- Language: Dart
- Homepage:
- Size: 764 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Flutter Voting App
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.
## ๐ฑ Screenshots
Click to view screenshots
### Voting Screen

- Main interface where users can cast their votes
- Shows list of candidates with vote buttons
- Bottom navigation to results page
### Results Screen - Winner

- Displays vote counts for each candidate
- Highlights the winning candidate
- Shows percentage of total votes
### Results Screen - Tie

## โจ Features
- ๐ 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
## ๐ ๏ธ Prerequisites
Before you begin, ensure you have the following installed:
- [Flutter](https://flutter.dev/docs/get-started/install) (2.0.0 or higher)
- [Dart](https://dart.dev/get-dart) (2.12.0 or higher)
- [Git](https://git-scm.com/downloads)
- IDE with Flutter support ([VS Code](https://code.visualstudio.com/), [Android Studio](https://developer.android.com/studio), etc.)
## ๐ฒ Installation
1. Clone the repository:
```bash
git clone https://github.com/yourusername/flutter_voting_app.git
```
2. Navigate to the project directory:
```bash
cd flutter_voting_app
```
3. Install dependencies:
```bash
flutter pub get
```
4. Run the app:
```bash
flutter run
```
## ๐ฆ Dependencies
Add these dependencies to your `pubspec.yaml`:
```yaml
dependencies:
flutter:
sdk: flutter
provider: ^6.0.5 # For state management
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
```
## ๐ Project Structure
```
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
```
## ๐ Usage
1. Launch the app:
- The main screen displays a list of candidates
- Each candidate has a 'Vote' button in the trailing position
2. 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
3. Viewing Results:
- Tap the 'View Result' button at the bottom
- Navigate to the results screen
- See vote counts and percentages
- The winner is highlighted
## ๐งช Running Tests
```bash
# Run all unit tests
flutter test
# Run tests with coverage
flutter test --coverage
# Generate coverage report
genhtml coverage/lcov.info -o coverage/html
```
## ๐ค Contributing
We welcome contributions! Here's how you can help:
1. Fork the repository
2. Create your feature branch:
```bash
git checkout -b feature/AmazingFeature
```
3. Commit your changes:
```bash
git commit -m 'Add some AmazingFeature'
```
4. Push to the branch:
```bash
git push origin feature/AmazingFeature
```
5. Open a Pull Request
## ๐ Code Style
- Follow [Flutter's style guide](https://flutter.dev/docs/development/tools/formatting)
- Run `flutter analyze` before committing
- Format code using `flutter format .`
## ๐ Known Issues
See the [GitHub Issues](https://github.com/yourusername/flutter_voting_app/issues) section to report any bugs or feature requests.
## ๐ License
This project is licensed under the MIT License - see the [LICENSE](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...
```
## ๐ฅ Authors
- Your Name - [GitHub](https://github.com/yourusername) - [Twitter](https://twitter.com/yourusername)
## ๐ Acknowledgments
- [Flutter](https://flutter.dev/) team for the amazing framework
- [Provider](https://pub.dev/packages/provider) package for state management
- [Material Design](https://material.io/design) for UI guidelines
- All contributors who participate in this project
## ๐ฑ Platform Support
- โ
Android
- โ
iOS
- โ
Web
- โ
Windows
- โ
macOS
- โ
Linux
## ๐ Version History
* 1.0.0
* Initial Release
* Basic voting functionality
* Results display
## ๐ Development
Want to contribute? Great!
To fix a bug or enhance an existing module, follow these steps:
1. Fork the repo
2. Create a new branch (`git checkout -b improve-feature`)
3. Make the appropriate changes in the files
4. Add changes to reflect the changes made
5. Commit your changes (`git commit -am 'Improve feature'`)
6. Push to the branch (`git push origin improve-feature`)
7. Create a Pull Request
## ๐ก Future Features
- [ ] Authentication system
- [ ] Multiple voting categories
- [ ] Vote history
- [ ] Export results
- [ ] Dark mode support
- [ ] Offline support
## ๐ FAQ
**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.