🗳 Customizable Polls for Flutter.

Flutter Polls

Customizable Polls for Flutter. Simple, easy to use and highly customizable.

Flutter Polls on pub.dev

Getting Started

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
  ...
  flutter_polls: ^0.0.1

Import it:

import 'package:flutter_polls/flutter_polls.dart';

Example

Flutter Poll

FlutterPolls(
    pollId: '1',
    onVoted: (PollOption pollOption, int newTotalVotes) {
      print('Voted: ${pollOption.id}');
    },
    pollOptionsSplashColor: Colors.white(),
    votedProgressColor: Colors.greyDark().withOpacity(0.3),
    votedBackgroundColor: Colors.grey().withOpacity(0.2),
    votesTextStyle: themeData.textTheme.subtitle1,
    votedPercentageTextStyle:
        themeData.textTheme.headline4?.copyWith(
    color: Colors.black(),
    ),
    votedCheckmark: Icon(
        Icons.circle_check,
        color: AppColors.black(),
        height: 18,
        width: 18,
    ),
    pollTitle: Align(
    alignment: Alignment.centerLeft,
    child: AutoSizeText(
        poll['title'],
        style: TextStyle(
            fontSize: 20,
        ),
    ),
    pollOptions: poll['options'].map(
    (option) {
        return PollOption(
        id: option['id'],
        title: AutoSizeText(
            option['title'],
            style: tTextStyle(
            fontSize: 20,
        ),
        ),
        votes: option['votes'],
        );
    },
    ).toList(),
    metaWidget: Row(
    children: [
        const SizedBox(width: 6),
        AutoSizeText(
        '•',
        style: TextStyle(
            fontSize: 20,
        ),
        ),
        const SizedBox(
        width: 6,
        ),
        AutoSizeText(
        '2 weeks left',
        style: TextStyle(
            fontSize: 20,
        ),
        ),
    ],
    ),
),

Parameters

Parameter Type Description
pollId String The poll id.
hasVoted bool Whether the user has voted.
userVotedOptionId int The user voted option id. If the user hasn't voted, this will be null.
onVoted void Function(PollOption pollOption, int newTotalVotes) The callback when the user voted.
pollTitle Widget The poll title. Can be any widget.
pollOptions List The poll options. Each item is a map with the following keys: id, title, votes.
heightBetweenTitleAndOptions double The height between the poll title and the poll options.
heightBetweenOptions double The height between the poll options.
votesText String Votes text. Can be "Votes", "Votos", "Ibo" or whatever language. If not specified, "Votes" is used.
votesTextStyle TextStyle The style of the votes text.
metaWidget Widget The meta widget. Can be any widget.
createdBy String The poll creator.
userToVote String The user to vote.
pollStartDate DateTime The poll start date.
pollEndDate DateTime The poll end date.
pollOptionsHeight double The poll options height.
pollOptionsWidth double The poll options width.
pollOptionsBorderRadius BorderRadius The poll options border radius.
pollOptionsBorder BoxBorder The poll options border.
pollOptionsFillColor Color The poll options fill color.
pollOptionsSplashColor Color The poll options splash color.
votedPollOptionsRadius Radius The voted poll options border radius.
votedBackgroundColor Color The voted poll options background color.
votedProgressColor Color The voted poll options progress color.
votedCheckmark Widget The voted poll options checkmark.
votedPercentageTextStyle TextStyle The voted poll options percentage text style.
votedAnimationDuration int The voted poll options animation duration.
Owner
Nifemi
Software Engineer. Working with Flutter, Dart, Kotlin, React Native, Javascript and Firebase.
Nifemi
Similar Resources

Flutter-v2 Firebase Messaging, Foreground and Background Notifications + Topic Subscription and Broadcast Notifications Source code

Flutter Notification & FCM The repo is about flutter notification and FCM (Firebase Cloud Messaging). It is updated with Flutter v2 and new updates of

Apr 14, 2022

A Flutter Web Plugin to display Text Widget as Html for SEO purpose

A Flutter Web Plugin to display Text Widget as Html for SEO purpose

SEO Renderer A flutter plugin (under development) to render text widgets as html elements for SEO purpose. Created specifically for issue https://gith

May 8, 2022

Flutter plugins for embedded Linux (eLinux)

Flutter plugins for Embedded Linux (eLinux) This repo is a companion repo to the flutter-elinux. It contains the source code for Flutter plugins for e

May 9, 2022

A new JS script plugin for flutter

js_script Run JS script. Usage // Create a JS context. JsScript script = JsScript(); // Define a class. var classInfo = ClassInfoTestClass( newI

Mar 8, 2022

This plugin allows Flutter desktop apps to defines system tray.

tray_manager This plugin allows Flutter desktop apps to defines system tray. tray_manager Platform Support Quick Start Installation ⚠️ Linux requireme

May 17, 2022

A package to use Material side sheet into your Flutter project. Learn more about side sheet at Material.io

A package to use Material side sheet into your Flutter project. Learn more about side sheet at Material.io

Side Sheet A package to use Material side sheet into your Flutter project. Learn more about side sheet at Material.io Platform Support Android iOS Mac

May 2, 2022

Flutter app that syncs clipboards between devices in the same local network.

clipboard_sync A flutter app that syncs clipboards between devices in the same LAN using Interprocess communication (Sockets). What it does ? group of

Oct 29, 2021

Native context menu for Flutter apps

Native context menu for Flutter apps

native_context_menu Native context menu for flutter apps Installation flutter pub add native_context_menu Usage import 'package:native_context_menu/na

May 10, 2022

Embedded Flutter runtime targeting Embedded Linux with Wayland

ivi-homescreen IVI Homescreen for Wayland Strongly Typed (C++) Lightweight Clang 11 Release Stripped = 151k GCC 9.3 Release Stripped = 168k Source run

May 5, 2022
Flutter-Clock-and-Reminder-App - a highly functional clock and reminder app developed on flutter framework.

clock_app A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if thi

Dec 27, 2021
SMARTmBOT - a new, customizable, scalable, and fully opensource mobile robot platform
SMARTmBOT - a new, customizable, scalable, and fully opensource mobile robot platform

The goal of this repository is to introduce a new, customizable, scalable, and fully opensource mobile robot platform, called SMARTmBOT. This repository provides a guide, and all design files and source codes so that you can build your own SMARTmBOT. SMARTmBOT can be useful for studying the basics of robotics, especially mobile robotics. It can also be used to study advanced topics such as swarm robotics.

May 11, 2022
NoirVisor Customizable VM API Library

NoirCvmApi NoirVisor Customizable VM API Library Introduction NoirVisor is a hardware-accelerated hypervisor solution. This repository is a library pr

May 8, 2022
Customizable Windows taskbar effects.
Customizable Windows taskbar effects.

RainbowTaskbar Lightweight utility for Windows taskbar customization. Supports color effects, transitions, blur, images, rounded corners and transpare

Apr 22, 2022
A customizable hardware prefetching framework using online reinforcement learning as described in the MICRO 2021 paper by Bera and Kanellopoulos et al.
A customizable hardware prefetching framework using online reinforcement learning as described in the MICRO 2021 paper by Bera and Kanellopoulos et al.

A Customizable Hardware Prefetching Framework Using Online Reinforcement Learning Table of Contents What is Pythia? About the Framework Prerequisites

May 7, 2022
Simple evolution simulator with generations mechanic and customizable settings.
Simple evolution simulator with generations mechanic and customizable settings.

SimpleEvolution Simple evolution simulator with generations mechanic and customizable settings. Field is divided in three sections: safe zone, medium

Dec 18, 2021
A cross-platform (Android/iOS/Windows/macOS) cronet plugin for Flutter via `dart:ffi`

cronet_flutter A cross-platform (Android/iOS/Windows/macOS) cronet plugin for Flutter via dart:ffi

May 19, 2022
A Pokemon app made in Flutter for a workshop.

pokedex_app A new Flutter project. Getting Started This project is a starting point for a Flutter application

Jan 26, 2022
A light-weight Flutter Engine Embedder based on HADK ,which for Android devices that runs without any java code

flutter-hadk A light-weight Flutter Engine Embedder based on HADK ,which for Android devices that runs without any java code 1.Build by android-ndk-to

Nov 8, 2021
Acrylic & aero blur effect on Flutter Windows 💙.
Acrylic & aero blur effect on Flutter Windows 💙.

flutter_acrylic Acrylic & aero blur effect on Flutter Windows. Installation Mention in your pubspec.yaml.

May 12, 2022