EasyLanisClient class
Imperative Lanis client without Riverpod.
Use EasyLanisClient.inMemory, EasyLanisClient.open, or EasyLanisClient.ephemeral to construct, then login and parsers.
Constructors
- EasyLanisClient.ephemeral({required int schoolId, required String username, required String password, AccountType? accountType, HttpClientAdapter? httpAdapter, String userAgent = 'liblanis/0.1.0', UnexpectedErrorHandler? onUnexpectedError})
-
Credentials in memory only — no persistent accounts (smoke tests).
factory
- EasyLanisClient.inMemory({String? documentCacheDirectory, HttpClientAdapter? httpAdapter, String userAgent = 'liblanis/0.1.0', bool storageEnabled = true, Duration? storageMaxAge, int? storageMaxBytes, UnexpectedErrorHandler? onUnexpectedError})
-
In-memory database (CI unit tests, quick scripts).
factory
- EasyLanisClient.open({required String databasePath, required SecretStore secretStore, String? documentCacheDirectory, HttpClientAdapter? httpAdapter, String userAgent = 'liblanis/0.1.0', bool storageEnabled = true, Duration? storageMaxAge, int? storageMaxBytes, UnexpectedErrorHandler? onUnexpectedError})
-
Persistent file database (CLI tools, other apps).
factory
Properties
- accounts → EasyAccounts
-
no setter
- connection → EasyConnection
-
no setter
- database → LanisDatabase
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isAuthenticated → bool
-
no setter
- parsers → EasyParsers
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- session → LanisSession?
-
no setter
- settings → EasySettings
-
no setter
- storage → StorageManager?
-
Document cache manager, or null when not logged in or cache dir unset.
no setter
-
supportedApplets
→ Set<
String> -
PHP applet URLs enabled for the current session and account type.
no setter
Methods
-
dispose(
) → Future< void> - Releases connection, session, and database resources.
-
login(
{int? accountId, String? loginUrl, bool withoutData = false}) → Future< void> - Selects an account, prepares HTTP, and authenticates with SPH.
-
loginPreferred(
) → Future< void> - Selects the preferred startup account and logs in, if one exists.
-
logout(
) → Future< void> - Logs out and clears session state. Parsers are disposed.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited