EasyLanisClient.ephemeral constructor
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).
Implementation
factory EasyLanisClient.ephemeral({
required int schoolId,
required String username,
required String password,
AccountType? accountType,
HttpClientAdapter? httpAdapter,
String userAgent = 'liblanis/0.1.0',
UnexpectedErrorHandler? onUnexpectedError,
}) {
LanisClient.configure(
httpAdapter: httpAdapter,
userAgent: userAgent,
onUnexpectedError: onUnexpectedError,
);
final config = LanisClient.config!;
final db = LanisDatabase.open(
path: config.databasePath,
secretStore: config.secretStore,
);
return EasyLanisClient._(
config: config,
db: db,
ephemeral: true,
ephemeralAccount: ClearTextAccount(
localId: 1,
schoolID: schoolId,
schoolName: '',
username: username,
password: password,
accountType: accountType,
),
);
}