搜索插件、代码仓与 APP 分类

counter_button 封面
插件详情v1.0.1

counter_button

计数器按钮是一个 Flutter 库,允许您在增加或减少计数器值时创建带有动画效果的按钮。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
270
喜欢数
31
Pub 分数
160

安装插件

flutter pub add counter_button

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Counter Button 是一个 Flutter 库,提供了一个用于递增和递减计数器值的动画按钮。它在状态变化时提供流畅的视觉反馈,增强了用户交互体验,非常适合用于数值输入控件。该包支持多种平台,包括 Android、iOS、Web、macOS、Windows 和 Linux。通过 `flutter pub add counter_button` 进行简单设置,开发者可以轻松地将动画计数器集成到他们的应用中。其轻量级设计专注于性能和易用性。

适合场景

  • 交互式数字输入
  • 游戏化元素
  • 购物车数量控制
  • 表单字段调整
  • 状态更改的UI反馈

主要特点

  • 动画计数器过渡
  • 跨平台兼容性
  • 与 pubspec.yaml 的简单集成
  • 可自定义外观
  • 状态更改时的流畅 UI 反馈

适合对象

  • 寻求动画计数器的开发者
  • 需要交互式数字输入的应用程序
  • 专注于微交互的UI设计师
  • 初学者Flutter项目
  • 面向多个平台的项目

使用建议

  • 仅限基本计数功能
  • 无内置验证或边界检查
  • 依赖外部动画库
  • 可能需要额外的样式设置以实现复杂设计
  • 未经优化,不适用于高频更新

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

counter_button

pub package GitHub stars GitHub forks GitHub license GitHub issues

Counter Button is a flutter library that allows you to create a button with animation effects when you increase or decrease the counter value.

Screenshots

Demo Loading demo

Installing

dependencies:
  counter_button: ^1.0.1
Import
import 'package:counter_button/counter_button.dart';

How To Use

CounterButton(
  loading: false,
  onChange: (int val) {
    setState(() {
      _counterValue = val;
    });
  },
  count: _counterValue,
  countColor: Colors.purple,
  buttonColor: Colors.purpleAccent,
  progressColor: Colors.purpleAccent,
)

parameters

parameter description default
count Value of the counter
countColor Color of the counter Colors.black
onChange Value change callback when the buttons are pressed
loading For showing the linear progress indicator
progressColor Color of the progress indicator Colors.black
buttonColor Color of the icon button Colors.black
addIcon Add button icon
removeIcon Remove button icon const Icon(Icons.remove)

Bugs & Requests

If you encounter any bugs feel free to open an issue. Raise a ticket on github for suggestions. Pull request are also welcome.

Flutter

For help getting started with Flutter, view our online documentation.

For help on editing plugin code, view the documentation.

License

MIT License

所属分类

源码仓库

使用此插件的项目

暂无相关数据。