laser clinic design (cont.)

merge-update-with-lab-changes
Sikander Saleem 4 years ago
parent d2223da3c2
commit cd81f05a8d

@ -269,6 +269,8 @@ const SEND_CHECK_IN_NFC_REQUEST = 'Services/Patients.svc/REST/Patient_CheckAppoi
const HAS_DENTAL_PLAN = 'Services/Doctors.svc/REST/Dental_IsPatientHasOnGoingEstimation'; const HAS_DENTAL_PLAN = 'Services/Doctors.svc/REST/Dental_IsPatientHasOnGoingEstimation';
const LASER_BODY_PARTS = 'Services/Patients.svc/REST/Laser_GetBodyPartsByCategory';
//URL to get medicine and pharmacies list //URL to get medicine and pharmacies list
const CHANNEL = 3; const CHANNEL = 3;
const GENERAL_ID = 'Cs2020@2016\$2958'; const GENERAL_ID = 'Cs2020@2016\$2958';

@ -0,0 +1,64 @@
class LaserBodyPart {
int id;
int category;
String bodyPart;
bool fullBoadyPart;
bool isRetouch;
String timeDuration;
String bodyPartN;
bool isActive;
String mappingCode;
int procedureID;
int orderNum;
String categoryName;
String categoryNameN;
LaserBodyPart(
{this.id,
this.category,
this.bodyPart,
this.fullBoadyPart,
this.isRetouch,
this.timeDuration,
this.bodyPartN,
this.isActive,
this.mappingCode,
this.procedureID,
this.orderNum,
this.categoryName,
this.categoryNameN});
LaserBodyPart.fromJson(Map<String, dynamic> json) {
id = json['Id'];
category = json['Category'];
bodyPart = json['BodyPart'];
fullBoadyPart = json['FullBoadyPart'];
isRetouch = json['IsRetouch'];
timeDuration = json['TimeDuration'];
bodyPartN = json['BodyPartN'];
isActive = json['IsActive'];
mappingCode = json['MappingCode'];
procedureID = json['ProcedureID'];
orderNum = json['OrderNum'];
categoryName = json['CategoryName'];
categoryNameN = json['CategoryNameN'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Id'] = this.id;
data['Category'] = this.category;
data['BodyPart'] = this.bodyPart;
data['FullBoadyPart'] = this.fullBoadyPart;
data['IsRetouch'] = this.isRetouch;
data['TimeDuration'] = this.timeDuration;
data['BodyPartN'] = this.bodyPartN;
data['IsActive'] = this.isActive;
data['MappingCode'] = this.mappingCode;
data['ProcedureID'] = this.procedureID;
data['OrderNum'] = this.orderNum;
data['CategoryName'] = this.categoryName;
data['CategoryNameN'] = this.categoryNameN;
return data;
}
}

@ -108,11 +108,11 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
SizedBox(height: 12), SizedBox(height: 12),
CommonDropDownView( CommonDropDownView(
TranslationBase.of(context).city, TranslationBase.of(context).city,
model.bloodModelList.isNotEmpty model.CitiesModelList.isNotEmpty
? model.bloodModelList[0].city ? projectProvider.isArabic
: projectProvider.isArabic
? model.CitiesModelList[_selectedHospitalIndex].descriptionN ? model.CitiesModelList[_selectedHospitalIndex].descriptionN
: model.CitiesModelList[_selectedHospitalIndex].description, () { : model.CitiesModelList[_selectedHospitalIndex].description
: "", () {
List<RadioSelectionDialogModel> list = [ List<RadioSelectionDialogModel> list = [
for (int i = 0; i < model.CitiesModelList.length; i++) for (int i = 0; i < model.CitiesModelList.length; i++)
RadioSelectionDialogModel(projectProvider.isArabic ? model.CitiesModelList[i].descriptionN : model.CitiesModelList[i].description, i), RadioSelectionDialogModel(projectProvider.isArabic ? model.CitiesModelList[i].descriptionN : model.CitiesModelList[i].description, i),
@ -127,6 +127,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
onValueSelected: (index) { onValueSelected: (index) {
_selectedHospitalIndex = index; _selectedHospitalIndex = index;
_selectedHospital = model.CitiesModelList[index]; _selectedHospital = model.CitiesModelList[index];
setState(() {});
}, },
), ),
); );

@ -0,0 +1,183 @@
import 'package:diplomaticquarterapp/models/Appointments/laser_body_parts.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import '../../../svg_tester.dart';
class LaserClinic extends StatefulWidget {
LaserClinic({Key key}) : super(key: key);
@override
_LaserClinicState createState() {
return _LaserClinicState();
}
}
class _LaserClinicState extends State<LaserClinic> {
List<int> _laserCategoryList = [0, 2, 11];
List<String> _selectedBodyPartList = [];
bool _isFullBody = false;
int _selectedCategoryIndex = 0;
List<LaserBodyPart> laserBodyPartsList = [];
@override
void initState() {
super.initState();
Future.delayed(Duration.zero, () {
callLaserBodyPartsAPI();
});
}
callLaserBodyPartsAPI() async {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.getLaserBodyPartsList(_selectedCategoryIndex).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {
if (res['Laser_GetBodyPartsByCategoryList'].length != 0) {
laserBodyPartsList = [];
res['Laser_GetBodyPartsByCategoryList'].forEach((v) {
laserBodyPartsList.add(LaserBodyPart.fromJson(v));
});
} else {}
});
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
AppToast.showErrorToast(message: err);
});
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).clinic,
showNewAppBar: true,
showNewAppBarTitle: true,
isShowDecPage: false,
backgroundColor: Color(0xfff7f7f7),
body: Column(
children: [
Expanded(
child: Padding(
padding: EdgeInsets.all(21),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
for (var index in _laserCategoryList)
InkWell(
onTap: () {
_selectedCategoryIndex = index;
setState(() {});
callLaserBodyPartsAPI();
},
child: Container(
width: 75,
height: 75,
alignment: Alignment.center,
padding: EdgeInsets.only(left: 4, right: 4),
decoration: BoxDecoration(shape: BoxShape.circle, color: _selectedCategoryIndex == index ? Colors.redAccent : Color(0xff2E303A)),
child: Text(
index == 0 ? "Body" : (index == 2 ? "Face" : "Retouch"),
style: TextStyle(color: Colors.white),
),
),
)
],
),
SizedBox(height: 12),
Expanded(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: ListView.separated(
//shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (cxt, index) {
return InkWell(
onTap: () {
if (_selectedBodyPartList.contains(laserBodyPartsList[index].bodyPart)) {
_selectedBodyPartList.remove(laserBodyPartsList[index].bodyPart);
} else {
_selectedBodyPartList.add(laserBodyPartsList[index].bodyPart);
}
setState(() {});
},
child: Row(
children: [
Container(
width: 24,
height: 24,
alignment: Alignment.center,
decoration:
BoxDecoration(shape: BoxShape.circle, color: _selectedBodyPartList.contains(laserBodyPartsList[index].bodyPart) ? Color(0xff2E303A) : Colors.transparent),
child: Icon(Icons.done, color: _selectedBodyPartList.contains(laserBodyPartsList[index].bodyPart) ? Colors.white : Color(0xff2E303A))),
SizedBox(width: 8),
Expanded(
child: Text(
laserBodyPartsList[index].bodyPart,
style: TextStyle(
color: Color(0xff2E303A),
),
),
),
],
),
);
},
separatorBuilder: (cxt, index) => Divider(
height: 1,
thickness: 1,
color: Color(0xff2E303A),
),
itemCount: laserBodyPartsList.length),
),
Expanded(
child: ListView(
physics: BouncingScrollPhysics(),
children: [
Center(
child: Text(
"Minutes",
style: TextStyle(color: Color(0xff2E303A)),
),
),
Expanded(
child: BodyPartMapper(
dataList: _selectedBodyPartList,
))
],
),
)
],
),
)
],
),
),
),
DefaultButton("Continue", () {}).insideContainer,
],
),
);
}
}

@ -24,6 +24,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'LaserClinic.dart';
import 'LiveCareBookAppointment.dart'; import 'LiveCareBookAppointment.dart';
class SearchByClinic extends StatefulWidget { class SearchByClinic extends StatefulWidget {
@ -71,13 +72,19 @@ class _SearchByClinicState extends State<SearchByClinic> {
if (projectViewModel.isLogin) { if (projectViewModel.isLogin) {
if (radioValue == null) { if (radioValue == null) {
if (projectViewModel.user.gender == 1) { if (projectViewModel.user.gender == 1) {
radioValue = TranslationBase.of(context).male; radioValue = TranslationBase
.of(context)
.male;
} else { } else {
radioValue = TranslationBase.of(context).female; radioValue = TranslationBase
.of(context)
.female;
} }
} }
} else if (radioValue == null) { } else if (radioValue == null) {
radioValue = TranslationBase.of(context).female; radioValue = TranslationBase
.of(context)
.female;
} }
if (ageController.text.isEmpty) { if (ageController.text.isEmpty) {
ageController.text = projectViewModel.isLogin ? projectViewModel.user.age.toString() : ""; ageController.text = projectViewModel.isLogin ? projectViewModel.user.age.toString() : "";
@ -99,7 +106,9 @@ class _SearchByClinicState extends State<SearchByClinic> {
top: 20, top: 20,
), ),
child: Text( child: Text(
TranslationBase.of(context).doctorFilter, TranslationBase
.of(context)
.doctorFilter,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -114,7 +123,9 @@ class _SearchByClinicState extends State<SearchByClinic> {
Padding( Padding(
padding: const EdgeInsets.only(left: 20, right: 20), padding: const EdgeInsets.only(left: 20, right: 20),
child: Text( child: Text(
TranslationBase.of(context).gender, TranslationBase
.of(context)
.gender,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
letterSpacing: -0.48, letterSpacing: -0.48,
@ -131,7 +142,9 @@ class _SearchByClinicState extends State<SearchByClinic> {
child: Row( child: Row(
children: [ children: [
Radio( Radio(
value: TranslationBase.of(context).female, value: TranslationBase
.of(context)
.female,
groupValue: radioValue, groupValue: radioValue,
onChanged: (v) { onChanged: (v) {
setState(() { setState(() {
@ -140,7 +153,9 @@ class _SearchByClinicState extends State<SearchByClinic> {
}, },
), ),
Text( Text(
TranslationBase.of(context).female, TranslationBase
.of(context)
.female,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
letterSpacing: -0.48, letterSpacing: -0.48,
@ -153,7 +168,9 @@ class _SearchByClinicState extends State<SearchByClinic> {
child: Row( child: Row(
children: [ children: [
Radio( Radio(
value: TranslationBase.of(context).male, value: TranslationBase
.of(context)
.male,
groupValue: radioValue, groupValue: radioValue,
onChanged: (v) { onChanged: (v) {
setState(() { setState(() {
@ -162,7 +179,9 @@ class _SearchByClinicState extends State<SearchByClinic> {
}, },
), ),
Text( Text(
TranslationBase.of(context).male, TranslationBase
.of(context)
.male,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
letterSpacing: -0.48, letterSpacing: -0.48,
@ -177,7 +196,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
], ],
), ),
Container(child: inputWidget("Age", "", ageController),margin: EdgeInsets.only(left: 20, right: 20),), Container(child: inputWidget("Age", "", ageController), margin: EdgeInsets.only(left: 20, right: 20),),
], ],
), ),
@ -199,7 +218,9 @@ class _SearchByClinicState extends State<SearchByClinic> {
}); });
}, },
), ),
Text(TranslationBase.of(context).nearestAppo, style: TextStyle(fontSize: 14.0, letterSpacing: -0.56)), Text(TranslationBase
.of(context)
.nearestAppo, style: TextStyle(fontSize: 14.0, letterSpacing: -0.56)),
], ],
), ),
), ),
@ -238,7 +259,9 @@ class _SearchByClinicState extends State<SearchByClinic> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
TranslationBase.of(context).selectClinic, TranslationBase
.of(context)
.selectClinic,
style: TextStyle( style: TextStyle(
fontSize: 11, fontSize: 11,
letterSpacing: -0.44, letterSpacing: -0.44,
@ -254,7 +277,9 @@ class _SearchByClinicState extends State<SearchByClinic> {
}, },
key: clinicDropdownKey, key: clinicDropdownKey,
hint: new Text( hint: new Text(
TranslationBase.of(context).selectClinic, TranslationBase
.of(context)
.selectClinic,
), ),
value: dropdownValue, value: dropdownValue,
iconSize: 0, iconSize: 0,
@ -281,6 +306,9 @@ class _SearchByClinicState extends State<SearchByClinic> {
setState(() { setState(() {
print(newValue); print(newValue);
dropdownValue = newValue; dropdownValue = newValue;
if (dropdownValue == "253-false-0-0") {
Navigator.push(context, FadePage(page: LaserClinic()));
} else
if (!isDentalSelectedAndSupported() && !nearestAppo) { if (!isDentalSelectedAndSupported() && !nearestAppo) {
projectDropdownValue = ""; projectDropdownValue = "";
getDoctorsList(context); getDoctorsList(context);

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-location.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-location.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/svg_tester.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';

@ -1317,4 +1317,19 @@ class DoctorsListService extends BaseService {
}, body: request); }, body: request);
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getLaserBodyPartsList(int laserCategoryID) async {
Map<String, dynamic> request;
request = {
"LaserCategoryID": laserCategoryID,
};
dynamic localRes;
await baseAppClient.post(LASER_BODY_PARTS, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
} }

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save