updates & fixes
parent
0b6cd845f1
commit
dfa7e0e02f
@ -0,0 +1,54 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||
import 'package:diplomaticquarterapp/core/service/base_service.dart';
|
||||
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
|
||||
import 'package:diplomaticquarterapp/models/Request.dart';
|
||||
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class SmartWatchIntegrationService extends BaseService {
|
||||
AppSharedPreferences sharedPref = AppSharedPreferences();
|
||||
AppGlobal appGlobal = new AppGlobal();
|
||||
|
||||
AuthenticatedUser authUser = new AuthenticatedUser();
|
||||
AuthProvider authProvider = new AuthProvider();
|
||||
|
||||
Future<Map> getLastPatientRecord(BuildContext context) async {
|
||||
Map<String, dynamic> request;
|
||||
|
||||
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
|
||||
var data = AuthenticatedUser.fromJson(
|
||||
await this.sharedPref.getObject(USER_PROFILE));
|
||||
authUser = data;
|
||||
}
|
||||
|
||||
var languageID = await sharedPref.getString(APP_LANGUAGE);
|
||||
Request req = appGlobal.getPublicRequest();
|
||||
|
||||
request = {
|
||||
"LanguageID": languageID == 'ar' ? 1 : 2,
|
||||
"IPAdress": "10.20.10.20",
|
||||
"VersionID": req.VersionID,
|
||||
"Channel": req.Channel,
|
||||
"generalid": 'Cs2020@2016\$2958',
|
||||
"PatientOutSA": authUser.outSA,
|
||||
"TokenID": "",
|
||||
"DeviceTypeID": req.DeviceTypeID,
|
||||
"SessionID": "YckwoXhUmWBsnHKEKig",
|
||||
"PatientID": authUser.patientID != null ? authUser.patientID : 0,
|
||||
"License": true
|
||||
};
|
||||
|
||||
dynamic localRes;
|
||||
|
||||
await baseAppClient.post(GET_PATIENT_LAST_RECORD,
|
||||
onSuccess: (response, statusCode) async {
|
||||
localRes = response;
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
throw error;
|
||||
}, body: request);
|
||||
return Future.value(localRes);
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue