stripe_smart_checkout 0.1.1
stripe_smart_checkout: ^0.1.1 copied to clipboard
Modern Flutter package for Stripe Checkout integration with support for one-time payments and subscriptions. Clean architecture, type-safe, cross-platform.
0.1.1 #
Example App Improvements ๐จ #
Simplified and enhanced the example application for better user experience and easier understanding.
Changes
- ๐ฑ Single-Page Example - Consolidated the multi-screen example into a unified, scrollable single-page interface
- All products (one-time payments and subscriptions) visible at once
- No navigation required - tap any product to start checkout immediately
- Cleaner, more intuitive user experience
- ๐ฏ Simplified Dependencies - Removed unnecessary dependencies from example app
- Removed:
flutter_riverpod,go_router,cached_network_image,freezed,json_serializable - Now only requires:
flutterandstripe_smart_checkoutpackage - Reduced complexity and faster setup
- Removed:
- โ
Fixed Dialog Display Issues - Improved success/error dialog handling
- Added proper delay to ensure navigation completes before showing dialogs
- Fixed black background issue when dialogs appear
- Added context safety checks with
context.mounted
- ๐ฆ Better Documentation - Enhanced inline documentation and setup instructions
- Clear setup instructions displayed in the app
- Test card information readily available
- Line number references for API key configuration
Example App Structure
The example is now contained in a single file (example/lib/main.dart) with ~580 lines that demonstrate:
- ๐ณ 3 One-time payment products
- ๐ 3 Subscription plans (weekly, monthly, annual with trials)
- โจ Professional UI with Material Design
- ๐จ Color-coded product cards (blue for payments, purple for subscriptions)
- ๐งช Built-in test card reference
- โ Complete success/error handling with detailed dialogs
Breaking Changes: None
Migration Guide: Existing code using v0.1.0 will continue to work without any changes
0.1.0 #
Initial Release ๐ #
Complete Stripe Checkout integration for Flutter with support for both one-time payments and recurring subscriptions.
Features
- โ One-Time Payments - Single transaction checkout for products and services
- โ Subscriptions - Recurring payments with flexible billing intervals
- โ Billing Intervals - Support for daily, weekly, monthly, and yearly billing
- โ Free Trials - Optional trial periods for subscriptions
- โ Custom Intervals - Bill every N intervals (e.g., quarterly, bi-weekly)
- โ
Named Constructors -
CheckoutItem.payment()andCheckoutItem.subscription() - โ WebView Integration - Embedded Stripe Checkout experience
- โ External Browser - Option to open checkout in default browser
- โ Comprehensive Error Handling - Specific exception types for different error scenarios
- โ Type Safety - Full type safety with proper enums and models
- โ Clean Architecture - Separation of concerns with clear layer boundaries
- โ Cross-Platform - Works on iOS, Android, Web, macOS, Windows, and Linux
- โ Zero Native Code - Pure Dart implementation
- โ Test Mode - Easy switching between test and production environments
API
Core Classes
StripeCheckoutWidget- Main widget for displaying checkoutStripeCheckoutConfig- Configuration for Stripe API keysCheckoutItem- Item class with payment and subscription constructorsCheckoutSession- Represents a completed checkout sessionStripeCheckoutRepository- Repository interface for advanced usage
Enums
CheckoutMode- Payment modes (payment, subscription)BillingInterval- Billing frequencies (day, week, month, year)
Exceptions
StripeCheckoutException- Base exception classStripePaymentException- Payment-specific errorsStripeNetworkException- Network-related errors
Example App
Comprehensive example demonstrating:
- One-time payment products
- Subscription plans with trials
- Dynamic mode detection
- Success/error handling
- Clean Architecture with Riverpod
Documentation
- Complete README with integration guides
- API reference documentation
- Usage examples for both payment types
- Testing guide with test cards
- Architecture documentation
Breaking Changes: None (initial release)
Migration Guide: N/A (initial release)