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

套件詳情v1.0.3

flutter_counter

Flutter Counter 是一個以 Dart 編寫的簡單且可自訂的外掛,適用於 Flutter。像使用其他組件一樣建立它,根據您的需求加入參數,搞定!

近 30 天下載
42
喜歡數
9
Pub 分數
40

安裝套件

flutter pub add flutter_counter

套件介紹

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

Flutter Counter 是一個輕量級、可自訂的 Dart 套件,專為 Flutter 所設計,提供一個簡單的計數器小部件。可輕鬆整合至任何 Flutter 應用程式中,讓開發者能建立可遞增與遞減的計數器,並支援設定初始值、步幅大小及範圍限制等選項。此小部件設計直覺且彈性,支援自訂樣式與狀態變更的回呼函數。適用於表單、數量選擇器或互動式 UI 元素,以最少設定提升使用者體驗。

適用情境

  • 表單輸入控制項
  • 購物車中的數量選擇器
  • 互動式 UI 元素
  • 使用者偏好設定
  • 遊戲得分追蹤

主要特色

  • 可自定義的初始值
  • 可設定的步長
  • 範圍限制支援
  • 變更時的回調
  • 簡單整合

適合對象

  • 初學者 Flutter 開發者
  • 簡單表單元件
  • 輕量級 UI 增強
  • 快速原型設計
  • 基本數值輸入需求

使用建議

  • 僅限基本計數功能
  • 無內建驗證
  • 不適合複雜的狀態管理
  • 需要手動樣式設定以實現進階設計
  • 無平台特定優化

原始 README

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

Flutter Counter (iOS & Android)

Description

Flutter Counter is a plugin written in dart for flutter which is really simple and customizeable. Create it like any other widget, add params according to your need and presto! You have got the highly customizeable counter with callbacks. Zero boilerplate!



Getting Started

Create this widget as you do with other widgets

Counter(
  initialValue: _defaultValue,
  minValue: 0,
  maxValue: 10,
  step: 0.5,
  decimalPlaces: 1,
  onChanged: (value) { // get the latest value from here
    setState(() {
      _defaultValue = value;
    });
  },
),

Constructor Options

There are some required values and other are for the customization

  @required num initialValue    // default value
  @required this.minValue       // minimum value
  @required this.maxValue       // maximum value
  @required this.onChanged      // callback
  @required this.decimalPlaces  // decimal places you want to show the value of
  this.color                    // color of the buttons
  this.textStyle                // text style which displays the value
  this.step = 1                 // step you want to set to change value
  this.buttonSize = 25          // if you want to change size of button

Beautify your widget with provided customization. You can also change color and size of both buttons and text. Very simple to implement and looks awesome. You can find more details in sample app.

Contributions and Licence

FlutterCounter is available under the MIT license. See the LICENSE file for more info.

Pull requests are welcome! The best contributions will consist of substitutions or configurations for classes/methods known to block the main thread during a typical app lifecycle.

I would love to know if you are using Counter in your app, send an email to [Salmaan Ahmed](mailto:salmaan.ahmed@hotmail.com)

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。