diff --git a/.github/workflows/flutter_test.yml b/.github/workflows/flutter_test.yml
index 02665af..fa07d11 100644
--- a/.github/workflows/flutter_test.yml
+++ b/.github/workflows/flutter_test.yml
@@ -10,9 +10,30 @@ jobs:
integration-test:
name: integration-test
runs-on: ubuntu-latest
+ env:
+ API_LEVEL: 30
+ TARGET: default
+ ARCH: x86_64
steps:
+ - name: Free disk space
+ uses: jlumbroso/free-disk-space@main
+ with:
+ tool-cache: false
+ android: false
+ dotnet: true
+ haskell: true
+ large-packages: true
+ docker-images: true
+ swap-storage: true
+
- name: Checkout code
- uses: actions/checkout@v3
+ uses: actions/checkout@v6
+
+ - name: Run Mockoon CLI
+ uses: mockoon/cli-action@v3
+ with:
+ data-file: 'https://raw.githubusercontent.com/conekta/openapi/main/mocks/conekta_api.json'
+ port: 3000
- name: Set up Flutter
uses: subosito/flutter-action@v2
@@ -20,40 +41,87 @@ jobs:
flutter-version: '3.x'
channel: 'stable'
cache: true
+
+ - name: Cache Gradle and pub
+ uses: actions/cache@v5
+ with:
+ path: |
+ ~/.gradle/caches
+ ~/.gradle/wrapper
+ ~/.pub-cache
+ android/.gradle
+ key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'pubspec.lock') }}
+ restore-keys: |
+ gradle-${{ runner.os }}-
+
- name: Get Flutter dependencies
run: flutter pub get
- - name: Accept Android licenses
- run: yes | flutter doctor --android-licenses
-
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- - name: Set up Android SDK
+
+ - name: AVD cache
+ uses: actions/cache@v5
+ id: avd-cache
+ with:
+ path: |
+ ~/.android/avd/*
+ ~/.android/adb*
+ key: avd-v2-${{ env.API_LEVEL }}-${{ env.TARGET }}-${{ env.ARCH }}
+
+ - name: Create AVD snapshot
+ if: steps.avd-cache.outputs.cache-hit != 'true'
+ uses: reactivecircus/android-emulator-runner@v2
+ with:
+ api-level: ${{ env.API_LEVEL }}
+ target: ${{ env.TARGET }}
+ arch: ${{ env.ARCH }}
+ cores: 4
+ ram-size: 4096M
+ heap-size: 1024M
+ disable-animations: false
+ force-avd-creation: false
+ emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
+ script: echo "Generated AVD snapshot for caching."
+
+ - name: Run integration tests on Android emulator
uses: reactivecircus/android-emulator-runner@v2
with:
- api-level: 31
+ api-level: ${{ env.API_LEVEL }}
+ target: ${{ env.TARGET }}
+ arch: ${{ env.ARCH }}
+ cores: 4
+ ram-size: 4096M
heap-size: 1024M
disable-animations: true
- cores: 8
- ram-size: 12288M
- target: google_apis
- arch: x86_64
+ force-avd-creation: false
+ emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
script: flutter test integration_test/
test:
- name: Run Flutter Tests
- runs-on: ubuntu-latest
+ name: Run Flutter Tests (Flutter ${{ matrix.flutter-version }})
+ runs-on: aws-runner-set
+ strategy:
+ fail-fast: false
+ matrix:
+ flutter-version: ['3.19.x', '3.24.x', '3.29.x', '3.32.x', '3.x']
steps:
- name: Checkout code
- uses: actions/checkout@v3
+ uses: actions/checkout@v6
+
+ - name: Install xz-utils
+ run: |
+ if ! command -v xz >/dev/null 2>&1; then
+ sudo apt-get update && sudo apt-get install -y xz-utils
+ fi
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
- flutter-version: '3.x'
+ flutter-version: ${{ matrix.flutter-version }}
channel: 'stable'
cache: true
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 138dd5e..be22910 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,13 @@
# Changelog
+
+## [1.0.1] - 2026-04-17
+### Added
+- `CardFormConfig` class to group optional UI flags passed to `CardForm` via the `config` parameter.
+- `CardFormConfig.hideLogo` (default `false`) to show/hide the "Paga segura con Conekta" section.
+- `CardFormConfig.submitButtonText` (default `null`) to override the submit button label; falls back to the localized value when `null`.
+- Widget tests for `CardForm` config flags and `CardFormConfig` defaults.
+- Example usages in `example/lib/main.dart`.
+
## [1.0.0] - 2025-09-30
- Final release
diff --git a/README.md b/README.md
index f20b9cb..d420ddf 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
A customizable Flutter widget for securely collecting credit card information. This library provides a user-friendly form with built-in validation and localization support, making it easy to integrate into your Flutter applications for payment processing.
-**Current Version:** 1.0.0
+**Current Version:** 1.0.1
## Features
@@ -16,7 +16,7 @@ A customizable Flutter widget for securely collecting credit card information. T
## Minimum Requirements
-* **Dart SDK:** Version 2.17.0 or higher
+* **Dart SDK:** Version 3.3.0 or higher (Flutter 3.19.0+)
## Installation
diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml
index 399f698..bd3592b 100644
--- a/android/app/src/debug/AndroidManifest.xml
+++ b/android/app/src/debug/AndroidManifest.xml
@@ -4,4 +4,5 @@
to allow setting breakpoints, to provide hot reload, etc.
-->
+
diff --git a/example/lib/main.dart b/example/lib/main.dart
index fd5f9f9..be584f1 100644
--- a/example/lib/main.dart
+++ b/example/lib/main.dart
@@ -55,8 +55,34 @@ class CreditCardFormScreen extends StatelessWidget {
onSubmitted: _onSubmitted,
paymentService: paymentService,
locale: const Locale('es'),
+ config: const CardFormConfig(
+ hideLogo: false,
+ submitButtonText: 'Pagar ahora',
+ ),
),
),
);
}
}
+
+/// Example: hide the "Paga segura con Conekta" badge and keep the localized
+/// submit label ("Continuar"/"Continue") by leaving [submitButtonText] as null.
+///
+/// ```dart
+/// CardForm(
+/// paymentService: paymentService,
+/// onSubmitted: _onSubmitted,
+/// config: const CardFormConfig(hideLogo: true),
+/// )
+/// ```
+///
+/// Example: English locale with a custom submit label.
+///
+/// ```dart
+/// CardForm(
+/// paymentService: paymentService,
+/// locale: const Locale('en'),
+/// onSubmitted: _onSubmitted,
+/// config: const CardFormConfig(submitButtonText: 'Pay now'),
+/// )
+/// ```
diff --git a/integration_test/card_form_test.dart b/integration_test/card_form_test.dart
index 1b71747..422bb60 100644
--- a/integration_test/card_form_test.dart
+++ b/integration_test/card_form_test.dart
@@ -1,3 +1,5 @@
+import 'dart:io';
+
import 'package:conekta_component/card_input_flutter.dart';
import 'package:conekta_component/l10n/app_localizations.dart';
import 'package:conekta_component/src/fields/card_cvv_field.dart';
@@ -9,17 +11,20 @@ import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
-import 'mocks/mock_payment_service.dart';
-
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
- testWidgets('CardForm submits and returns success', (tester) async {
+ // Android emulator reaches the host machine via 10.0.2.2.
+ final mockoonHost =
+ Platform.isAndroid ? 'http://10.0.2.2:3000' : 'http://localhost:3000';
+
+ testWidgets('CardForm submits against Mockoon and returns success',
+ (tester) async {
bool submitted = false;
await tester.pumpWidget(
MaterialApp(
- localizationsDelegates: [
+ localizationsDelegates: const [
AppLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
@@ -27,7 +32,8 @@ void main() {
],
home: Scaffold(
body: CardForm(
- paymentService: MockPaymentService(apiKey: "key_xxx"),
+ paymentService:
+ PaymentService(apiKey: 'key_xxx', host: mockoonHost),
onSubmitted: (result) {
submitted = result is Success