Aidra Connect
10.0.2+16
Aidra Connect Mobile Application
Loading...
Searching...
No Matches
session_local_datasource.dart
Go to the documentation of this file.
1
import
'dart:convert';
2
3
import
'../../../../../core/constants/strings.dart';
4
import
'../../../../../core/storage/flutter_secure_storage.dart';
5
import
'../../models/session_model.dart';
6
7
class
SessionLocalDataSource
extends
SecureStorage
{
8
SessionLocalDataSource
({super.key =
Strings
.
sessionKey
});
9
10
Future<void>
saveSession
({required
SessionModel
session}) async {
11
await super.save(
value
: jsonEncode(session.toJson()));
12
}
13
14
Future<SessionModel?>
fetchSession
() async {
15
final
json = await super.get();
16
if
(json != null) {
17
return
SessionModel
.fromJson(jsonDecode(json) as Map<String, dynamic>);
18
}
19
return
null;
20
}
21
22
Future<void>
deleteSession
() async {
23
await super.delete();
24
}
25
}
SecureStorage
Definition
flutter_secure_storage.dart:3
SecureStorage::SessionLocalDataSource
SessionLocalDataSource({super.key=Strings.sessionKey})
SecureStorage::fetchSession
Future< SessionModel?> fetchSession() async
Definition
session_local_datasource.dart:14
SecureStorage::saveSession
Future< void > saveSession({required SessionModel session}) async
Definition
session_local_datasource.dart:10
SecureStorage::deleteSession
Future< void > deleteSession() async
Definition
session_local_datasource.dart:22
Strings
Definition
strings.dart:1
Strings::sessionKey
static const String sessionKey
Definition
strings.dart:6
value
final double value
Definition
segmented_circular_progress.dart:41
SessionModel
const SessionModel({ super.id, super.jsonrpc, super.parentId, super.processType, super.db, super.isAdmin, super.isSystem, super.name, super.partnerId, super.statusCode, super.supportUrl, super.uid, super.userContext, super.username, super.token, })
lib
features
authentication
data
data_source
local_datasource
session_local_datasource.dart
Generated by
1.16.1