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

checkout_screen_ui 封面
插件详情v1.1.0

checkout_screen_ui

一个预构建的 UI,代表结账屏幕,旨在与您自己的逻辑结合使用。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
118
喜欢数
45
Pub 分数
160

安装插件

flutter pub add checkout_screen_ui

插件介绍

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

一个预构建的结账屏幕UI组件,专为与自定义业务逻辑无缝集成而设计。它提供了一个精美且响应式的界面,用于收集支付信息,包括信用卡输入、有效期和CVV,适用于电子商务和订阅类应用。该UI在多个平台上进行了优化,确保在Android、iOS、Web、macOS、Windows和Linux上提供一致的用户体验。基于Flutter的灵活性构建,使开发人员能够专注于后端处理,同时提供专业的结账流程。

适合场景

  • 电子商务结账流程
  • 订阅付款收集
  • 移动和网页支付界面
  • 数字产品购买
  • 多平台支付应用
  • 快速集成到现有的 Flutter 项目中

主要特点

  • 预设计的、响应式的结账布局
  • 跨平台兼容性
  • 轻松集成自定义逻辑
  • 卡片输入验证提示
  • 简洁、现代的设计语言
  • 支持所有主要平台

适合对象

  • Flutter 开发人员构建支付功能
  • 需要快速结账实现的初创企业
  • 需要一致的跨平台用户体验的应用程序
  • 注重设计一致性的开发者
  • 团队专注于后端逻辑而非UI设计

使用建议

  • 不包括支付处理逻辑
  • 需要与后端或支付网关集成
  • 可能需要针对品牌特定样式进行自定义
  • 未经额外安全措施,不建议用于生产环境
  • 仅限UI;无内置分词或PCI合规性

原始 README

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

A Widget representing a checkout screen that accepts native and credit card payments along with a button for cash payments if your system has 'in person' payments. This is a UI only widget and is meant to compliment whatever third party transaction api system you are using.

Includes a CreditCardForm widget that allows you to utilize only the credit card form without the rest of the checkout screen if desired.

Security and PCI scope

This package is UI only. Card data exists in memory inside Flutter text controllers while the user types. Never log CardFormResults or raw PAN/CVC in production. In release and profile builds, CardFormResults.toString() is redacted; in debug builds it includes full values for developer convenience—still do not persist it or ship debug logs that contain card data. Send card data only to your PCI-compliant processor (for example Stripe) over TLS, following their integration guidance.

Installation

In the pubspec.yaml of your Flutter project, add:

dependencies:
  checkout_screen_ui: ^1.1.0

Import the barrel (recommended) or specific libraries:

import 'package:checkout_screen_ui/checkout_screen_ui.dart';
// or
import 'package:checkout_screen_ui/checkout_ui.dart';

Usage

The main entry point is CheckoutPage with a CheckoutData object:

final List<PriceItem> priceItems = [
  PriceItem(name: 'Product A', quantity: 1, itemCostCents: 5200),
  PriceItem(name: 'Product B', quantity: 2, itemCostCents: 8599),
];

CheckoutPage(
  data: CheckoutData(
    priceItems: priceItems,
    payToName: 'Vendor Name',
    taxRate: 0.07,
    displayNativePay: true,
    isApple: Platform.isIOS,
    onNativePay: (result) { /* ... */ },
    onCashPay: (result) { /* ... */ },
    onCardPay: (card, result) {
      // card: CardFormResults — never log in production
      // result: CheckOutResult — items, subtotal, tax, total in cents
    },
    onBack: () => Navigator.of(context).pop(),
  ),
  footer: CheckoutPageFooter(
    termsLink: 'https://example.com/terms',
    privacyLink: 'https://example.com/privacy',
  ),
);

Optional theming:

MaterialApp(
  theme: ThemeData(
    extensions: const [
      CheckoutTheme(
        chargeAmountColor: Colors.teal,
        nativePayBackgroundColor: Colors.black,
        nativePayForegroundColor: Colors.white,
      ),
    ],
  ),
  // ...
);

Additional information

If a feature is missing (the Dart language is always evolving) or you'd like an easier or better way to do something, consider opening a pull request. You can always file an issue, but generally speaking feature requests will be on a best-effort basis.

所属分类

依赖

依赖清单 3 项

  • text_form_field_wrapper^1.0.0
  • url_launcher^6.3.2
  • url_launcher_web^2.4.2

源码仓库

使用此插件的项目

暂无相关数据。