OTLUB Flutter SDK
Official Flutter SDK for OTLUB API integration and authentication.
Features
- ✅ Authentication - Login, register, and token management
- ✅ User Management - Get user info and profile data
- ✅ API Integration - Complete OTLUB API integration
- ✅ Secure Storage - Token storage with flutter_secure_storage
- ✅ Error Handling - Comprehensive error management
- ✅ Logging - Detailed logging with logger package
- ✅ Type Safety - Full TypeScript-like type safety with Dart
Installation
Add this to your package's pubspec.yaml
file:
dependencies:
otlub_flutter_sdk: ^1.0.0
Then run:
flutter pub get
Quick Start
1. Initialize the SDK
import 'package:otlub_flutter_sdk/otlub_flutter_sdk.dart';
final otlub = OTLUBClient();
// Initialize the SDK
await otlub.initialize();
2. User Registration
try {
final response = await otlub.register(
email: 'user@example.com',
password: 'SecurePass123!',
firstName: 'John',
lastName: 'Doe',
);
print('Registration successful: ${response.message}');
} catch (e) {
print('Registration failed: $e');
}
3. User Login
try {
final response = await otlub.login('user@example.com', 'SecurePass123!');
print('Login successful!');
print('Access Token: ${response.accessToken}');
print('User ID: ${response.userId}');
} catch (e) {
print('Login failed: $e');
}
4. Get Current User
try {
final user = await otlub.getCurrentUser();
if (user != null) {
print('User: ${user.profile.displayName}');
print('Email: ${user.email}');
print('Status: ${user.status}');
} else {
print('No user logged in');
}
} catch (e) {
print('Failed to get user: $e');
}
5. Health Check
try {
final health = await otlub.healthCheck();
print('API Status: ${health.status}');
print('Services: ${health.services.length}');
} catch (e) {
print('Health check failed: $e');
}
Platform Support
- ✅ Android (API 24+)
- ✅ iOS (iOS 12.0+)
- ✅ Web (All modern browsers)
- ✅ Windows (Windows 10+)
- ✅ macOS (macOS 10.14+)
- ✅ Linux (Ubuntu 18.04+)
Support
- Documentation: https://docs.vollstech.com
- GitHub: https://github.com/vollstech/otlub-flutter-sdk
- Email: support@vollstech.com
Made with ❤️ by Vollstech Team