mirror of
https://git.proxmox.com/git/flutter/proxmox_login_manager.git
synced 2026-05-24 22:27:36 +00:00
No description
`value` property is deprecated in favor of `initialValue` starting from v3.35 [0]. Replaced the use of `value` prop with `initialValue`. Additionaly, removed the library name, as that is not necessary anymore [1]. [0] - https://docs.flutter.dev/release/breaking-changes/deprecate-dropdownbuttonformfield-value [1] - https://dart.dev/tools/linter-rules/unnecessary_library_name Signed-off-by: Shan Shaji <s.shaji@proxmox.com> |
||
|---|---|---|
| assets | ||
| lib | ||
| test | ||
| .gitignore | ||
| .metadata | ||
| analysis_options.yaml | ||
| LICENSE | ||
| pubspec.lock | ||
| pubspec.yaml | ||
| README.md | ||
proxmox_login_manager
A basic login management library which handles authentication in combination with the proxmox_dart_api_client library.
You need to build the model classes before using it, to do this use:
flutter packages pub run build_runner build
Basic usage:
ProxmoxLoginSelector(
onLogin: (ProxmoxApiClient client) => whatever you want to do with the client,
),
This will give you an authenticated ProxmoxApiClient for usage in your project.
The latest session will be saved and can be recovered.
loginStorage = await ProxmoxLoginStorage.fromLocalStorage();
final apiClient = await loginStorage.recoverLatestSession();
This will either return an authenticated ProxmoxApiClient or will result in an Exception (ProxmoxApiException).
To clear all session on logout you can use:
ProxmoxLoginStorage.fromLocalStorage()
.then((storage) => storage?.invalidateAllSessions());