Skip to content

flutter_freedome_authentication

1.2.0+ is a facade over freedome_client. New code should use the client directly — see doc/migration-to-freedome_client.md.

FreeDome authentication library for Flutter applications.

  • User authentication (login/logout)
  • User registration
  • Password management (change/reset)
  • Token management (access/refresh tokens)
  • Secure password hashing
  • Persistent authentication state

Add this to your package’s pubspec.yaml file:

dependencies:
flutter_freedome_authentication: ^1.0.0
import 'package:flutter_freedome_authentication/flutter_freedome_authentication.dart';
final authService = FreeDomeAuthService(baseUrl: 'https://api.example.com');
// Login
final result = await authService.login(
username: 'user@example.com',
password: 'password123',
);
if (result.success) {
print('Logged in as: ${result.user?.displayName}');
}
// Logout
await authService.logout();
final registrationService = FreeDomeRegistrationService(baseUrl: 'https://api.example.com');
// Register new user
final result = await registrationService.register(
RegistrationRequest(
username: 'newuser',
email: 'user@example.com',
password: 'password123',
firstName: 'John',
lastName: 'Doe',
metadata: {},
),
);
final passwordService = FreeDomePasswordService(baseUrl: 'https://api.example.com');
// Change password
await passwordService.changePassword(
currentPassword: 'oldpassword',
newPassword: 'newpassword',
accessToken: 'your_access_token',
);
// Request password reset
await passwordService.requestPasswordReset('user@example.com');
  • FreeDomeUser - User model with profile information
  • AuthResult - Authentication result with success/error status
  • RegistrationRequest - User registration data
  • PasswordChangeRequest - Password change data
  • PasswordResetRequest - Password reset data
  • FreeDomeAuthService - Main authentication service
  • FreeDomeRegistrationService - User registration service
  • FreeDomePasswordService - Password management service
  • UserLoggedInEvent - Fired when user logs in
  • UserLoggedOutEvent - Fired when user logs out
  • UserRegisteredEvent - Fired when user registers
  • PasswordChangedEvent - Fired when password is changed

NativeMindNONC — see the LICENSE file.

Commercial use → NativeMind sales