Smart Pay is a secure, premium digital wallet application built with the Flutter framework. It serves as the mobile interface for customers to interact with the Sparkleen Laundry ecosystem, enabling seamless QRIS scanning and Virtual Account / Bank Transfer payments.
- Biometric Authentication: Utilizes local_auth to secure the application with Fingerprint or Face Recognition before accessing the main dashboard.
- Dynamic QR Scanner: Integrates mobile_scanner to scan QR Codes generated by the Sparkleen Laundry cashier system.
- Smart Transfer Matching: Automatically finds pending transactions on the server by cross-referencing the transfer amount and the selected bank.
- Real-time Status Tracking: Displays elegant UI status indicators for pending, successful, and failed transactions.
- Indonesian Localization: Automatically formats dates, times, and currency (Rupiah) according to Indonesian standards without bloated dependencies.
- Optimized Build: Fully configured to support R8/ProGuard minification in Release mode without breaking ML Kit Vision dependencies.
- Flutter SDK: Version 3.12.2 or higher.
- Android Studio / Command Line Tools: For building Android APKs.
- Physical Device: A physical Android device is required to test Biometric (Fingerprint) and Camera capabilities. (Chrome/Web emulation is heavily restricted).
Before compiling the application, ensure it points to the correct production or local Payment API. Open the following file:
lib/config/merchant_config.dart
Ensure the variables are set to match your backend:
class MerchantConfig {
static final MerchantConfig _instance = MerchantConfig._internal();
factory MerchantConfig() => _instance;
MerchantConfig._internal();
/// API URL of the Node.js Payment API (e.g., Railway URL)
String baseUrl = 'https://payment-api-production-ba66.up.railway.app';
/// Master API Key matching the Node.js server
String apiKey = 'my-super-secret-key-123';
}To run the app on your connected device in debug mode (allows Hot Reload but includes debugging bloat):
flutter runTo create a lightweight, optimized APK suitable for end-users, run the following command in your terminal:
flutter build apk --split-per-abiThis command generates multiple APKs targeted for specific CPU architectures (significantly reducing the file size down to ~20MB). You can find the compiled files in:
build/app/outputs/flutter-apk/
To install the lightweight release APK directly to your connected device via USB debugging, use:
flutter run --releaseWhile Smart Pay is currently tailored for Sparkleen Laundry, its architecture is highly modular and can be integrated into any other point-of-sale or e-commerce project.
To adapt Smart Pay for a different project, you only need to ensure your new backend replicates the Node.js API behavior:
- API Endpoints: Your new backend must provide the exact REST API endpoints expected by the
PaymentService(/api/transactions/:id,/api/transactions/find-transfer-target, and/api/transactions/:id/pay). - JSON Contract: Your new backend must return JSON objects that map perfectly to the
TransactionModeldefined inlib/models/transaction.dart. - Update Config: Modify the
baseUrlinmerchant_config.dartto point to your new project's API.
No UI or core logic changes are required within the Flutter application as long as the API contract remains identical.
- Biometric Not Supported (Red Snackbar): Ensure you are running the app on a physical device with a registered fingerprint/face. Emulators and Web Browsers will reject biometric requests.
- Camera Black Screen / Null Pointer Exception: Ensure
isMinifyEnabledandisShrinkResourcesare set tofalsein theandroid/app/build.gradle.ktsrelease block, or proper ProGuard rules are configured for ML Kit. - Invalid API Key: Ensure the
apiKeystring inmerchant_config.dartperfectly matches theAPI_KEYenvironment variable on your Node.js server.