]> git.proxmox.com Git - flutter/proxmox_login_manager.git/blame - README.md
adapt to toggleableActiveColor property having been deprecated
[flutter/proxmox_login_manager.git] / README.md
CommitLineData
0e468546
TM
1# proxmox_login_manager
2
10c125d8 3A basic login management library which handles authentication in combination
0e468546
TM
4with the proxmox_dart_api_client library.
5
6You need to build the model classes before using it, to do this use:
7```Bash
8flutter packages pub run build_runner build
9```
10Basic usage:
11```dart
12ProxmoxLoginSelector(
13 onLogin: (ProxmoxApiClient client) => whatever you want to do with the client,
14),
15```
16This will give you an authenticated ProxmoxApiClient for usage in your project.
17
18The latest session will be saved and can be recovered.
19```dart
20loginStorage = await ProxmoxLoginStorage.fromLocalStorage();
21final apiClient = await loginStorage.recoverLatestSession();
22```
23This will either return an authenticated ProxmoxApiClient or will result in an
24Exception (ProxmoxApiException).
25
26To clear all session on logout you can use:
27```dart
28ProxmoxLoginStorage.fromLocalStorage()
29 .then((storage) => storage?.invalidateAllSessions());
30```