saafe_aa_sdk 0.1.3
saafe_aa_sdk: ^0.1.3 copied to clipboard
Flutter SDK for integrating SAAFE's secure authentication and financial experience
SAAFE AA SDK #
A Flutter SDK for integrating SAAFE's secure authentication and financial experience into your Flutter applications.
Features #
- Display SAAFE's secure authentication flow in a modern bottom sheet WebView
- iOS-like modal transitions with full keyboard handling
- Gesture controls with swipe-to-dismiss and confirmation dialog
- Gracefully handles all application states and edge cases
- Provides callbacks for success, error, load, and cancel events
- Built-in error handling and recovery mechanisms
Installation #
Add this package to your pubspec.yaml
:
dependencies:
saafe_aa_sdk: ^0.1.3
Or install it directly from the command line:
flutter pub add saafe_aa_sdk
Platform Specific Setup #
Android
Ensure your minSdkVersion
is at least 19 (Android 4.4) and compileSdkVersion
is at least 33 in your android/app/build.gradle
:
android {
compileSdkVersion 33
defaultConfig {
minSdkVersion 19
}
}
iOS
Add the following to your ios/Runner/Info.plist
:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
Getting Started #
Initialize the SDK in your app's main function:
import 'package:saafe_aa_sdk/flutter_saafe_sdk.dart';
void main() {
// Initialize SAAFE SDK
SaafeSdk.initialize();
runApp(const MyApp());
}
Then use the SDK to trigger the authentication flow:
void startSaafeFlow() {
final options = SaafeRedirectOptions(
fi: 'your_fi_token',
reqdate: 'your_reqdate',
ecreq: 'your_encrypted_request',
onComplete: (data) {
print('Flow completed: $data');
},
onError: (error) {
print('Error: $error');
},
onCancel: () {
print('Flow cancelled by user');
},
);
final redirectInstance = SaafeSdk.triggerRedirect(context, options);
// You can store the instance to close the flow programmatically later
// redirectInstance.close(); // This will show a confirmation dialog before closing
}
UI Features #
The SDK provides a modern user experience with:
- Beautiful bottom sheet modal with rounded corners
- Proper handling of keyboard presentation
- Custom close confirmation dialog with modern design
- Drag handle at the top for intuitive user interaction
- Absolute positioned close button for easy dismissal
- Loading indicators while content is loading
Platform Support #
- ✅ Android (API 19+)
- ✅ iOS
- ❌ Web (WebView is not supported on Flutter web)
- ❌ macOS (WebView is not supported on macOS)
- ❌ Windows (WebView is not supported on Windows)
- ❌ Linux (WebView is not supported on Linux)
License #
This package is licensed under the MIT License.