搜尋套件、儲存庫與 APP 分類

polls 封面
套件詳情v1.0.1

polls

一個用於投票的 Flutter 小部件,此組件模仿了 Twitter 的投票系統。您只需要將資料連接到投票中,即可實現投票與視覺化功能。

近 30 天下載
66
喜歡數
109
Pub 分數
50

安裝套件

flutter pub add polls

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

polls 套件是一個 Flutter widget,可複製 Twitter 投票介面,讓使用者能在應用程式內建立互動式投票系統。它支援即時投票與視覺反饋,非常適合社交媒體功能。開發者可輕鬆整合自己的資料來源來驅動投票,設定需求極少。此套件專注於簡潔與美觀,提供一種乾淨、直覺的方式來收集使用者意見。它設計用於順暢整合至現有的 Flutter 項目。

適用情境

  • 社群媒體應用
  • 用戶反饋收集
  • 社區參與工具
  • 即時投票功能
  • 應用中的互動內容

主要特色

  • Twitter風格的投票UI
  • 投票功能
  • 數據驅動的民調
  • 視覺投票表示
  • 與自定義數據輕鬆整合

適合對象

  • Flutter 開發人員建構社交功能
  • 需要用戶意見收集的應用程式
  • 需要輕量級輪詢系統的項目
  • 尋求簡單、美觀的投票組件的開發者
  • 具有互動內容的行動應用程式

使用建議

  • 需要手動管理資料
  • 無內建後端支援
  • 有限的自定選項
  • 未針對高頻輪詢進行優化
  • 依賴外部狀態管理進行更新

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

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

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。