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