started implementing Covid-19 DriveThru Test Module

merge-update-with-lab-changes
haroon amjad 5 years ago
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

@ -229,6 +229,8 @@ const GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER = 'Services/Patients.svc/REST/AP_
const SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/SendActivationCodeForAdvancePayment';
const CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment';
const GET_COVID_DRIVETHRU_PROJECT_LIST = 'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter';
const TIMER_MIN = 10;
class AppGlobal {

@ -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;
}
}

@ -782,7 +782,7 @@ class _BookSuccessState extends State<BookSuccess> {
}
Future navigateToHome(context) async {
Navigator.of(context).pushNamed(HOME);
Navigator.of(context).popAndPushNamed(HOME);
}
getAppoQR(context) {

@ -0,0 +1,258 @@
import 'package:diplomaticquarterapp/models/CovidDriveThru/DriveThroughTestingCenterModel.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
import 'package:maps_launcher/maps_launcher.dart';
class CovidDrivethruLocation extends StatefulWidget {
@override
_CovidDrivethruLocationState createState() => _CovidDrivethruLocationState();
}
class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
String projectDropdownValue;
List<DriveThroughTestingCenterModel> projectsList = [];
bool isLocationSelected = false;
String projectLat = "";
String projectLong = "";
String projectName = "";
@override
void initState() {
WidgetsBinding.instance
.addPostFrameCallback((_) => getProjectsList(context));
super.initState();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: "COVID-19 TEST",
isShowAppBar: true,
body: SingleChildScrollView(
child: Container(
margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0),
child: Column(
children: <Widget>[
Container(
alignment: Alignment.centerLeft,
child: Text("Get The Result During 8 Hours",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 22.0,
color: Colors.black)),
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text(
"We are using the advance technology to test COVID-19, The sample for examination is taking between the nose and mouth (nasopharyngeal swab), the examination is done by ELITE In Genius of the company ELITECH GROUP MOLECULAR DIAGNOSTICS, Note that the device belongs to an Italian company and is manufactured in Japan with RC- PCR",
style: TextStyle(fontSize: 16.0, color: Colors.black)),
),
Container(
margin: EdgeInsets.only(top: 20.0),
alignment: Alignment.centerLeft,
child: Text("Select Location",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18.0,
letterSpacing: 0.8,
color: Colors.grey[700])),
),
Container(
height: 60.0,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
color: Colors.grey[400],
width: 1.0,
),
borderRadius: BorderRadius.circular(10),
),
padding: EdgeInsets.all(8.0),
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.only(top: 15.0),
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
hint: new Text("Select Address"),
value: projectDropdownValue,
items: projectsList.map((item) {
return new DropdownMenuItem<String>(
value: item.iD.toString(),
child: new Text(item.projectName),
);
}).toList(),
onChanged: (newValue) {
setState(() {
projectDropdownValue = newValue;
setProjectLocation(newValue);
});
},
),
)),
isLocationSelected
? Container(
margin: EdgeInsets.only(top: 15.0),
alignment: Alignment.centerLeft,
child: Text("Selected Location",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18.0,
letterSpacing: 0.8,
color: Colors.black)),
) : Container(),
isLocationSelected
? Container(
margin: EdgeInsets.only(top: 5.0),
decoration: BoxDecoration(
border: Border.all(color: Colors.grey[400], width: 1.0),
),
child: Image.network(
"https://maps.googleapis.com/maps/api/staticmap?center=" +
this.projectLat +
"," +
this.projectLong +
"&zoom=15&size=800x400&maptype=roadmap&markers=color:red%7C" +
this.projectLat +
"," +
this.projectLong +
"&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8"),
)
: Container(),
],
),
),
),
bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.15,
width: double.infinity,
child: Column(
children: <Widget>[
Container(
margin: EdgeInsets.only(top: 10.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.91,
height: 45.0,
child: RaisedButton(
color: new Color(0xFFc5272d),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: Colors.red[300],
onPressed: () {
getDirections();
},
child:
Text("GET DIRECTIONS", style: TextStyle(fontSize: 18.0)),
),
),
),
Container(
margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0),
child: Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
flex: 1,
child: Container(
margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: Colors.grey[500],
onPressed: () {
back();
},
child: Text("BACK", style: TextStyle(fontSize: 18.0)),
),
),
),
),
Expanded(
flex: 1,
child: Container(
margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: Colors.grey[500],
onPressed: () {
next();
},
child: Text("NEXT", style: TextStyle(fontSize: 18.0)),
),
),
),
),
],
),
),
],
),
),
);
}
getDirections() {
if(isLocationSelected) {
MapsLauncher.launchCoordinates(double.parse(projectLat),double.parse(projectLong), this.projectName);
} else {
Utils.showErrorToast("Please select address from the dropdown menu to get directions");
}
}
next() {
}
back() {
Navigator.of(context).popAndPushNamed(HOME);
}
setProjectLocation(newValue) {
print(newValue);
print(projectsList[(int.parse(newValue) - 1)].projectName);
setState(() {
this.projectLat =
projectsList[(int.parse(newValue) - 1)].latitude.toString();
this.projectLong =
projectsList[(int.parse(newValue) - 1)].longitude.toString();
this.projectName = projectsList[(int.parse(newValue) - 1)].projectName;
isLocationSelected = true;
});
}
getProjectsList(BuildContext context) {
CovidDriveThruService service = new CovidDriveThruService();
service.getCovidProjectsList(context).then((res) {
if (res['MessageStatus'] == 1) {
setState(() {
res['List_COVID19_ProjectDriveThroughTestingCenter'].forEach((v) {
projectsList.add(new DriveThroughTestingCenterModel.fromJson(v));
});
});
} else {}
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
}

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart';
import 'package:diplomaticquarterapp/pages/ContactUs/hmg_service.dart';
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-location.dart';
import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart';
@ -71,7 +72,8 @@ class _HomePageState extends State<HomePage> {
margin: EdgeInsets.all(5),
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/images/new-design/covid_bg_transparent.png"),
image: AssetImage(
"assets/images/new-design/covid_bg_transparent.png"),
fit: BoxFit.fill,
),
color:
@ -100,7 +102,8 @@ class _HomePageState extends State<HomePage> {
),
Container(
margin: EdgeInsets.only(
left: 10.0, top: 10.0),
left: 10.0,
top: 10.0),
child: Column(
children: <Widget>[
Text("Drive-Thru",
@ -127,7 +130,8 @@ class _HomePageState extends State<HomePage> {
0.15,
height: 25.0,
child: RaisedButton(
color: Colors.red[800],
color: Colors
.red[800],
textColor:
Colors.white,
disabledTextColor:
@ -136,11 +140,10 @@ class _HomePageState extends State<HomePage> {
new Color(
0xFFbcc2c4),
onPressed: () {
// if (_isButtonDisabled == false) {
// _searchDoctor(context);
// }
navigateToCovidDriveThru();
},
child: Text("BOOK NOW",
child: Text(
"BOOK NOW",
style: TextStyle(
fontSize:
12.0)),
@ -170,8 +173,9 @@ class _HomePageState extends State<HomePage> {
borderRadius: BorderRadius.all(
Radius.circular(5))),
child: SvgPicture.asset(
projectViewModel.isArabic ? 'assets/images/new-design/livecare_arabic_logo.svg' :
'assets/images/new-design/liveCare_white_logo.svg',
projectViewModel.isArabic
? 'assets/images/new-design/livecare_arabic_logo.svg'
: 'assets/images/new-design/liveCare_white_logo.svg',
),
),
),
@ -742,6 +746,11 @@ class _HomePageState extends State<HomePage> {
),
);
}
navigateToCovidDriveThru() {
Navigator.push(context,
MaterialPageRoute(builder: (context) => CovidDrivethruLocation()));
}
}
class DashboardItem extends StatelessWidget {

@ -28,7 +28,6 @@ class DoctorsListService extends BaseService {
Future<Map> getDoctorsList(
int clinicID, int projectID, bool isNearest, BuildContext context,
{doctorId}) async {
//Utils.showProgressDialog(context);
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {

@ -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);
}
}

@ -18,9 +18,9 @@ class ArrowBack extends StatelessWidget {
}, context),
child: Icon(
projectViewModel.isArabic
? Icons.arrow_back_ios
: Icons.arrow_forward_ios,
color: Theme.of(context).primaryColor),
? Icons.arrow_forward_ios
: Icons.arrow_back_ios,
color: Colors.white),
);
}
}

Loading…
Cancel
Save