搜尋套件、儲存庫與 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

原始碼儲存庫

使用此套件的專案

暫無相關資料。