Skip to content

πŸ“± 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.

Notifications You must be signed in to change notification settings

siraajul/voting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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:

πŸ“² Installation

  1. Clone the repository:
git clone https://github.com/yourusername/flutter_voting_app.git
  1. Navigate to the project directory:
cd flutter_voting_app
  1. Install dependencies:
flutter pub get
  1. Run the app:
flutter run

πŸ“¦ Dependencies

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 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

# 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:
git checkout -b feature/AmazingFeature
  1. Commit your changes:
git commit -m 'Add some AmazingFeature'
  1. Push to the branch:
git push origin feature/AmazingFeature
  1. Open a Pull Request

πŸ“ Code Style

πŸ› Known Issues

See the GitHub Issues section to report any bugs or feature requests.

πŸ“œ License

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...

πŸ‘₯ Authors

πŸ™ Acknowledgments

  • Flutter team for the amazing framework
  • Provider package for state management
  • Material 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.

About

πŸ“± 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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published