otlub_flutter_sdk 1.0.0 copy "otlub_flutter_sdk: ^1.0.0" to clipboard
otlub_flutter_sdk: ^1.0.0 copied to clipboard

Official OTLUB Flutter SDK for API integration and authentication

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 #


Made with ❤️ by Vollstech Team

0
likes
110
points
130
downloads

Publisher

unverified uploader

Weekly Downloads

Official OTLUB Flutter SDK for API integration and authentication

Topics

#api #authentication #http #rest #sdk

Documentation

API reference

License

MIT (license)

Dependencies

dio, flutter, flutter_secure_storage, http, intl, json_annotation, logger, shared_preferences

More

Packages that depend on otlub_flutter_sdk