Search packages, repositories and app categories

polls cover
Package detailsv1.0.1

polls

A flutter widget for poll, this immitates the twitter polls system, all you need do is connect you data to the polls, it allows voting and visualization.

30-day downloads
66
Likes
109
Pub points
50

Install package

flutter pub add polls

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The polls package is a Flutter widget that replicates the Twitter poll interface, enabling users to create interactive voting systems within their apps. It supports real-time voting and visual feedback, making it ideal for social media features. Developers can easily integrate their data sources to power the polls, with minimal setup required. The package focuses on simplicity and aesthetics, offering a clean, intuitive way to collect user opinions. It's designed for seamless integration into existing Flutter projects.

Use cases

  • Social media apps
  • User feedback collection
  • Community engagement tools
  • Real-time voting features
  • Interactive content in apps

Key features

  • Twitter-style poll UI
  • Voting functionality
  • Data-driven polling
  • Visual vote representation
  • Easy integration with custom data

Suitable for

  • Flutter developers building social features
  • Apps needing user opinion gathering
  • Projects requiring lightweight polling systems
  • Developers seeking simple, attractive poll widgets
  • Mobile apps with interactive content

Considerations

  • Requires manual data management
  • No built-in backend support
  • Limited customization options
  • Not optimized for high-frequency polling
  • Depends on external state management for updates

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Polls

pub package

GitHub

ScreenShots

Voting Not Voted Yet Voted

Usage

Basic:

import 'package:polls/polls.dart';
Polls(
    children: [
        // This cannot be less than 2, else will throw an exception
        Polls.options(title: 'Cairo', value: option1),
        Polls.options(title: 'Mecca', value: option2),
        Polls.options(title: 'Denmark', value: option3),
        Polls.options(title: 'Mogadishu', value: option4),
        ],
        question: Text('What is the capital of Egypt'),
        currentUser: this.user,
        creatorID: this.creator,
        voteData: usersWhoVoted,
        userChoice: usersWhoVoted[this.user],
        onVoteBackgroundColor: Colors.blue,
        leadingBackgroundColor: Colors.blue,
        backgroundColor: Colors.white,
        onVote: (choice) {

            setState(() {
              this.usersWhoVoted[this.user] = choice;
            });
            if (choice == 1) {
            setState(() {
                option1 += 1.0;
            });
            }
            if (choice == 2) {
            setState(() {
                option2 += 1.0;
            });
            }
            if (choice == 3) {
            setState(() {
                option3 += 1.0;
            });
            }
            if (choice == 4) {
            setState(() {
                option4 += 1.0;
            });
        }
    },
);
Poll View type
Polls(
  viewType: PollsType.creator
);
Polls(
viewType: PollsType.voter
);
Polls(
viewType: PollsType.readOnly
);

Why I made this plugin

Apparently, I have built 2 apps that required user voting processes, twice I had to implement same code on different apps. I also had to share the code with a friend, well I thought it would not be a bad idea to create a package off it, cause at this time there was no polls widget package on pub.dev

kindly follow on github

github

Kindly follow me on

twitter medium instagram

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package

No data available yet.