started implementing Covid-19 DriveThru Test Module
parent
7fdc0da9dc
commit
929e289a6f
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
@ -0,0 +1,68 @@
|
|||||||
|
class DriveThroughTestingCenterModel {
|
||||||
|
int rowID;
|
||||||
|
int iD;
|
||||||
|
int projectID;
|
||||||
|
String setupID;
|
||||||
|
double longitude;
|
||||||
|
double latitude;
|
||||||
|
int numberOfTracks;
|
||||||
|
bool isActive;
|
||||||
|
int createdBy;
|
||||||
|
String createdOn;
|
||||||
|
dynamic editedBy;
|
||||||
|
dynamic editedON;
|
||||||
|
dynamic projectName;
|
||||||
|
dynamic projectNameN;
|
||||||
|
|
||||||
|
DriveThroughTestingCenterModel(
|
||||||
|
{this.rowID,
|
||||||
|
this.iD,
|
||||||
|
this.projectID,
|
||||||
|
this.setupID,
|
||||||
|
this.longitude,
|
||||||
|
this.latitude,
|
||||||
|
this.numberOfTracks,
|
||||||
|
this.isActive,
|
||||||
|
this.createdBy,
|
||||||
|
this.createdOn,
|
||||||
|
this.editedBy,
|
||||||
|
this.editedON,
|
||||||
|
this.projectName,
|
||||||
|
this.projectNameN});
|
||||||
|
|
||||||
|
DriveThroughTestingCenterModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
rowID = json['RowID'];
|
||||||
|
iD = json['ID'];
|
||||||
|
projectID = json['ProjectID'];
|
||||||
|
setupID = json['SetupID'];
|
||||||
|
longitude = json['Longitude'];
|
||||||
|
latitude = json['Latitude'];
|
||||||
|
numberOfTracks = json['NumberOfTracks'];
|
||||||
|
isActive = json['IsActive'];
|
||||||
|
createdBy = json['CreatedBy'];
|
||||||
|
createdOn = json['CreatedOn'];
|
||||||
|
editedBy = json['EditedBy'];
|
||||||
|
editedON = json['EditedON'];
|
||||||
|
projectName = json['ProjectName'];
|
||||||
|
projectNameN = json['ProjectNameN'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['RowID'] = this.rowID;
|
||||||
|
data['ID'] = this.iD;
|
||||||
|
data['ProjectID'] = this.projectID;
|
||||||
|
data['SetupID'] = this.setupID;
|
||||||
|
data['Longitude'] = this.longitude;
|
||||||
|
data['Latitude'] = this.latitude;
|
||||||
|
data['NumberOfTracks'] = this.numberOfTracks;
|
||||||
|
data['IsActive'] = this.isActive;
|
||||||
|
data['CreatedBy'] = this.createdBy;
|
||||||
|
data['CreatedOn'] = this.createdOn;
|
||||||
|
data['EditedBy'] = this.editedBy;
|
||||||
|
data['EditedON'] = this.editedON;
|
||||||
|
data['ProjectName'] = this.projectName;
|
||||||
|
data['ProjectNameN'] = this.projectNameN;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,52 @@
|
|||||||
|
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 CovidDriveThruService extends BaseService {
|
||||||
|
AppSharedPreferences sharedPref = AppSharedPreferences();
|
||||||
|
AppGlobal appGlobal = new AppGlobal();
|
||||||
|
|
||||||
|
AuthenticatedUser authUser = new AuthenticatedUser();
|
||||||
|
AuthProvider authProvider = new AuthProvider();
|
||||||
|
|
||||||
|
Future<Map> getCovidProjectsList(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_COVID_DRIVETHRU_PROJECT_LIST,
|
||||||
|
onSuccess: (response, statusCode) async {
|
||||||
|
localRes = response;
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
throw error;
|
||||||
|
}, body: request);
|
||||||
|
return Future.value(localRes);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue