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

cart_stepper 封面
插件详情v4.3.0

cart_stepper

一个完全可自定义的 Flutter 小部件,用于获取计数。它适用于电商应用中的购物车计数。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
717
喜欢数
69
Pub 分数
160

安装插件

flutter pub add cart_stepper

插件介绍

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

一个完全可定制的Flutter组件,用于管理并显示项目数量,非常适合电子商务应用。它允许用户通过流畅的动画增加或减少数量,并支持对按钮、文本样式和行为进行自定义。该组件轻量且可无缝集成到购物车或跨多个平台的产品数量选择器中。

适合场景

  • 电子商务产品数量选择
  • 购物车商品数量管理
  • 表单中的可自定义数值输入
  • 移动和网页库存跟踪
  • 实时订单更新

主要特点

  • 完全可自定义的外观
  • 平滑的递增/递减动画
  • 支持所有主要平台
  • 可配置的按钮样式和大小
  • 内置验证和边界控制
  • 与现有 UI 的轻松集成

适合对象

  • 开发电子商务应用的开发者
  • 需要交互式计数器的UI设计师
  • 跨平台移动和Web项目
  • 需要直观数量输入的应用程序

使用建议

  • 需要手动处理状态管理
  • 内置验证功能有限,仅限于范围检查
  • 未针对非常大的数字进行优化
  • 可能需要额外的样式来支持复杂主题
  • 依赖外部依赖项以实现高级功能

原始 README

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

cart_stepper

pub package

A fully customizable Flutter Widget to get count. It can be applicable in e-commerce apps for getting cart count.

This package is Forked from AYNStepperView

Preview

Arguments

  • count: int/double, the number to show
  • stepper: int/double, the number to increasing or decreasing
  • size: double, widget size
  • axis: Axis, layout direction
  • numberSize: double, number spacer, default 2
  • didChangeCount: Function, @required to set the release counter
  • style: CartStepperStyle
  • alwaysExpanded: bool, always expanded while value is 0
  • elevation: double, display a shadow around this widget

CartStepperStyle:

  • activeForegroundColor: Color, text color when counter > 0
  • activeBackgroundColor: Color, background color when counter > 0
  • foregroundColor: Color, text color when counter == 0
  • backgroundColor: Color, background color when counter == 0
  • shape: BoxShape,
  • radius: Radius, the borderRadius of this widget, default caculating a roundedRectAngle
  • BoxBorder: Border of the Widget
  • shadowColor: Color
  • textStyle,
  • iconTheme = const IconThemeData(),
  • iconPlus: IconData, customize the plus icon
  • iconMinus: IconData, customize the minus icon
  • buttonAspectRatio: plus & minux button's aspectRatio, default 1,
  • elevation: Widget's elevation,

Using

Create a widget to show and modify a number:

Widget _buildStepper() {
  return CartStepperInt(
        count: _counter,
        size: 30,
        style: CartStepperTheme.of(context).copyWith(activeForegroundColor: Colors.purple,)
        didChangeCount: (count) {
        setState(() {
        _counter = count;
        });
      },
  );
}

Migrating

// from 3.x to 4.x
// CartStepperStyle.
deActiveForegroundColor => foregroundColor
deActiveBackgroundColor => backgroundColor

OnlineDemo

所属分类

依赖

依赖清单 1 项

源码仓库

使用此插件的项目

暂无相关数据。