From cd81f05a8de5518bfd15b1da674bb6ba59011d70 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Mon, 1 Nov 2021 17:00:57 +0300 Subject: [PATCH 1/5] laser clinic design (cont.) --- lib/config/config.dart | 2 + lib/models/Appointments/laser_body_parts.dart | 64 +++ lib/pages/Blood/blood_donation.dart | 11 +- .../components/LaserClinic.dart | 183 ++++++++ .../components/SearchByClinic.dart | 404 ++++++++++-------- lib/pages/landing/home_page_2.dart | 1 + .../appointment_services/GetDoctorsList.dart | 15 + lib/svg_tester.dart | 24 ++ 8 files changed, 511 insertions(+), 193 deletions(-) create mode 100644 lib/models/Appointments/laser_body_parts.dart create mode 100644 lib/pages/BookAppointment/components/LaserClinic.dart create mode 100644 lib/svg_tester.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index bbbacaa4..9d4ce5e0 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -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 LASER_BODY_PARTS = 'Services/Patients.svc/REST/Laser_GetBodyPartsByCategory'; + //URL to get medicine and pharmacies list const CHANNEL = 3; const GENERAL_ID = 'Cs2020@2016\$2958'; diff --git a/lib/models/Appointments/laser_body_parts.dart b/lib/models/Appointments/laser_body_parts.dart new file mode 100644 index 00000000..99896868 --- /dev/null +++ b/lib/models/Appointments/laser_body_parts.dart @@ -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 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 toJson() { + final Map data = new Map(); + 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; + } +} diff --git a/lib/pages/Blood/blood_donation.dart b/lib/pages/Blood/blood_donation.dart index 8fb12f33..42023744 100644 --- a/lib/pages/Blood/blood_donation.dart +++ b/lib/pages/Blood/blood_donation.dart @@ -108,11 +108,11 @@ class _BloodDonationPageState extends State { SizedBox(height: 12), CommonDropDownView( TranslationBase.of(context).city, - model.bloodModelList.isNotEmpty - ? model.bloodModelList[0].city - : projectProvider.isArabic - ? model.CitiesModelList[_selectedHospitalIndex].descriptionN - : model.CitiesModelList[_selectedHospitalIndex].description, () { + model.CitiesModelList.isNotEmpty + ? projectProvider.isArabic + ? model.CitiesModelList[_selectedHospitalIndex].descriptionN + : model.CitiesModelList[_selectedHospitalIndex].description + : "", () { List list = [ for (int i = 0; i < model.CitiesModelList.length; i++) RadioSelectionDialogModel(projectProvider.isArabic ? model.CitiesModelList[i].descriptionN : model.CitiesModelList[i].description, i), @@ -127,6 +127,7 @@ class _BloodDonationPageState extends State { onValueSelected: (index) { _selectedHospitalIndex = index; _selectedHospital = model.CitiesModelList[index]; + setState(() {}); }, ), ); diff --git a/lib/pages/BookAppointment/components/LaserClinic.dart b/lib/pages/BookAppointment/components/LaserClinic.dart new file mode 100644 index 00000000..1bc623d3 --- /dev/null +++ b/lib/pages/BookAppointment/components/LaserClinic.dart @@ -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 { + List _laserCategoryList = [0, 2, 11]; + List _selectedBodyPartList = []; + bool _isFullBody = false; + int _selectedCategoryIndex = 0; + List 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, + ], + ), + ); + } +} diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 147cb9f9..5cc81d78 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -24,6 +24,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; +import 'LaserClinic.dart'; import 'LiveCareBookAppointment.dart'; class SearchByClinic extends StatefulWidget { @@ -71,13 +72,19 @@ class _SearchByClinicState extends State { if (projectViewModel.isLogin) { if (radioValue == null) { if (projectViewModel.user.gender == 1) { - radioValue = TranslationBase.of(context).male; + radioValue = TranslationBase + .of(context) + .male; } else { - radioValue = TranslationBase.of(context).female; + radioValue = TranslationBase + .of(context) + .female; } } } else if (radioValue == null) { - radioValue = TranslationBase.of(context).female; + radioValue = TranslationBase + .of(context) + .female; } if (ageController.text.isEmpty) { ageController.text = projectViewModel.isLogin ? projectViewModel.user.age.toString() : ""; @@ -99,7 +106,9 @@ class _SearchByClinicState extends State { top: 20, ), child: Text( - TranslationBase.of(context).doctorFilter, + TranslationBase + .of(context) + .doctorFilter, style: TextStyle( fontSize: 16, fontWeight: FontWeight.w600, @@ -114,7 +123,9 @@ class _SearchByClinicState extends State { Padding( padding: const EdgeInsets.only(left: 20, right: 20), child: Text( - TranslationBase.of(context).gender, + TranslationBase + .of(context) + .gender, style: TextStyle( fontSize: 12, letterSpacing: -0.48, @@ -129,55 +140,63 @@ class _SearchByClinicState extends State { children: [ Flexible( child: Row( - children: [ - Radio( - value: TranslationBase.of(context).female, - groupValue: radioValue, - onChanged: (v) { - setState(() { - radioValue = v; - }); - }, - ), - Text( - TranslationBase.of(context).female, - style: TextStyle( - fontSize: 12, - letterSpacing: -0.48, - fontWeight: FontWeight.w600, - ), - ), - ], - )), + children: [ + Radio( + value: TranslationBase + .of(context) + .female, + groupValue: radioValue, + onChanged: (v) { + setState(() { + radioValue = v; + }); + }, + ), + Text( + TranslationBase + .of(context) + .female, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, + ), + ), + ], + )), Flexible( child: Row( - children: [ - Radio( - value: TranslationBase.of(context).male, - groupValue: radioValue, - onChanged: (v) { - setState(() { - radioValue = v; - }); - }, - ), - Text( - TranslationBase.of(context).male, - style: TextStyle( - fontSize: 12, - letterSpacing: -0.48, - fontWeight: FontWeight.w600, - ), - ), - ], - )), + children: [ + Radio( + value: TranslationBase + .of(context) + .male, + groupValue: radioValue, + onChanged: (v) { + setState(() { + radioValue = v; + }); + }, + ), + Text( + TranslationBase + .of(context) + .male, + style: TextStyle( + fontSize: 12, + letterSpacing: -0.48, + fontWeight: FontWeight.w600, + ), + ), + ], + )), ], ), ), ], ), - 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,164 +218,173 @@ class _SearchByClinicState extends State { }); }, ), - 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)), ], ), ), widget.clnicIds != null && widget.clnicIds.length > 1 && isLoaded == true ? Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: clinicsList.map((result) { - return RoundedContainer( - child: ListTile( - onTap: () { - // setState(() { - dropdownValue = result.clinicID.toString(); - setState(() { - if (!isDentalSelectedAndSupported()) { - projectDropdownValue = ""; - getDoctorsList(context); - } else {} - }); - }, - title: Text(result.clinicDescription, style: TextStyle(fontSize: 14.0, color: Colors.grey[700], letterSpacing: 1.0)))); - }).toList()) + crossAxisAlignment: CrossAxisAlignment.start, + children: clinicsList.map((result) { + return RoundedContainer( + child: ListTile( + onTap: () { + // setState(() { + dropdownValue = result.clinicID.toString(); + setState(() { + if (!isDentalSelectedAndSupported()) { + projectDropdownValue = ""; + getDoctorsList(context); + } else {} + }); + }, + title: Text(result.clinicDescription, style: TextStyle(fontSize: 14.0, color: Colors.grey[700], letterSpacing: 1.0)))); + }).toList()) : InkWell( - onTap: () { - // dropdownKey.currentState; - openDropdown(clinicDropdownKey); - }, - child: Container( - width: double.infinity, - decoration: containerRadius(Colors.white, 12), - margin: EdgeInsets.only(left: 20, right: 20), - padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12), - child: Row( + onTap: () { + // dropdownKey.currentState; + openDropdown(clinicDropdownKey); + }, + child: Container( + width: double.infinity, + decoration: containerRadius(Colors.white, 12), + margin: EdgeInsets.only(left: 20, right: 20), + padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12), + child: Row( + children: [ + Flexible( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Flexible( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context).selectClinic, - style: TextStyle( - fontSize: 11, - letterSpacing: -0.44, - fontWeight: FontWeight.w600, - ), - ), - Container( - height: 18, - child: DropdownButtonHideUnderline( - child: DropdownButton( - onTap: () { - print("Clicked"); - }, - key: clinicDropdownKey, - hint: new Text( - TranslationBase.of(context).selectClinic, - ), - value: dropdownValue, - iconSize: 0, - isExpanded: true, - style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), - items: clinicsList.map((item) { - return new DropdownMenuItem( - value: item.clinicID.toString() + - "-" + - item.isLiveCareClinicAndOnline.toString() + - "-" + - item.liveCareClinicID.toString() + - "-" + - item.liveCareServiceID.toString(), - child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text(item.clinicDescription), - item.isLiveCareClinicAndOnline - ? SvgPicture.asset('assets/images/new-design/video_icon_green_right.svg', height: 12, width: 12, fit: BoxFit.cover) - : Container(), - ]), - ); - }).toList(), - onChanged: (newValue) { - setState(() { - print(newValue); - dropdownValue = newValue; - if (!isDentalSelectedAndSupported() && !nearestAppo) { - projectDropdownValue = ""; - getDoctorsList(context); - } else { - print("Dental"); - } - }); - }, - ), - ), + Text( + TranslationBase + .of(context) + .selectClinic, + style: TextStyle( + fontSize: 11, + letterSpacing: -0.44, + fontWeight: FontWeight.w600, + ), + ), + Container( + height: 18, + child: DropdownButtonHideUnderline( + child: DropdownButton( + onTap: () { + print("Clicked"); + }, + key: clinicDropdownKey, + hint: new Text( + TranslationBase + .of(context) + .selectClinic, ), - ], + value: dropdownValue, + iconSize: 0, + isExpanded: true, + style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), + items: clinicsList.map((item) { + return new DropdownMenuItem( + value: item.clinicID.toString() + + "-" + + item.isLiveCareClinicAndOnline.toString() + + "-" + + item.liveCareClinicID.toString() + + "-" + + item.liveCareServiceID.toString(), + child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + Text(item.clinicDescription), + item.isLiveCareClinicAndOnline + ? SvgPicture.asset('assets/images/new-design/video_icon_green_right.svg', height: 12, width: 12, fit: BoxFit.cover) + : Container(), + ]), + ); + }).toList(), + onChanged: (newValue) { + setState(() { + print(newValue); + dropdownValue = newValue; + if (dropdownValue == "253-false-0-0") { + Navigator.push(context, FadePage(page: LaserClinic())); + } else + if (!isDentalSelectedAndSupported() && !nearestAppo) { + projectDropdownValue = ""; + getDoctorsList(context); + } else { + print("Dental"); + } + }); + }, + ), ), ), - Icon(Icons.keyboard_arrow_down), ], ), ), - ), + Icon(Icons.keyboard_arrow_down), + ], + ), + ), + ), mHeight(20), isDentalSelectedAndSupported() == true || (nearestAppo && isProjectLoaded) ? InkWell( - onTap: () { - openDropdown(projectDropdownKey); - }, - child: Container( - width: double.infinity, - decoration: containerRadius(Colors.white, 12), - margin: EdgeInsets.only(left: 20, right: 20), - padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12), - child: Row( + onTap: () { + openDropdown(projectDropdownKey); + }, + child: Container( + width: double.infinity, + decoration: containerRadius(Colors.white, 12), + margin: EdgeInsets.only(left: 20, right: 20), + padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12), + child: Row( + children: [ + Flexible( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Flexible( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "Select Project", - style: TextStyle( - fontSize: 11, - letterSpacing: -0.44, - fontWeight: FontWeight.w600, - ), - ), - Container( - height: 18, - child: DropdownButtonHideUnderline( - child: DropdownButton( - key: projectDropdownKey, - hint: new Text("Select Project"), - value: projectDropdownValue, - iconSize: 0, - isExpanded: true, - style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black), - items: projectsList.map((item) { - return new DropdownMenuItem( - value: item.mainProjectID.toString(), - child: new Text(item.name), - ); - }).toList(), - onChanged: (newValue) { - setState(() { - projectDropdownValue = newValue; - getDoctorsList(context); - }); - }, - ), - ), - ), - ], + Text( + "Select Project", + style: TextStyle( + fontSize: 11, + letterSpacing: -0.44, + fontWeight: FontWeight.w600, + ), + ), + Container( + height: 18, + child: DropdownButtonHideUnderline( + child: DropdownButton( + key: projectDropdownKey, + hint: new Text("Select Project"), + value: projectDropdownValue, + iconSize: 0, + isExpanded: true, + style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black), + items: projectsList.map((item) { + return new DropdownMenuItem( + value: item.mainProjectID.toString(), + child: new Text(item.name), + ); + }).toList(), + onChanged: (newValue) { + setState(() { + projectDropdownValue = newValue; + getDoctorsList(context); + }); + }, + ), ), ), - Icon(Icons.keyboard_arrow_down), ], - )), - ) + ), + ), + Icon(Icons.keyboard_arrow_down), + ], + )), + ) : Container(), ], ), @@ -538,9 +566,9 @@ class _SearchByClinicState extends State { navigateToDentalComplaints(context, searchInfo); } else if (dropdownValue.split("-")[1] == "true" - // && authProvider.isLogin && - // authUser.patientType == 1 - ) { + // && authProvider.isLogin && + // authUser.patientType == 1 + ) { Navigator.push( context, FadePage( @@ -586,7 +614,7 @@ class _SearchByClinicState extends State { List doctorByHospital = _patientDoctorAppointmentListHospital .where( (elementClinic) => elementClinic.filterName == element.projectName, - ) + ) .toList(); if (doctorByHospital.length != 0) { diff --git a/lib/pages/landing/home_page_2.dart b/lib/pages/landing/home_page_2.dart index 9f395cad..615ff7c7 100644 --- a/lib/pages/landing/home_page_2.dart +++ b/lib/pages/landing/home_page_2.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-location.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/svg_tester.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 3986c8e4..80039ece 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -1317,4 +1317,19 @@ class DoctorsListService extends BaseService { }, body: request); return Future.value(localRes); } + + Future getLaserBodyPartsList(int laserCategoryID) async { + Map 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); + } } diff --git a/lib/svg_tester.dart b/lib/svg_tester.dart new file mode 100644 index 00000000..eec4d371 --- /dev/null +++ b/lib/svg_tester.dart @@ -0,0 +1,24 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_html/flutter_html.dart'; + +class BodyPartMapper extends StatelessWidget { + List dataList; + + BodyPartMapper({Key key, this.dataList}) : super(key: key); + + String jaduu = + ''; + + @override + Widget build(BuildContext context) { + return Html(data: getSvg()); + } + + String getSvg() { + + + String finalSvg = + '$jaduu'; + return finalSvg; + } +} From 3bfca80ab9a859e78b300f067027ce16d8c1c564 Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Sun, 14 Nov 2021 12:04:18 +0300 Subject: [PATCH 2/5] fixed issue --- lib/pages/pharmacy/order/Order.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/pages/pharmacy/order/Order.dart b/lib/pages/pharmacy/order/Order.dart index 8b3f8502..8d6a55b0 100644 --- a/lib/pages/pharmacy/order/Order.dart +++ b/lib/pages/pharmacy/order/Order.dart @@ -51,6 +51,8 @@ class _OrderPageState extends State _tabController = new TabController( length: 4, vsync: this, + + // initialIndex: 1 ); } @@ -379,6 +381,7 @@ class _OrderPageState extends State processingOrderList.add(model.orders[i]); } } + _tabController.index = 1; return Container( width: MediaQuery.of(context).size.width, child: processingOrderList.length != 0 From 9a82b9c3692686b19ebba737a37b1448e2c97546 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Sun, 14 Nov 2021 12:24:14 +0300 Subject: [PATCH 3/5] laser clinic added. --- .../images/new/body_parts/female/abdomin.svg | 345 ++++++++++++ assets/images/new/body_parts/female/anal.svg | 236 +++++++++ .../images/new/body_parts/female/axilla.svg | 346 ++++++++++++ assets/images/new/body_parts/female/back.svg | 236 +++++++++ .../images/new/body_parts/female/bikini.svg | 345 ++++++++++++ .../new/body_parts/female/bikini_line.svg | 345 ++++++++++++ .../images/new/body_parts/female/buttocks.svg | 236 +++++++++ .../images/new/body_parts/female/cheeks.svg | 130 +++++ assets/images/new/body_parts/female/chest.svg | 345 ++++++++++++ .../new/body_parts/female/chest_line.svg | 345 ++++++++++++ assets/images/new/body_parts/female/chin.svg | 129 +++++ assets/images/new/body_parts/female/ears.svg | 130 +++++ .../images/new/body_parts/female/eyebrows.svg | 130 +++++ .../images/new/body_parts/female/full_leg.svg | 348 +++++++++++++ .../new/body_parts/female/full_neck.svg | 129 +++++ .../new/body_parts/female/half_neck.svg | 129 +++++ .../new/body_parts/female/hydra_facial.svg | 128 +++++ .../new/body_parts/female/lower_arm.svg | 346 ++++++++++++ .../new/body_parts/female/lower_leg.svg | 346 ++++++++++++ .../images/new/body_parts/female/shoulder.svg | 346 ++++++++++++ .../new/body_parts/female/side_burn.svg | 130 +++++ .../new/body_parts/female/upper_arm.svg | 346 ++++++++++++ .../new/body_parts/female/upper_leg.svg | 346 ++++++++++++ .../new/body_parts/female/upper_lips.svg | 129 +++++ assets/images/new/body_parts/male/abdomin.svg | 185 +++++++ assets/images/new/body_parts/male/axilla.svg | 186 +++++++ assets/images/new/body_parts/male/back.svg | 188 +++++++ assets/images/new/body_parts/male/bikini.svg | 185 +++++++ .../new/body_parts/male/bikini_line.svg | 185 +++++++ assets/images/new/body_parts/male/cheek.svg | 87 ++++ assets/images/new/body_parts/male/chest.svg | 185 +++++++ .../images/new/body_parts/male/chest_line.svg | 185 +++++++ assets/images/new/body_parts/male/chin.svg | 86 +++ assets/images/new/body_parts/male/ears.svg | 87 ++++ .../images/new/body_parts/male/eyebrows.svg | 87 ++++ .../images/new/body_parts/male/full_leg.svg | 230 ++++++++ .../images/new/body_parts/male/full_neck.svg | 86 +++ .../images/new/body_parts/male/half_neck.svg | 86 +++ .../new/body_parts/male/hydra_facial.svg | 85 +++ .../images/new/body_parts/male/lower_arm.svg | 312 +++++++++++ .../images/new/body_parts/male/lower_leg.svg | 228 ++++++++ .../images/new/body_parts/male/shoulders.svg | 312 +++++++++++ .../images/new/body_parts/male/side_burn.svg | 87 ++++ .../images/new/body_parts/male/upper_arm.svg | 186 +++++++ .../images/new/body_parts/male/upper_leg.svg | 210 ++++++++ .../images/new/body_parts/male/upper_lips.svg | 86 +++ lib/config/localized_values.dart | 6 + .../components/LaserClinic.dart | 493 ++++++++++++++---- .../notification_details_page.dart | 111 ++-- .../notifications/notifications_page.dart | 248 ++++----- lib/pages/landing/home_page_2.dart | 1 - lib/svg_tester.dart | 24 - lib/uitl/laser_body_parts_data.dart | 129 +++++ lib/uitl/translations_delegate_base.dart | 14 +- lib/widgets/buttons/defaultButton.dart | 2 +- lib/widgets/drawer/app_drawer_widget.dart | 2 +- pubspec.yaml | 3 + 57 files changed, 10275 insertions(+), 333 deletions(-) create mode 100644 assets/images/new/body_parts/female/abdomin.svg create mode 100644 assets/images/new/body_parts/female/anal.svg create mode 100644 assets/images/new/body_parts/female/axilla.svg create mode 100644 assets/images/new/body_parts/female/back.svg create mode 100644 assets/images/new/body_parts/female/bikini.svg create mode 100644 assets/images/new/body_parts/female/bikini_line.svg create mode 100644 assets/images/new/body_parts/female/buttocks.svg create mode 100644 assets/images/new/body_parts/female/cheeks.svg create mode 100644 assets/images/new/body_parts/female/chest.svg create mode 100644 assets/images/new/body_parts/female/chest_line.svg create mode 100644 assets/images/new/body_parts/female/chin.svg create mode 100644 assets/images/new/body_parts/female/ears.svg create mode 100644 assets/images/new/body_parts/female/eyebrows.svg create mode 100644 assets/images/new/body_parts/female/full_leg.svg create mode 100644 assets/images/new/body_parts/female/full_neck.svg create mode 100644 assets/images/new/body_parts/female/half_neck.svg create mode 100644 assets/images/new/body_parts/female/hydra_facial.svg create mode 100644 assets/images/new/body_parts/female/lower_arm.svg create mode 100644 assets/images/new/body_parts/female/lower_leg.svg create mode 100644 assets/images/new/body_parts/female/shoulder.svg create mode 100644 assets/images/new/body_parts/female/side_burn.svg create mode 100644 assets/images/new/body_parts/female/upper_arm.svg create mode 100644 assets/images/new/body_parts/female/upper_leg.svg create mode 100644 assets/images/new/body_parts/female/upper_lips.svg create mode 100644 assets/images/new/body_parts/male/abdomin.svg create mode 100644 assets/images/new/body_parts/male/axilla.svg create mode 100644 assets/images/new/body_parts/male/back.svg create mode 100644 assets/images/new/body_parts/male/bikini.svg create mode 100644 assets/images/new/body_parts/male/bikini_line.svg create mode 100644 assets/images/new/body_parts/male/cheek.svg create mode 100644 assets/images/new/body_parts/male/chest.svg create mode 100644 assets/images/new/body_parts/male/chest_line.svg create mode 100644 assets/images/new/body_parts/male/chin.svg create mode 100644 assets/images/new/body_parts/male/ears.svg create mode 100644 assets/images/new/body_parts/male/eyebrows.svg create mode 100644 assets/images/new/body_parts/male/full_leg.svg create mode 100644 assets/images/new/body_parts/male/full_neck.svg create mode 100644 assets/images/new/body_parts/male/half_neck.svg create mode 100644 assets/images/new/body_parts/male/hydra_facial.svg create mode 100644 assets/images/new/body_parts/male/lower_arm.svg create mode 100644 assets/images/new/body_parts/male/lower_leg.svg create mode 100644 assets/images/new/body_parts/male/shoulders.svg create mode 100644 assets/images/new/body_parts/male/side_burn.svg create mode 100644 assets/images/new/body_parts/male/upper_arm.svg create mode 100644 assets/images/new/body_parts/male/upper_leg.svg create mode 100644 assets/images/new/body_parts/male/upper_lips.svg delete mode 100644 lib/svg_tester.dart create mode 100644 lib/uitl/laser_body_parts_data.dart diff --git a/assets/images/new/body_parts/female/abdomin.svg b/assets/images/new/body_parts/female/abdomin.svg new file mode 100644 index 00000000..cc1dd1d0 --- /dev/null +++ b/assets/images/new/body_parts/female/abdomin.svg @@ -0,0 +1,345 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/female/anal.svg b/assets/images/new/body_parts/female/anal.svg new file mode 100644 index 00000000..96c9734d --- /dev/null +++ b/assets/images/new/body_parts/female/anal.svg @@ -0,0 +1,236 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/female/axilla.svg b/assets/images/new/body_parts/female/axilla.svg new file mode 100644 index 00000000..257b1c08 --- /dev/null +++ b/assets/images/new/body_parts/female/axilla.svg @@ -0,0 +1,346 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/female/back.svg b/assets/images/new/body_parts/female/back.svg new file mode 100644 index 00000000..96eba049 --- /dev/null +++ b/assets/images/new/body_parts/female/back.svg @@ -0,0 +1,236 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/female/bikini.svg b/assets/images/new/body_parts/female/bikini.svg new file mode 100644 index 00000000..24892c80 --- /dev/null +++ b/assets/images/new/body_parts/female/bikini.svg @@ -0,0 +1,345 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/female/bikini_line.svg b/assets/images/new/body_parts/female/bikini_line.svg new file mode 100644 index 00000000..f1f94b7f --- /dev/null +++ b/assets/images/new/body_parts/female/bikini_line.svg @@ -0,0 +1,345 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/female/buttocks.svg b/assets/images/new/body_parts/female/buttocks.svg new file mode 100644 index 00000000..59cd0071 --- /dev/null +++ b/assets/images/new/body_parts/female/buttocks.svg @@ -0,0 +1,236 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/female/cheeks.svg b/assets/images/new/body_parts/female/cheeks.svg new file mode 100644 index 00000000..6305ce65 --- /dev/null +++ b/assets/images/new/body_parts/female/cheeks.svg @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/female/chest.svg b/assets/images/new/body_parts/female/chest.svg new file mode 100644 index 00000000..3b681f90 --- /dev/null +++ b/assets/images/new/body_parts/female/chest.svg @@ -0,0 +1,345 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/female/chest_line.svg b/assets/images/new/body_parts/female/chest_line.svg new file mode 100644 index 00000000..dc4f8b25 --- /dev/null +++ b/assets/images/new/body_parts/female/chest_line.svg @@ -0,0 +1,345 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/female/chin.svg b/assets/images/new/body_parts/female/chin.svg new file mode 100644 index 00000000..37da45b4 --- /dev/null +++ b/assets/images/new/body_parts/female/chin.svg @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/female/ears.svg b/assets/images/new/body_parts/female/ears.svg new file mode 100644 index 00000000..758a69e6 --- /dev/null +++ b/assets/images/new/body_parts/female/ears.svg @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/female/eyebrows.svg b/assets/images/new/body_parts/female/eyebrows.svg new file mode 100644 index 00000000..9657daa7 --- /dev/null +++ b/assets/images/new/body_parts/female/eyebrows.svg @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/female/full_leg.svg b/assets/images/new/body_parts/female/full_leg.svg new file mode 100644 index 00000000..e1a5e46d --- /dev/null +++ b/assets/images/new/body_parts/female/full_leg.svg @@ -0,0 +1,348 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/female/full_neck.svg b/assets/images/new/body_parts/female/full_neck.svg new file mode 100644 index 00000000..f73f07f8 --- /dev/null +++ b/assets/images/new/body_parts/female/full_neck.svg @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/female/half_neck.svg b/assets/images/new/body_parts/female/half_neck.svg new file mode 100644 index 00000000..78e4cfab --- /dev/null +++ b/assets/images/new/body_parts/female/half_neck.svg @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/female/hydra_facial.svg b/assets/images/new/body_parts/female/hydra_facial.svg new file mode 100644 index 00000000..6a468211 --- /dev/null +++ b/assets/images/new/body_parts/female/hydra_facial.svg @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/female/lower_arm.svg b/assets/images/new/body_parts/female/lower_arm.svg new file mode 100644 index 00000000..6d5d2f39 --- /dev/null +++ b/assets/images/new/body_parts/female/lower_arm.svg @@ -0,0 +1,346 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/female/lower_leg.svg b/assets/images/new/body_parts/female/lower_leg.svg new file mode 100644 index 00000000..4961af4b --- /dev/null +++ b/assets/images/new/body_parts/female/lower_leg.svg @@ -0,0 +1,346 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/female/shoulder.svg b/assets/images/new/body_parts/female/shoulder.svg new file mode 100644 index 00000000..ce611e29 --- /dev/null +++ b/assets/images/new/body_parts/female/shoulder.svg @@ -0,0 +1,346 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/female/side_burn.svg b/assets/images/new/body_parts/female/side_burn.svg new file mode 100644 index 00000000..123216e7 --- /dev/null +++ b/assets/images/new/body_parts/female/side_burn.svg @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/female/upper_arm.svg b/assets/images/new/body_parts/female/upper_arm.svg new file mode 100644 index 00000000..ec126ffd --- /dev/null +++ b/assets/images/new/body_parts/female/upper_arm.svg @@ -0,0 +1,346 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/female/upper_leg.svg b/assets/images/new/body_parts/female/upper_leg.svg new file mode 100644 index 00000000..b1fd3a95 --- /dev/null +++ b/assets/images/new/body_parts/female/upper_leg.svg @@ -0,0 +1,346 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/female/upper_lips.svg b/assets/images/new/body_parts/female/upper_lips.svg new file mode 100644 index 00000000..72043376 --- /dev/null +++ b/assets/images/new/body_parts/female/upper_lips.svg @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/male/abdomin.svg b/assets/images/new/body_parts/male/abdomin.svg new file mode 100644 index 00000000..82e2d556 --- /dev/null +++ b/assets/images/new/body_parts/male/abdomin.svg @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/male/axilla.svg b/assets/images/new/body_parts/male/axilla.svg new file mode 100644 index 00000000..85abbfda --- /dev/null +++ b/assets/images/new/body_parts/male/axilla.svg @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/male/back.svg b/assets/images/new/body_parts/male/back.svg new file mode 100644 index 00000000..7d9aeb46 --- /dev/null +++ b/assets/images/new/body_parts/male/back.svg @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/male/bikini.svg b/assets/images/new/body_parts/male/bikini.svg new file mode 100644 index 00000000..1c545916 --- /dev/null +++ b/assets/images/new/body_parts/male/bikini.svg @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/male/bikini_line.svg b/assets/images/new/body_parts/male/bikini_line.svg new file mode 100644 index 00000000..7fdc51d1 --- /dev/null +++ b/assets/images/new/body_parts/male/bikini_line.svg @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/male/cheek.svg b/assets/images/new/body_parts/male/cheek.svg new file mode 100644 index 00000000..984a59f8 --- /dev/null +++ b/assets/images/new/body_parts/male/cheek.svg @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/male/chest.svg b/assets/images/new/body_parts/male/chest.svg new file mode 100644 index 00000000..85a761fe --- /dev/null +++ b/assets/images/new/body_parts/male/chest.svg @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/male/chest_line.svg b/assets/images/new/body_parts/male/chest_line.svg new file mode 100644 index 00000000..806ddb0c --- /dev/null +++ b/assets/images/new/body_parts/male/chest_line.svg @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/male/chin.svg b/assets/images/new/body_parts/male/chin.svg new file mode 100644 index 00000000..9fdee93e --- /dev/null +++ b/assets/images/new/body_parts/male/chin.svg @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/male/ears.svg b/assets/images/new/body_parts/male/ears.svg new file mode 100644 index 00000000..1c9600c3 --- /dev/null +++ b/assets/images/new/body_parts/male/ears.svg @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/male/eyebrows.svg b/assets/images/new/body_parts/male/eyebrows.svg new file mode 100644 index 00000000..ea385230 --- /dev/null +++ b/assets/images/new/body_parts/male/eyebrows.svg @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/male/full_leg.svg b/assets/images/new/body_parts/male/full_leg.svg new file mode 100644 index 00000000..b5755167 --- /dev/null +++ b/assets/images/new/body_parts/male/full_leg.svg @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/male/full_neck.svg b/assets/images/new/body_parts/male/full_neck.svg new file mode 100644 index 00000000..43183598 --- /dev/null +++ b/assets/images/new/body_parts/male/full_neck.svg @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/male/half_neck.svg b/assets/images/new/body_parts/male/half_neck.svg new file mode 100644 index 00000000..4e57b51c --- /dev/null +++ b/assets/images/new/body_parts/male/half_neck.svg @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/male/hydra_facial.svg b/assets/images/new/body_parts/male/hydra_facial.svg new file mode 100644 index 00000000..10516304 --- /dev/null +++ b/assets/images/new/body_parts/male/hydra_facial.svg @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/male/lower_arm.svg b/assets/images/new/body_parts/male/lower_arm.svg new file mode 100644 index 00000000..c8dbf48d --- /dev/null +++ b/assets/images/new/body_parts/male/lower_arm.svg @@ -0,0 +1,312 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/male/lower_leg.svg b/assets/images/new/body_parts/male/lower_leg.svg new file mode 100644 index 00000000..091c29a4 --- /dev/null +++ b/assets/images/new/body_parts/male/lower_leg.svg @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/male/shoulders.svg b/assets/images/new/body_parts/male/shoulders.svg new file mode 100644 index 00000000..bd6cac52 --- /dev/null +++ b/assets/images/new/body_parts/male/shoulders.svg @@ -0,0 +1,312 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/male/side_burn.svg b/assets/images/new/body_parts/male/side_burn.svg new file mode 100644 index 00000000..156b30f1 --- /dev/null +++ b/assets/images/new/body_parts/male/side_burn.svg @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/male/upper_arm.svg b/assets/images/new/body_parts/male/upper_arm.svg new file mode 100644 index 00000000..7d959a0d --- /dev/null +++ b/assets/images/new/body_parts/male/upper_arm.svg @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/male/upper_leg.svg b/assets/images/new/body_parts/male/upper_leg.svg new file mode 100644 index 00000000..342cfd84 --- /dev/null +++ b/assets/images/new/body_parts/male/upper_leg.svg @@ -0,0 +1,210 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/new/body_parts/male/upper_lips.svg b/assets/images/new/body_parts/male/upper_lips.svg new file mode 100644 index 00000000..b7ae6e0f --- /dev/null +++ b/assets/images/new/body_parts/male/upper_lips.svg @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 72c06137..1adb5839 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -64,6 +64,7 @@ const Map localizedValues = { 'appointmentSuccess': {'en': 'Appointment is successfully booked', 'ar': 'تم حجز الموعد بنجاح'}, 'docQualifications': {'en': 'Doctor Qualifications', 'ar': 'مؤهلات الطبيب'}, 'pressAgain': {'en': 'Press again to exit the app', 'ar': 'اضغط مرة أخرى للخروج من التطبيق'}, + 'laserMaxLimitReach': {'en': "Maximum limit is 90 minutes", 'ar': "الحد الأقصى هو 90 دقيقة"}, 'confirmAppoHeading': {'en': 'Kindly review your Appointment', 'ar': 'يرجى تأكيد موعدك'}, 'patientInfo': {'en': 'Patient Information', 'ar': 'معلومات المريض'}, 'doctorFilter': {'en': 'Doctors will be filtered based on your gender and age', 'ar': 'سيتم تصفية الأطباء بناءً على جنسك وعمرك'}, @@ -793,6 +794,11 @@ const Map localizedValues = { "respiration-signs": {"en": "Respiration", "ar": "تنفس"}, "sys-dias": {"en": "SBP/DBP", "ar": "إنقباض/إنبساط"}, "body": {"en": "Body Mass", "ar": "كتلة\nالجسم"}, + "body_string": {"en": "Body", "ar": "الجسم"}, + "face": {"en": "Face", "ar": "وجه"}, + "retouch": {"en": "Retouch", "ar": "تنميق"}, + "bikini": {"en": "Bikini", "ar": "بيكيني"}, + "totalMinutes": {"en": "Total Minutes", "ar": "إجمالي الدقائق"}, "feedback": {"en": "Feedback", "ar": "رأيك يهمنا"}, "send": {"en": "Send", "ar": "أرسل"}, "status": {"en": "Status", "ar": "الحالة"}, diff --git a/lib/pages/BookAppointment/components/LaserClinic.dart b/lib/pages/BookAppointment/components/LaserClinic.dart index 1bc623d3..b1b8a154 100644 --- a/lib/pages/BookAppointment/components/LaserClinic.dart +++ b/lib/pages/BookAppointment/components/LaserClinic.dart @@ -1,13 +1,14 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; 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/laser_body_parts_data.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'; +import 'package:provider/provider.dart'; class LaserClinic extends StatefulWidget { LaserClinic({Key key}) : super(key: key); @@ -18,36 +19,62 @@ class LaserClinic extends StatefulWidget { } } -class _LaserClinicState extends State { - List _laserCategoryList = [0, 2, 11]; - List _selectedBodyPartList = []; +class _LaserClinicState extends State with SingleTickerProviderStateMixin { + List _laserCategoryList = [1, 2, 11]; + List _selectedBodyPartList = []; bool _isFullBody = false; + LaserBodyPart fullBody; int _selectedCategoryIndex = 0; List laserBodyPartsList = []; + TabController _tabController; + int _duration = 0; + + List maleLaserCategory = []; + List femaleLaserCategory = []; + @override void initState() { super.initState(); + _tabController = TabController(length: 2, vsync: this); + _tabController.addListener(() { + if (_tabController.indexIsChanging) { + } else { + _selectedBodyPartList = List(); + laserBodyPartsList = List(); + _selectedCategoryIndex = 0; + setState(() {}); + if (_tabController.index == 0) { + callLaserBodyPartsAPI(maleLaserCategory[_selectedCategoryIndex].laserCategoryID); + } else { + callLaserBodyPartsAPI(femaleLaserCategory[_selectedCategoryIndex].laserCategoryID); + } + } + }); Future.delayed(Duration.zero, () { - callLaserBodyPartsAPI(); + callLaserBodyPartsAPI(maleLaserCategory[_selectedCategoryIndex].laserCategoryID); }); } - callLaserBodyPartsAPI() async { + callLaserBodyPartsAPI(int laserCategoryId) async { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.getLaserBodyPartsList(_selectedCategoryIndex).then((res) { + service.getLaserBodyPartsList(laserCategoryId).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 {} - }); + if (res['Laser_GetBodyPartsByCategoryList'].length != 0) { + List _tempList = List(); + res['Laser_GetBodyPartsByCategoryList'].forEach((v) { + _tempList.add(LaserBodyPart.fromJson(v)); + }); + if (_tempList[0].category == 1 || _tempList[0].category == 11 || _tempList[0].category == 2 || _tempList[0].category == 10) { + fullBody = _tempList[0]; + _tempList.removeAt(0); + } + laserBodyPartsList = _tempList; + } else {} + setState(() {}); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } @@ -58,126 +85,368 @@ class _LaserClinicState extends State { }); } + bool lastIndexIsFirst = false; + bool isLastIndexIsBack = false; + ProjectViewModel projectViewModel; + + bool get isMale => _tabController.index == 0; + @override void dispose() { super.dispose(); + _tabController.dispose(); } @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); + maleLaserCategory = [ + LaserCategoryType(1, TranslationBase.of(context).bodyString), + LaserCategoryType(2, TranslationBase.of(context).face), + LaserCategoryType(11, TranslationBase.of(context).retouch), + ]; + femaleLaserCategory = [ + LaserCategoryType(1, TranslationBase.of(context).bodyString), + LaserCategoryType(2, TranslationBase.of(context).face), + LaserCategoryType(10, TranslationBase.of(context).bikini), + LaserCategoryType(11, TranslationBase.of(context).retouch), + ]; return AppScaffold( - appBarTitle: TranslationBase.of(context).clinic, + appBarTitle: TranslationBase.of(context).laserClinic, showNewAppBar: true, showNewAppBarTitle: true, isShowDecPage: false, backgroundColor: Color(0xfff7f7f7), body: Column( children: [ + TabBar( + controller: _tabController, + indicatorWeight: 3.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Color(0xff2B353E), + unselectedLabelColor: Color(0xff575757), + labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), + labelStyle: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + unselectedLabelStyle: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + tabs: [Text(TranslationBase.of(context).male), Text(TranslationBase.of(context).female)], + ), 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), - ), - ), - ) - ], + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [male(), female()], + ), + ), + Row( + children: [ + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).totalMinutes + ":", + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + color: Color(0xff575757), + letterSpacing: -0.48, + ), + ), + Text( + "${getDuration()} / 90", + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold, + color: Color(0xff2E303A), + letterSpacing: -0.64, + ), + ), + ], + ), + ), + Expanded( + child: DefaultButton( + TranslationBase.of(context).continues, + () {}, + color: Color(0xff359846), + ), + ), + ], + ).insideContainer, + ], + ), + ); + } + + int getDuration() { + int duration = 0; + if (_isFullBody) { + _duration = int.parse(fullBody.timeDuration); + return _duration; + } + + var lowerUpperLegsList = _selectedBodyPartList.where((element) => element.mappingCode == "47" || element.mappingCode == "48")?.toList() ?? []; + var upperLowerArmsList = _selectedBodyPartList.where((element) => element.mappingCode == "40" || element.mappingCode == "41")?.toList() ?? []; + + if (_selectedBodyPartList.length > 0) { + duration = _selectedBodyPartList.fold(0, (previousValue, element) => previousValue + int.parse(element.timeDuration)); + } + print("duration:$duration"); + if (lowerUpperLegsList.length == 2) { + duration -= 30; + } + print("duration1:$duration"); + if (upperLowerArmsList.length == 2) { + duration -= 15; + } + print("duration2:$duration"); + // for (int i = 0; i < _selectedBodyPartList.length; i++) { + // if ( + // + // (lowerUpperLegsList.length == 2 && (_selectedBodyPartList[i].mappingCode == "47" || _selectedBodyPartList[i].mappingCode == "48")) || + // (upperLowerArmsList.length == 2 && (_selectedBodyPartList[i].mappingCode == "40" || _selectedBodyPartList[i].mappingCode == "41")) + // + // + // ) { + // print("duration:$duration"); + // + // duration += 15; + // print("duration1:$duration"); + // } else { + // duration += int.parse(_selectedBodyPartList[i].timeDuration); + // } + // } + print(duration); + _duration = duration; + return duration; + } + + Widget laserCategoryWidget(List list, VoidCallback onTap) { + return SizedBox( + height: 40, + child: ListView.separated( + itemCount: list.length, + physics: BouncingScrollPhysics(), + scrollDirection: Axis.horizontal, + separatorBuilder: (cxt, index) => SizedBox(width: 8), + itemBuilder: (cxt, index) { + return InkWell( + onTap: () { + // setState(() { + _selectedCategoryIndex = index; + // }); + onTap(); + }, + child: Container( + decoration: BoxDecoration( + color: _selectedCategoryIndex == index ? Color(0xffD02127) : Colors.white, + borderRadius: BorderRadius.circular(36), + border: Border.all( + width: 1, + color: _selectedCategoryIndex == index ? Colors.transparent : Color(0xffEAEAEA), + ), + ), + padding: EdgeInsets.symmetric(vertical: 11, horizontal: 26), + child: Text( + list[index].title, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + color: _selectedCategoryIndex == index ? Colors.white : Color(0xff535353), + letterSpacing: -0.48, + ), + ), + ), + ); + }, + ), + ); + } + + Widget bodyPartsGridView() { + return Container( + padding: EdgeInsets.symmetric(vertical: 21, horizontal: 14), + margin: EdgeInsets.only(top: 16), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(15.0), + ), + boxShadow: [ + BoxShadow( + color: Color(0xff000000).withOpacity(.05), + blurRadius: 27, + offset: Offset(0, -3), + ), + ], + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + if (fullBody != null) + Row( + children: [ + SizedBox( + width: 22, + height: 22, + child: Theme( + data: Theme.of(context).copyWith( + unselectedWidgetColor: Color(0xffEAEAEA), + ), + child: Checkbox( + value: _isFullBody, + onChanged: (value) { + setState(() { + if (value) { + _selectedBodyPartList.clear(); + } + _isFullBody = !_isFullBody; + }); + }, + activeColor: Color(0xffD02127), + ), ), - 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(), + ), + SizedBox(width: 12), + Text( + projectViewModel.isArabic ? fullBody.bodyPartN : fullBody.bodyPart, + style: TextStyle(fontSize: 15, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.6, height: 21 / 14), + ), + ], + ), + GridView.builder( + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 85 / 107, crossAxisSpacing: 4, mainAxisSpacing: 21), + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: laserBodyPartsList.length, + padding: fullBody != null ? EdgeInsets.only(top: 16) : EdgeInsets.zero, + itemBuilder: (BuildContext context, int index) { + bool _isSelected = _selectedBodyPartList.any((file) => file.id == laserBodyPartsList[index].id); + return InkWell( + onTap: _isFullBody + ? null + : () { + if (_duration >= 90) { + if (_isSelected) { + _selectedBodyPartList.removeWhere((element) => element.id == laserBodyPartsList[index].id); + + // _selectedBodyPartList.remove(laserBodyPartsList[index]); + setState(() {}); + return; + } + AppToast.showToast(message: TranslationBase.of(context).laserMaxLimitReach); + return; + } + if (_isSelected) { + _selectedBodyPartList.removeWhere((element) => element.id == laserBodyPartsList[index].id); + // _selectedBodyPartList.remove(laserBodyPartsList[index]); + } else { + if (_duration + int.parse(laserBodyPartsList[index].timeDuration) > 90) { + AppToast.showToast(message: TranslationBase.of(context).laserMaxLimitReach); + return; + } + _selectedBodyPartList.add(laserBodyPartsList[index]); + } + setState(() {}); + }, + child: AnimatedOpacity( + opacity: _isFullBody ? 0.25 : 1.0, + duration: Duration(milliseconds: 200), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AspectRatio( + aspectRatio: 97 / 97, + child: FittedBox( + fit: BoxFit.fitWidth, + child: Stack( + alignment: Alignment.topRight, children: [ - Center( - child: Text( - "Minutes", - style: TextStyle(color: Color(0xff2E303A)), + Container( + margin: EdgeInsets.only(top: 5, right: 5), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15.0), + border: Border.all(color: _isSelected ? Color(0xffD02127) : Color(0xffEAEAEA), width: 2), ), + child: LaserBodyParts() + .getCategoryImage(isMale, (isMale ? maleLaserCategory : femaleLaserCategory)[_selectedCategoryIndex].laserCategoryID, laserBodyPartsList[index].mappingCode), ), - Expanded( - child: BodyPartMapper( - dataList: _selectedBodyPartList, - )) + if (_isSelected) + Container( + width: 18, + height: 18, + child: Icon(Icons.done, color: Colors.white, size: 12), + decoration: BoxDecoration( + color: Color(0xffD02127), + borderRadius: BorderRadius.circular(30.0), + ), + ), ], ), - ) - ], - ), - ) - ], - ), - ), + ), + ), + SizedBox(height: 6), + Expanded( + child: Text( + projectViewModel.isArabic ? laserBodyPartsList[index].bodyPartN : laserBodyPartsList[index].bodyPart, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.48, + ), + ), + ), + ], + ), + ), + ); + }, ), - DefaultButton("Continue", () {}).insideContainer, ], ), ); } + + Widget male() { + return ListView( + physics: BouncingScrollPhysics(), + padding: EdgeInsets.all(21), + children: [ + laserCategoryWidget(maleLaserCategory, () { + callLaserBodyPartsAPI(maleLaserCategory[_selectedCategoryIndex].laserCategoryID); + }), + if (laserBodyPartsList.isNotEmpty) bodyPartsGridView() + ], + ); + } + + Widget female() { + return ListView( + physics: BouncingScrollPhysics(), + padding: EdgeInsets.all(21), + children: [ + laserCategoryWidget(femaleLaserCategory, () { + callLaserBodyPartsAPI(femaleLaserCategory[_selectedCategoryIndex].laserCategoryID); + }), + if (laserBodyPartsList.isNotEmpty) bodyPartsGridView() + ], + ); + } +} + +class LaserCategoryType { + int laserCategoryID; + String title; + + LaserCategoryType(this.laserCategoryID, this.title); } diff --git a/lib/pages/DrawerPages/notifications/notification_details_page.dart b/lib/pages/DrawerPages/notifications/notification_details_page.dart index 7633ab9c..7c352c7d 100644 --- a/lib/pages/DrawerPages/notifications/notification_details_page.dart +++ b/lib/pages/DrawerPages/notifications/notification_details_page.dart @@ -34,70 +34,69 @@ class NotificationsDetailsPage extends StatelessWidget { @override Widget build(BuildContext context) { - return BaseView( - builder: (_, model, widget) => AppScaffold( - isShowAppBar: true, - showNewAppBar: true, - showNewAppBarTitle: true, - appBarTitle: TranslationBase.of(context).notificationDetails, - body: SingleChildScrollView( - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - children: [ - SizedBox( - height: 25, - ), - Container( - width: double.infinity, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Text( - DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(notification.createdOn)) + " " + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(notification.createdOn), false), - style: TextStyle( + + return AppScaffold( + isShowAppBar: true, + showNewAppBar: true, + showNewAppBarTitle: true, + appBarTitle: TranslationBase.of(context).notificationDetails, + body: SingleChildScrollView( + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + SizedBox( + height: 25, + ), + Container( + width: double.infinity, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(notification.createdOn)) + " " + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(notification.createdOn), false), + style: TextStyle( fontSize: 18.0, color: Colors.black, fontWeight: FontWeight.w600 - ), ), ), ), - SizedBox( - height: 15, - ), - if (notification.messageTypeData.length != 0) - FractionallySizedBox( - widthFactor: 0.9, - child: Image.network(notification.messageTypeData, - loadingBuilder: (BuildContext context, Widget child, - ImageChunkEvent loadingProgress) { - if (loadingProgress == null) return child; - return Center( - child: SizedBox( - width: 40.0, - height: 40.0, - child: AppCircularProgressIndicator(), - ), - ); - }, - fit: BoxFit - .fill) //Image.network(notification.messageTypeData), - ), - SizedBox( - height: 15, + ), + SizedBox( + height: 15, + ), + if (notification.messageTypeData.length != 0) + FractionallySizedBox( + widthFactor: 0.9, + child: Image.network(notification.messageTypeData, + loadingBuilder: (BuildContext context, Widget child, + ImageChunkEvent loadingProgress) { + if (loadingProgress == null) return child; + return Center( + child: SizedBox( + width: 40.0, + height: 40.0, + child: AppCircularProgressIndicator(), + ), + ); + }, + fit: BoxFit + .fill) //Image.network(notification.messageTypeData), ), - Row( - children: [ - Expanded( - child: Center( - child: Text(notification.message), - ), + SizedBox( + height: 15, + ), + Row( + children: [ + Expanded( + child: Center( + child: Text(notification.message), ), - ], - ), - ], - ), + ), + ], + ), + ], ), ), ), diff --git a/lib/pages/DrawerPages/notifications/notifications_page.dart b/lib/pages/DrawerPages/notifications/notifications_page.dart index 6ae318c3..fc34dbfe 100644 --- a/lib/pages/DrawerPages/notifications/notifications_page.dart +++ b/lib/pages/DrawerPages/notifications/notifications_page.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_request_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/notifications_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; @@ -21,158 +22,131 @@ class NotificationsPage extends StatelessWidget { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); + AppGlobal.context = context; return BaseView( onModelReady: (model) { - GetNotificationsRequestModel getNotificationsRequestModel = - new GetNotificationsRequestModel( - currentPage: currentIndex, - pagingSize: 14, - notificationStatusID: 2); + GetNotificationsRequestModel getNotificationsRequestModel = new GetNotificationsRequestModel(currentPage: currentIndex, pagingSize: 14, notificationStatusID: 2); model.getNotifications(getNotificationsRequestModel, context); }, builder: (_, model, widget) => AppScaffold( - isShowAppBar: true, - showNewAppBar: true, - showNewAppBarTitle: true, - appBarTitle: TranslationBase.of(context).notifications, - baseViewModel: model, - body: ListView.separated( - itemBuilder: (context, index) { - if (index == model.notifications.length) { - return InkWell( - onTap: () async { - GifLoaderDialogUtils.showMyDialog(context); - currentIndex++; - GetNotificationsRequestModel - getNotificationsRequestModel = - new GetNotificationsRequestModel( - currentPage: currentIndex, - pagingSize: 14, - notificationStatusID: 2); - - await model.getNotifications( - getNotificationsRequestModel, context); - GifLoaderDialogUtils.hideDialog(context); - }, - child: Center( - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - // Image.asset('assets/images/notf.png'), - Icon( - Icons.notifications_active, - color: CustomColors.accentColor, - size: 40, - ), - Padding( - padding: const EdgeInsets.only(left: 10.0, right: 10.0), - child: Text(TranslationBase.of(context).moreNotifications, style: TextStyle( - color: CustomColors.accentColor, - fontWeight: FontWeight.w600, - letterSpacing: -0.64, - decoration: TextDecoration.underline - )), - ), - ], - ), - ), - ); - } - + isShowAppBar: true, + showNewAppBar: true, + showNewAppBarTitle: true, + appBarTitle: TranslationBase.of(context).notifications, + baseViewModel: model, + body: ListView.separated( + itemBuilder: (context, index) { + if (index == model.notifications.length) { return InkWell( onTap: () async { - if (!model.notifications[index].isRead) { - model.markAsRead(model.notifications[index].id); - } - Navigator.push( - context, - FadePage( - page: NotificationsDetailsPage( - notification: model.notifications[index], - ))); + GifLoaderDialogUtils.showMyDialog(context); + currentIndex++; + GetNotificationsRequestModel getNotificationsRequestModel = new GetNotificationsRequestModel(currentPage: currentIndex, pagingSize: 14, notificationStatusID: 2); + + await model.getNotifications(getNotificationsRequestModel, context); + GifLoaderDialogUtils.hideDialog(context); }, - child: Container( - width: double.infinity, - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: model.notifications[index].isRead - ? Theme.of(context).scaffoldBackgroundColor - : CustomColors.accentColor.withOpacity(0.05), - border: projectViewModel.isArabic - ? Border( - right: BorderSide( - color: model.notifications[index].isRead - ? Theme.of(context).scaffoldBackgroundColor - : CustomColors.accentColor, - width: 5.0, - ), - ) - : Border( - left: BorderSide( - color: model.notifications[index].isRead - ? Theme.of(context).scaffoldBackgroundColor - : CustomColors.accentColor, - width: 5.0, - ), - ), - ), + child: Center( child: Row( - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts(DateUtil.getDayMonthYearDateFormatted( - DateUtil.convertStringToDate(model - .notifications[index].createdOn)) + - " " + - DateUtil.formatDateToTimeLang( - DateUtil.convertStringToDate(model - .notifications[index].createdOn), - false)), - SizedBox( - height: 5, - ), - Row( - children: [ - Expanded( - child: Texts(model - .notifications[index].message)), - if (model - .notifications[index].messageType == - "image") - Icon( - FontAwesomeIcons.images, - color: CustomColors.grey, - ) - ], - ), - SizedBox( - height: 5, - ), - ], - ), - ), + mainAxisAlignment: MainAxisAlignment.center, + children: [ + // Image.asset('assets/images/notf.png'), + Icon( + Icons.notifications_active, + color: CustomColors.accentColor, + size: 40, + ), + Padding( + padding: const EdgeInsets.only(left: 10.0, right: 10.0), + child: Text(TranslationBase.of(context).moreNotifications, + style: TextStyle(color: CustomColors.accentColor, fontWeight: FontWeight.w600, letterSpacing: -0.64, decoration: TextDecoration.underline)), ), ], ), ), ); - }, - separatorBuilder: (context, index) { - return Column( - children: [ - Divider( - color: Colors.grey[300], - thickness: 2.0, - ), - ], - ); - }, - itemCount: model.notifications.length + 1)), + } + + return InkWell( + onTap: () async { + if (!model.notifications[index].isRead) { + model.markAsRead(model.notifications[index].id); + } + Navigator.push( + context, + FadePage( + page: NotificationsDetailsPage( + notification: model.notifications[index], + ))); + }, + child: Container( + width: double.infinity, + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor.withOpacity(0.05), + border: projectViewModel.isArabic + ? Border( + right: BorderSide( + color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor, + width: 5.0, + ), + ) + : Border( + left: BorderSide( + color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor, + width: 5.0, + ), + ), + ), + child: Row( + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(model.notifications[index].createdOn)) + + " " + + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(model.notifications[index].createdOn), false)), + SizedBox( + height: 5, + ), + Row( + children: [ + Expanded(child: Texts(model.notifications[index].message)), + if (model.notifications[index].messageType == "image") + Icon( + FontAwesomeIcons.images, + color: CustomColors.grey, + ) + ], + ), + SizedBox( + height: 5, + ), + ], + ), + ), + ), + ], + ), + ), + ); + }, + separatorBuilder: (context, index) { + return Column( + children: [ + Divider( + color: Colors.grey[300], + thickness: 2.0, + ), + ], + ); + }, + itemCount: model.notifications.length + 1), + ), ); } } diff --git a/lib/pages/landing/home_page_2.dart b/lib/pages/landing/home_page_2.dart index 615ff7c7..9f395cad 100644 --- a/lib/pages/landing/home_page_2.dart +++ b/lib/pages/landing/home_page_2.dart @@ -4,7 +4,6 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-location.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/svg_tester.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; diff --git a/lib/svg_tester.dart b/lib/svg_tester.dart deleted file mode 100644 index eec4d371..00000000 --- a/lib/svg_tester.dart +++ /dev/null @@ -1,24 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_html/flutter_html.dart'; - -class BodyPartMapper extends StatelessWidget { - List dataList; - - BodyPartMapper({Key key, this.dataList}) : super(key: key); - - String jaduu = - ''; - - @override - Widget build(BuildContext context) { - return Html(data: getSvg()); - } - - String getSvg() { - - - String finalSvg = - '$jaduu'; - return finalSvg; - } -} diff --git a/lib/uitl/laser_body_parts_data.dart b/lib/uitl/laser_body_parts_data.dart new file mode 100644 index 00000000..b8e8e58e --- /dev/null +++ b/lib/uitl/laser_body_parts_data.dart @@ -0,0 +1,129 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter_svg/svg.dart'; + +class LaserBodyParts { + static final LaserBodyParts _instance = LaserBodyParts._internal(); + + LaserBodyParts._internal(); + + factory LaserBodyParts() => _instance; + + static Widget image(String assetUri) { + return new SvgPicture.asset(assetUri, fit: BoxFit.cover,width: 97,height: 97,); + } + + Map maleBodyMap = { + "40": image("assets/images/new/body_parts/male/upper_arm.svg"), + "41": image("assets/images/new/body_parts/male/lower_arm.svg"), + "42": image("assets/images/new/body_parts/male/chest.svg"), + "43": image("assets/images/new/body_parts/male/chest_line.svg"), + "44": image("assets/images/new/body_parts/male/shoulders.svg"), + "45": image("assets/images/new/body_parts/male/back.svg"), + "46": image("assets/images/new/body_parts/male/abdomin.svg"), + "47": image("assets/images/new/body_parts/male/upper_leg.svg"), + "48": image("assets/images/new/body_parts/male/lower_leg.svg"), + "49": image("assets/images/new/body_parts/male/axilla.svg") + }; + + Map maleFaceMap = { + "62": image("assets/images/new/body_parts/male/hydra_facial.svg"), + "5": image("assets/images/new/body_parts/male/upper_lips.svg"), + "6": image("assets/images/new/body_parts/male/chin.svg"), + "7": image("assets/images/new/body_parts/male/cheek.svg"), + "8": image("assets/images/new/body_parts/male/side_burn.svg"), + "9": image("assets/images/new/body_parts/male/ears.svg"), + "10": image("assets/images/new/body_parts/male/full_neck.svg"), + "11": image("assets/images/new/body_parts/male/half_neck.svg"), + "12": image("assets/images/new/body_parts/male/eyebrows.svg") + }; + + Map maleBodyRetouchMap = { + "51": image("assets/images/new/body_parts/male/upper_arm.svg"), + "52": image("assets/images/new/body_parts/male/lower_arm.svg"), + "53": image("assets/images/new/body_parts/male/chest.svg"), + "54": image("assets/images/new/body_parts/male/shoulders.svg"), + "55": image("assets/images/new/body_parts/male/back.svg"), + "56": image("assets/images/new/body_parts/male/abdomin.svg"), + "57": image("assets/images/new/body_parts/male/full_leg.svg"), + "58": image("assets/images/new/body_parts/male/upper_leg.svg"), + "59": image("assets/images/new/body_parts/male/lower_leg.svg"), + "60": image("assets/images/new/body_parts/male/bikini.svg"), + "61": image("assets/images/new/body_parts/male/bikini_line.svg") + }; + + Map femaleBodyMap = { + "40": image("assets/images/new/body_parts/female/upper_arm.svg"), + "41": image("assets/images/new/body_parts/female/lower_arm.svg"), + "42": image("assets/images/new/body_parts/female/chest.svg"), + "43": image("assets/images/new/body_parts/female/chest_line.svg"), + "44": image("assets/images/new/body_parts/female/shoulder.svg"), + "45": image("assets/images/new/body_parts/female/back.svg"), + "46": image("assets/images/new/body_parts/female/abdomin.svg"), + "47": image("assets/images/new/body_parts/female/upper_leg.svg"), + "48": image("assets/images/new/body_parts/female/lower_leg.svg"), + "49": image("assets/images/new/body_parts/female/axilla.svg") + }; + + Map femaleFaceMap = { + "62": image("assets/images/new/body_parts/female/hydra_facial.svg"), + "5": image("assets/images/new/body_parts/female/upper_lips.svg"), + "6": image("assets/images/new/body_parts/female/chin.svg"), + "7": image("assets/images/new/body_parts/female/cheeks.svg"), + "8": image("assets/images/new/body_parts/female/side_burn.svg"), + "9": image("assets/images/new/body_parts/female/ears.svg"), + "10": image("assets/images/new/body_parts/female/full_neck.svg"), + "11": image("assets/images/new/body_parts/female/half_neck.svg"), + "12": image("assets/images/new/body_parts/female/eyebrows.svg") + }; + + Map femaleBodyBikiniMap = { + "34": image("assets/images/new/body_parts/female/bikini.svg"), + "36": image("assets/images/new/body_parts/female/bikini_line.svg"), + "38": image("assets/images/new/body_parts/female/buttocks.svg"), + "39": image("assets/images/new/body_parts/female/anal.svg") + }; + + Map femaleBodyRetouchMap = { + "51": image("assets/images/new/body_parts/female/upper_arm.svg"), + "52": image("assets/images/new/body_parts/female/lower_arm.svg"), + "53": image("assets/images/new/body_parts/female/chest.svg"), + "54": image("assets/images/new/body_parts/female/shoulder.svg"), + "55": image("assets/images/new/body_parts/female/back.svg"), + "56": image("assets/images/new/body_parts/female/abdomin.svg"), + "57": image("assets/images/new/body_parts/female/full_leg.svg"), + "58": image("assets/images/new/body_parts/female/upper_leg.svg"), + "59": image("assets/images/new/body_parts/female/lower_leg.svg"), + "60": image("assets/images/new/body_parts/female/bikini.svg"), + "61": image("assets/images/new/body_parts/female/bikini_line.svg") + }; + + + Widget getCategoryImage(bool isMale, int category, String mappingCode) { + if (isMale) { + if (category == 1) { + return maleBodyMap[mappingCode]; + } + if (category == 2) { + return maleFaceMap[mappingCode]; + } + if (category == 11) { + return maleBodyRetouchMap[mappingCode]; + } + } else { + if (category == 1) { + return femaleBodyMap[mappingCode]; + } + if (category == 2) { + return femaleFaceMap[mappingCode]; + } + if (category == 10) { + return femaleBodyBikiniMap[mappingCode]; + } + if (category == 11) { + return femaleBodyRetouchMap[mappingCode]; + } + } + return null; + } +} diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 92656188..88c053e7 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -121,6 +121,8 @@ class TranslationBase { String get pressAgain => localizedValues['pressAgain'][locale.languageCode]; + String get laserMaxLimitReach => localizedValues['laserMaxLimitReach'][locale.languageCode]; + String get confirmLiveCare => localizedValues['confirmLiveCare'][locale.languageCode]; String get doctorFilter => localizedValues['doctorFilter'][locale.languageCode]; @@ -1338,6 +1340,16 @@ class TranslationBase { String get body => localizedValues['body'][locale.languageCode]; + String get bodyString => localizedValues['body_string'][locale.languageCode]; + + String get bikini => localizedValues['bikini'][locale.languageCode]; + + String get totalMinutes => localizedValues['totalMinutes'][locale.languageCode]; + + String get face => localizedValues['face'][locale.languageCode]; + + String get retouch => localizedValues['retouch'][locale.languageCode]; + String get feedbackTitle => localizedValues['feedback'][locale.languageCode]; String get send => localizedValues['send'][locale.languageCode]; @@ -1397,6 +1409,7 @@ class TranslationBase { String get enablingWifi => localizedValues['enablingWifi'][locale.languageCode]; String get offerAndPackages => localizedValues['offerAndPackages'][locale.languageCode]; + String get offerAndPackagesDetails => localizedValues['offerAndPackagesDetails'][locale.languageCode]; String get invoiceNo => localizedValues['InvoiceNo'][locale.languageCode]; @@ -2583,7 +2596,6 @@ class TranslationBase { String get cholesTitle => localizedValues["cholesTitle"][locale.languageCode]; String get laserClinic => localizedValues["laserClinic"][locale.languageCode]; - } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/buttons/defaultButton.dart b/lib/widgets/buttons/defaultButton.dart index 274ef651..14e93d66 100644 --- a/lib/widgets/buttons/defaultButton.dart +++ b/lib/widgets/buttons/defaultButton.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; -extension WithContainer on DefaultButton { +extension WithContainer on Widget { Widget get insideContainer => Container(color: Colors.white, padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), child: this); } diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index affcb02a..f961d15a 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -360,7 +360,7 @@ class _AppDrawerState extends State { onTap: () { //NotificationsPage // Navigator.of(context).pop(); - if (!projectProvider.isLoginChild) Navigator.push(AppGlobal.context, FadePage(page: NotificationsPage())); + if (!projectProvider.isLoginChild) Navigator.push(context, FadePage(page: NotificationsPage())); }, ), if (projectProvider.havePrivilege(3)) diff --git a/pubspec.yaml b/pubspec.yaml index 3bdadc73..8c6c1fc7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -226,6 +226,9 @@ flutter: - assets/images/new/services/ - assets/images/new/appointment-rating/ - assets/images/new/payment/ + - assets/images/new/body_parts/ + - assets/images/new/body_parts/male/ + - assets/images/new/body_parts/female/ fonts: - family: WorkSans From 084c82d7a841e60a053db0d5b539312049a3aa85 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Sun, 14 Nov 2021 13:18:38 +0300 Subject: [PATCH 4/5] improvements --- .../notification_details_page.dart | 1 - lib/pages/parent_categorise_page.dart | 1893 +++++++---------- 2 files changed, 774 insertions(+), 1120 deletions(-) diff --git a/lib/pages/DrawerPages/notifications/notification_details_page.dart b/lib/pages/DrawerPages/notifications/notification_details_page.dart index a2658a79..4e249e53 100644 --- a/lib/pages/DrawerPages/notifications/notification_details_page.dart +++ b/lib/pages/DrawerPages/notifications/notification_details_page.dart @@ -100,7 +100,6 @@ class NotificationsDetailsPage extends StatelessWidget { ), ), ), - ), ); } } diff --git a/lib/pages/parent_categorise_page.dart b/lib/pages/parent_categorise_page.dart index 461e837c..33e616a5 100644 --- a/lib/pages/parent_categorise_page.dart +++ b/lib/pages/parent_categorise_page.dart @@ -5,7 +5,6 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_deta import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart'; import 'package:diplomaticquarterapp/pages/sub_categories_modalsheet.dart'; import 'package:diplomaticquarterapp/pages/sub_categorise_page.dart'; @@ -14,10 +13,8 @@ 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/uitl/utils.dart'; -import 'package:diplomaticquarterapp/widgets/Loader/gif_loader_container.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/entity_checkbox_list.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; @@ -34,14 +31,12 @@ class ParentCategorisePage extends StatefulWidget { String id; String titleName; - AuthenticatedUserObject authenticatedUserObject = - locator(); + AuthenticatedUserObject authenticatedUserObject = locator(); ParentCategorisePage({this.id, this.titleName}); @override - _ParentCategorisePageState createState() => - _ParentCategorisePageState(id: id, titleName: titleName); + _ParentCategorisePageState createState() => _ParentCategorisePageState(id: id, titleName: titleName); } class _ParentCategorisePageState extends State { @@ -80,759 +75,559 @@ class _ParentCategorisePageState extends State { ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectProvider = Provider.of(context); return BaseView( - onModelReady: (model) => model.getCategoriseParent( - i: id, pageIndex: pageIndex, isLoading: false, context: context), + onModelReady: (model) => model.getCategoriseParent(i: id, pageIndex: pageIndex, isLoading: false, context: context), allowAny: true, - builder: - (BuildContext context, PharmacyCategoriseViewModel model, - Widget child) => - AppScaffold( - isPharmacy: true, - appBarTitle: titleName, - isBottomBar: true, - isShowAppBar: true, - backgroundColor: Colors.white, - isShowDecPage: false, - baseViewModel: model, - body: SmartRefresher( - enablePullDown: false, - controller: controller, - enablePullUp: true, - onLoading: () async { - setState(() { - ++pageIndex; - }); - await model.getParentProducts( - pageIndex: pageIndex, - i: id, - isLoading: true, - context: context); - if (model.state != ViewState.BusyLocal && - pageIndex < 5) { - controller.loadComplete(); - } else { - controller.loadFailed(); - } - }, - child: SingleChildScrollView( - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - child: Image.network( - id == '1' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089188_personal-care_2.png' - : id == '2' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089189_skin-care_2.png' - : id == '3' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089190_health-care_2.png' - : id == '4' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089191_sexual-health_2.png' - : id == '5' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089192_beauty_2.png' - : id == '6' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089193_baby-child_2.png' - : id == '7' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089194_vitamins-supplements_2.png' - : id == '8' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089195_diet-nutrition_2.png' - : id == '9' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089196_household_2.png' - : id == '10' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089197_home-care-appliances_2.png' - : '', - fit: BoxFit.fill, - height: 160.0, - width: double.infinity), - ), - if (model.categoriseParent.length > 8) - Column( - crossAxisAlignment: CrossAxisAlignment.start, + builder: (BuildContext context, PharmacyCategoriseViewModel model, Widget child) => AppScaffold( + isPharmacy: true, + appBarTitle: titleName, + isBottomBar: true, + isShowAppBar: true, + backgroundColor: Colors.white, + isShowDecPage: false, + baseViewModel: model, + body: SmartRefresher( + enablePullDown: false, + controller: controller, + enablePullUp: true, + onLoading: () async { + setState(() { + ++pageIndex; + }); + await model.getParentProducts(pageIndex: pageIndex, i: id, isLoading: true, context: context); + if (model.state != ViewState.BusyLocal && pageIndex < 5) { + controller.loadComplete(); + } else { + controller.loadFailed(); + } + }, + child: SingleChildScrollView( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: Image.network( + id == '1' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089188_personal-care_2.png' + : id == '2' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089189_skin-care_2.png' + : id == '3' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089190_health-care_2.png' + : id == '4' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089191_sexual-health_2.png' + : id == '5' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089192_beauty_2.png' + : id == '6' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089193_baby-child_2.png' + : id == '7' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089194_vitamins-supplements_2.png' + : id == '8' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089195_diet-nutrition_2.png' + : id == '9' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089196_household_2.png' + : id == '10' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089197_home-care-appliances_2.png' + : '', + fit: BoxFit.fill, + height: 160.0, + width: double.infinity), + ), + if (model.categoriseParent.length > 8) + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + InkWell( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - InkWell( - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Padding( - padding: EdgeInsets.all(10.0), - child: Container( - child: Texts( - TranslationBase.of(context) - .viewCategorise, + Padding( + padding: EdgeInsets.all(10.0), + child: Container( + child: Texts( + TranslationBase.of(context).viewCategorise, // 'View All Categories', - fontWeight: FontWeight.w300, - ), - ), - ), - Icon(Icons.arrow_forward) - ], + fontWeight: FontWeight.w300, ), - onTap: () { - Navigator.push( - context, - FadePage( - page: SubCategoriseModalsheet( -// id: model.categorise[0].id, -// titleName: model.categorise[0].name, - )), - ); - }), - Divider( - thickness: 1.0, - color: Colors.grey.shade400, + ), ), + Icon(Icons.arrow_forward) ], ), + onTap: () { + Navigator.push( + context, + FadePage( + page: SubCategoriseModalsheet( +// id: model.categorise[0].id, +// titleName: model.categorise[0].name, + )), + ); + }), + Divider( + thickness: 1.0, + color: Colors.grey.shade400, + ), + ], + ), //Expanded widget heree if nassery - Padding( - padding: EdgeInsets.only(top: 35.0), - child: Container( - height: - MediaQuery.of(context).size.height * 0.2, - child: Center( - child: ListView.builder( - scrollDirection: Axis.horizontal, - itemCount: - model.categoriseParent.length > 8 - ? 8 - : model.categoriseParent.length, - itemBuilder: - (BuildContext context, int index) { - return Padding( - padding: EdgeInsets.symmetric( - horizontal: 8.0), - child: InkWell( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Padding( - padding: - EdgeInsets.symmetric( - horizontal: 13.0), - child: Container( - height: 60.0, - width: 65.0, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Colors - .orange.shade200 - .withOpacity(0.45), - ), - child: Center( - child: Icon( - Icons.apps_sharp, - size: 32.0, - ), - ), - ), - ), - Container( - width: - MediaQuery.of(context) - .size - .width * - 0.197, - // height: MediaQuery.of(context) - // .size - // .height * - // 0.08, - child: Center( - child: Texts( - projectViewModel - .isArabic - ? model - .categoriseParent[ - index] - .namen - : model - .categoriseParent[ - index] - .name, - fontSize: 13.4, - fontWeight: - FontWeight.w600, - maxLines: 3, - ), - ), - ), - ], + Padding( + padding: EdgeInsets.only(top: 35.0), + child: Container( + height: MediaQuery.of(context).size.height * 0.2, + child: Center( + child: ListView.builder( + scrollDirection: Axis.horizontal, + itemCount: model.categoriseParent.length > 8 ? 8 : model.categoriseParent.length, + itemBuilder: (BuildContext context, int index) { + return Padding( + padding: EdgeInsets.symmetric(horizontal: 8.0), + child: InkWell( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 13.0), + child: Container( + height: 60.0, + width: 65.0, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.orange.shade200.withOpacity(0.45), + ), + child: Center( + child: Icon( + Icons.apps_sharp, + size: 32.0, + ), ), - onTap: () { - Navigator.push( - context, - FadePage( - page: SubCategorisePage( - title: projectViewModel - .isArabic - ? model - .categoriseParent[ - index] - .namen - : model - .categoriseParent[ - index] - .name, - id: model - .categoriseParent[index] - .id, - parentId: id, - )), - ); - print(id); - }, ), - ); - }), - ), - ), - ), - - Divider( - thickness: 1.0, - color: Colors.grey.shade400, - ), - Padding( - padding: EdgeInsets.symmetric(horizontal: 8.0), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - InkWell( - child: Row( - children: [ - Icon( - Icons.wrap_text, - ), - SizedBox( - width: 10.0, ), - Texts( - TranslationBase.of(context).refine, - fontWeight: FontWeight.w600, + Container( + width: MediaQuery.of(context).size.width * 0.197, + // height: MediaQuery.of(context) + // .size + // .height * + // 0.08, + child: Center( + child: Texts( + projectViewModel.isArabic ? model.categoriseParent[index].namen : model.categoriseParent[index].name, + fontSize: 13.4, + fontWeight: FontWeight.w600, + maxLines: 3, + ), + ), ), ], ), onTap: () { - showModalBottomSheet( - isScrollControlled: true, - context: context, - builder: (BuildContext context) { - return DraggableScrollableSheet( - initialChildSize: 0.95, - maxChildSize: 0.95, - minChildSize: 0.9, - builder: (BuildContext context, - ScrollController - scrollController) { - return SingleChildScrollView( - controller: - scrollController, - child: Container( - color: Colors.white, - height: - MediaQuery.of(context) - .size - .height * - 1.95, - child: Column( - children: [ - Padding( - padding: - EdgeInsets.all( - 8.0), - child: Row( - children: [ - Icon( - Icons - .wrap_text, - ), - SizedBox( - width: 10.0, - ), - Texts( - TranslationBase.of( - context) - .refine, + Navigator.push( + context, + FadePage( + page: SubCategorisePage( + title: projectViewModel.isArabic ? model.categoriseParent[index].namen : model.categoriseParent[index].name, + id: model.categoriseParent[index].id, + parentId: id, + )), + ); + print(id); + }, + ), + ); + }), + ), + ), + ), + + Divider( + thickness: 1.0, + color: Colors.grey.shade400, + ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + InkWell( + child: Row( + children: [ + Icon( + Icons.wrap_text, + ), + SizedBox( + width: 10.0, + ), + Texts( + TranslationBase.of(context).refine, + fontWeight: FontWeight.w600, + ), + ], + ), + onTap: () { + showModalBottomSheet( + isScrollControlled: true, + context: context, + builder: (BuildContext context) { + return DraggableScrollableSheet( + initialChildSize: 0.95, + maxChildSize: 0.95, + minChildSize: 0.9, + builder: (BuildContext context, ScrollController scrollController) { + return SingleChildScrollView( + controller: scrollController, + child: Container( + color: Colors.white, + height: MediaQuery.of(context).size.height * 1.95, + child: Column( + children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: Row( + children: [ + Icon( + Icons.wrap_text, + ), + SizedBox( + width: 10.0, + ), + Texts( + TranslationBase.of(context).refine, // 'Refine', - fontWeight: - FontWeight - .w600, - ), - SizedBox( - width: 250.0, - ), - InkWell( - child: Texts( + fontWeight: FontWeight.w600, + ), + SizedBox( + width: 250.0, + ), + InkWell( + child: Texts( // 'Close', - TranslationBase.of( - context) - .closeIt, - color: Colors - .red, - fontWeight: - FontWeight - .w600, - fontSize: - 15.0, - ), - onTap: () { - Navigator.pop( - context); - }, - ), - ], - ), - ), - Divider( - thickness: 1.0, - color: - Colors.black12, + TranslationBase.of(context).closeIt, + color: Colors.red, + fontWeight: FontWeight.w600, + fontSize: 15.0, ), - Column( - children: [ - ExpansionTile( - title: Texts( - TranslationBase.of( - context) - .categorise), - children: [ - ProcedureListWidget( - model: - model, - masterList: - model - .categoriseParent, - removeHistory: - (item) { - setState( - () { - entityList - .remove(item); - }); - }, - addHistory: - (history) { - setState( - () { - entityList - .add(history); - }); - }, - addSelectedHistories: - () { - //TODO build your fun herr - // widget.addSelectedHistories(); - }, - isEntityListSelected: - (master) => - isEntityListSelected(master), - ) - ], - ), - Divider( - thickness: 1.0, - color: Colors - .black12, - ), - ExpansionTile( - title: Texts( - TranslationBase.of( - context) - .brands), - children: [ - ProcedureListWidget( - model: - model, - masterList: - model - .brandsList, - removeHistory: - (item) { - setState( - () { - entityListBrands - .remove(item); - }); - }, - addHistory: - (history) { - setState( - () { - entityListBrands - .add(history); - }); - }, - addSelectedHistories: - () { - //TODO build your fun herr - // widget.addSelectedHistories(); - }, - isEntityListSelected: - (master) => - isEntityListSelectedBrands(master), - ) - ], - ), - Divider( - thickness: 1.0, - color: Colors - .black12, - ), - ExpansionTile( - title: Texts( - TranslationBase.of( - context) - .price), - children: [ - Container( - color: Color( - 0xffEEEEEE), - child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceAround, - children: [ - Column( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Texts(TranslationBase.of(context).min), - Container( - color: Colors.white, - width: 200, - height: 40, - child: TextFormField( - decoration: InputDecoration( - border: OutlineInputBorder(), - ), - controller: minField, - ), - ), - ], - ), - Column( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Texts(TranslationBase.of(context).max), - Container( - color: Colors.white, - width: 200, - height: 40, - child: TextFormField( - decoration: InputDecoration( - border: OutlineInputBorder(), - ), - controller: maxField, - ), - ), - ], - ), - ], - ), - ) - ], - ), - Divider( - thickness: 1.0, - color: Colors - .black12, - ), - SizedBox( - height: MediaQuery.of( - context) - .size - .height * - 0.4, - ), - Padding( - padding: - EdgeInsets - .all( - 8.0), - child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceEvenly, + onTap: () { + Navigator.pop(context); + }, + ), + ], + ), + ), + Divider( + thickness: 1.0, + color: Colors.black12, + ), + Column( + children: [ + ExpansionTile( + title: Texts(TranslationBase.of(context).categorise), + children: [ + ProcedureListWidget( + model: model, + masterList: model.categoriseParent, + removeHistory: (item) { + setState(() { + entityList.remove(item); + }); + }, + addHistory: (history) { + setState(() { + entityList.add(history); + }); + }, + addSelectedHistories: () { + //TODO build your fun herr + // widget.addSelectedHistories(); + }, + isEntityListSelected: (master) => isEntityListSelected(master), + ) + ], + ), + Divider( + thickness: 1.0, + color: Colors.black12, + ), + ExpansionTile( + title: Texts(TranslationBase.of(context).brands), + children: [ + ProcedureListWidget( + model: model, + masterList: model.brandsList, + removeHistory: (item) { + setState(() { + entityListBrands.remove(item); + }); + }, + addHistory: (history) { + setState(() { + entityListBrands.add(history); + }); + }, + addSelectedHistories: () { + //TODO build your fun herr + // widget.addSelectedHistories(); + }, + isEntityListSelected: (master) => isEntityListSelectedBrands(master), + ) + ], + ), + Divider( + thickness: 1.0, + color: Colors.black12, + ), + ExpansionTile( + title: Texts(TranslationBase.of(context).price), + children: [ + Container( + color: Color(0xffEEEEEE), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.start, children: [ + Texts(TranslationBase.of(context).min), Container( - width: - 100, - child: - Button( - label: TranslationBase.of(context) - .reset, - backgroundColor: - Colors.red, + color: Colors.white, + width: 200, + height: 40, + child: TextFormField( + decoration: InputDecoration( + border: OutlineInputBorder(), + ), + controller: minField, ), ), - SizedBox( - width: 30, - ), + ], + ), + Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Texts(TranslationBase.of(context).max), Container( - width: - 200, - child: - Button( - onTap: - () async { - String - categoriesId = - ""; - for (CategoriseParentModel category - in entityList) { - if (categoriesId == - "") { - categoriesId = category.id; - } else { - categoriesId = "$categoriesId,${category.id}"; - } - } - String - brandIds = - ""; - for (CategoriseParentModel brand - in entityListBrands) { - if (brandIds == - "") { - brandIds = brand.id; - } else { - brandIds = "$brandIds,${brand.id}"; - } - } - - GifLoaderDialogUtils.showMyDialog( - context); - - await model.getFilteredProducts( - min: minField.text.toString(), - max: maxField.text.toString(), - categoryId: categoriesId, - brandId: brandIds); - GifLoaderDialogUtils.hideDialog( - context); - - Navigator.pop( - context); - }, - label: TranslationBase.of(context) - .apply, - backgroundColor: - Colors.green, + color: Colors.white, + width: 200, + height: 40, + child: TextFormField( + decoration: InputDecoration( + border: OutlineInputBorder(), + ), + controller: maxField, ), ), ], ), - ), - ], - ), + ], + ), + ) ], ), - ), - ); - }); - }, - ); - }, - ), - Row( - children: [ - Container( - height: 44.0, - child: VerticalDivider( - color: Colors.black45, - thickness: 1.0, -//width: 0.3, -// indent: 0.0, - ), - ), - Padding( - padding: EdgeInsets.all(8.0), - child: InkWell( - child: styleIcon, - onTap: () { - setState(() { - if (styleOne == true) { - styleOne = false; - styleTwo = true; - styleIcon = Icon( - Icons.auto_awesome_mosaic, - color: CustomColors.green, - size: 29.0, - ); - } else { - styleOne = true; - styleTwo = false; - styleIcon = Icon( - Icons.widgets_sharp, - color: CustomColors.green, - size: 29.0, - ); - } - }); - }, - ), - ), - ], - ), - ], - ), - ), - Divider( - thickness: 1.0, - color: Colors.grey.shade400, - ), - model.parentProducts.isNotEmpty - ? styleOne == true - ? model.state != ViewState.BusyLocal - ? Container( - height: - model.parentProducts.length * - MediaQuery.of(context) - .size - .height * - 0.15, - child: GridView.builder( - physics: - NeverScrollableScrollPhysics(), - gridDelegate: - SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 2, - crossAxisSpacing: 0.5, - mainAxisSpacing: 2.0, - childAspectRatio: 0.9, - ), - itemCount: - model.parentProducts.length, - itemBuilder: - (BuildContext context, - int index) { - return NetworkBaseView( - baseViewModel: model, - child: InkWell( - child: Card( - color: model - .parentProducts[ - index] - .discountName != - null - ? Color( - 0xffFFFF00) - : Colors.white, - elevation: 0, - shape: Border( - right: BorderSide( - color: Colors.grey - .shade300, - width: 1, - ), - left: BorderSide( - color: Colors.grey - .shade300, - width: 1, - ), - bottom: BorderSide( - color: Colors.grey - .shade300, - width: 1, + Divider( + thickness: 1.0, + color: Colors.black12, + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.4, + ), + Padding( + padding: EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Container( + width: 100, + child: Button( + label: TranslationBase.of(context).reset, + backgroundColor: Colors.red, + ), ), - top: BorderSide( - color: Colors.grey - .shade300, - width: 1, + SizedBox( + width: 30, ), - ), - margin: EdgeInsets - .symmetric( - horizontal: 8, - vertical: 4, - ), - child: Container( - decoration: - BoxDecoration( - borderRadius: - BorderRadius - .only( - topLeft: Radius - .circular( - 110.0), + Container( + width: 200, + child: Button( + onTap: () async { + String categoriesId = ""; + for (CategoriseParentModel category in entityList) { + if (categoriesId == "") { + categoriesId = category.id; + } else { + categoriesId = "$categoriesId,${category.id}"; + } + } + String brandIds = ""; + for (CategoriseParentModel brand in entityListBrands) { + if (brandIds == "") { + brandIds = brand.id; + } else { + brandIds = "$brandIds,${brand.id}"; + } + } + + GifLoaderDialogUtils.showMyDialog(context); + + await model.getFilteredProducts( + min: minField.text.toString(), max: maxField.text.toString(), categoryId: categoriesId, brandId: brandIds); + GifLoaderDialogUtils.hideDialog(context); + + Navigator.pop(context); + }, + label: TranslationBase.of(context).apply, + backgroundColor: Colors.green, ), - color: - Colors.white, ), - padding: EdgeInsets - .symmetric( - horizontal: - 0), - width: MediaQuery.of( - context) - .size - .width / - 3, - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - Stack( - children: [ - if (model - .parentProducts[index] - .discountName != - null) - RotatedBox( - quarterTurns: - 4, - child: - Container( - decoration: - BoxDecoration(), - child: - Padding( - padding: - EdgeInsets.only( - right: 5.0, - top: 20.0, - bottom: 5.0, - ), - child: - Texts( - TranslationBase.of(context).offers.toUpperCase(), - color: Colors.red, - fontSize: 13.0, - fontWeight: FontWeight.w900, - ), - ), - transform: - new Matrix4.rotationZ(5.837200), - ), - ), - Container( - margin: EdgeInsets - .fromLTRB( - 0, - 16, - 0, - 0), - alignment: - Alignment - .center, - child: Image - .network( - model.parentProducts[index].images.isNotEmpty - ? model.parentProducts[index].images[0].thumb - : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', - fit: BoxFit - .cover, - height: - 80, - ), + ], + ), + ), + ], + ), + ], + ), + ), + ); + }); + }, + ); + }, + ), + Row( + children: [ + Container( + height: 44.0, + child: VerticalDivider( + color: Colors.black45, + thickness: 1.0, +//width: 0.3, +// indent: 0.0, + ), + ), + Padding( + padding: EdgeInsets.all(8.0), + child: InkWell( + child: styleIcon, + onTap: () { + setState(() { + if (styleOne == true) { + styleOne = false; + styleTwo = true; + styleIcon = Icon( + Icons.auto_awesome_mosaic, + color: CustomColors.green, + size: 29.0, + ); + } else { + styleOne = true; + styleTwo = false; + styleIcon = Icon( + Icons.widgets_sharp, + color: CustomColors.green, + size: 29.0, + ); + } + }); + }, + ), + ), + ], + ), + ], + ), + ), + Divider( + thickness: 1.0, + color: Colors.grey.shade400, + ), + model.parentProducts.isNotEmpty + ? styleOne == true + ? model.state != ViewState.BusyLocal + ? Container( + height: model.parentProducts.length * MediaQuery.of(context).size.height * 0.15, + child: GridView.builder( + physics: NeverScrollableScrollPhysics(), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, + crossAxisSpacing: 0.5, + mainAxisSpacing: 2.0, + childAspectRatio: 0.9, + ), + itemCount: model.parentProducts.length, + itemBuilder: (BuildContext context, int index) { + return NetworkBaseView( + baseViewModel: model, + child: InkWell( + child: Card( + color: model.parentProducts[index].discountName != null ? Color(0xffFFFF00) : Colors.white, + elevation: 0, + shape: Border( + right: BorderSide( + color: Colors.grey.shade300, + width: 1, + ), + left: BorderSide( + color: Colors.grey.shade300, + width: 1, + ), + bottom: BorderSide( + color: Colors.grey.shade300, + width: 1, + ), + top: BorderSide( + color: Colors.grey.shade300, + width: 1, + ), + ), + margin: EdgeInsets.symmetric( + horizontal: 8, + vertical: 4, + ), + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(110.0), + ), + color: Colors.white, + ), + padding: EdgeInsets.symmetric(horizontal: 0), + width: MediaQuery.of(context).size.width / 3, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Stack( + children: [ + if (model.parentProducts[index].discountName != null) + RotatedBox( + quarterTurns: 4, + child: Container( + decoration: BoxDecoration(), + child: Padding( + padding: EdgeInsets.only( + right: 5.0, + top: 20.0, + bottom: 5.0, + ), + child: Texts( + TranslationBase.of(context).offers.toUpperCase(), + color: Colors.red, + fontSize: 13.0, + fontWeight: FontWeight.w900, ), + ), + transform: new Matrix4.rotationZ(5.837200), + ), + ), + Container( + margin: EdgeInsets.fromLTRB(0, 16, 0, 0), + alignment: Alignment.center, + child: Image.network( + model.parentProducts[index].images.isNotEmpty + ? model.parentProducts[index].images[0].thumb + : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', + fit: BoxFit.cover, + height: 80, + ), + ), // Container( // width: model.parentProducts[index].rxMessage != // null @@ -882,222 +677,144 @@ class _ParentCategorisePageState extends State { // .w400, // // ), // ), - ], - ), + ], + ), + Container( + margin: EdgeInsets.symmetric( + horizontal: 6, + vertical: 0, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (model.parentProducts[index].discountName != null) Container( - margin: EdgeInsets - .symmetric( - horizontal: - 6, - vertical: 0, + width: double.infinity, + height: 13.0, + decoration: BoxDecoration( + color: Color(0xff5AB145), ), - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - if (model - .parentProducts[index] - .discountName != - null) - Container( - width: - double.infinity, - height: - 13.0, - decoration: - BoxDecoration( - color: - Color(0xff5AB145), - ), - child: - Center( - child: - Texts( - model.parentProducts[index].discountName, - regular: true, - color: Colors.white, - fontSize: 10.4, - ), - ), - ), - Texts( - projectViewModel.isArabic - ? model.parentProducts[index].namen - : model.parentProducts[index].name, - regular: - true, - fontSize: - 12, - fontWeight: - FontWeight.w700, - ), - Padding( - padding: const EdgeInsets.only( - top: - 4, - bottom: - 4), - child: - Texts( - "SAR ${model.parentProducts[index].price}", - bold: - true, - fontSize: - 14, - ), - ), - Row( - children: [ + child: Center( + child: Texts( + model.parentProducts[index].discountName, + regular: true, + color: Colors.white, + fontSize: 10.4, + ), + ), + ), + Texts( + projectViewModel.isArabic ? model.parentProducts[index].namen : model.parentProducts[index].name, + regular: true, + fontSize: 12, + fontWeight: FontWeight.w700, + ), + Padding( + padding: const EdgeInsets.only(top: 4, bottom: 4), + child: Texts( + "SAR ${model.parentProducts[index].price}", + bold: true, + fontSize: 14, + ), + ), + Row( + children: [ // StarRating( // totalAverage: model.parentProducts[index].approvedRatingSum > 0 // ? (model.parentProducts[index].approvedRatingSum.toDouble() / model.parentProducts[index].approvedRatingSum.toDouble()).toDouble() // : 0, // forceStars: true), - RatingBar - .readOnly( - initialRating: - model.parentProducts[index].approvedRatingSum.toDouble(), - size: - 15.0, - filledColor: - Colors.yellow[700], - emptyColor: - Colors.grey[500], - isHalfAllowed: - true, - halfFilledIcon: - Icons.star_half, - filledIcon: - Icons.star, - emptyIcon: - Icons.star, - ), - Texts( - "(${model.parentProducts[index].approvedTotalReviews})", - regular: - true, - fontSize: - 10, - fontWeight: - FontWeight.w400, - ) - ], - ), - ], + RatingBar.readOnly( + initialRating: model.parentProducts[index].approvedRatingSum.toDouble(), + size: 15.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, ), - ), - ], - ), + Texts( + "(${model.parentProducts[index].approvedTotalReviews})", + regular: true, + fontSize: 10, + fontWeight: FontWeight.w400, + ) + ], + ), + ], ), ), - onTap: () => { - Navigator.push( - context, - FadePage( - page: ProductDetailPage( - model.parentProducts[ - index]), - )), - }, - )); + ], + ), + ), + ), + onTap: () => { + Navigator.push( + context, + FadePage( + page: ProductDetailPage(model.parentProducts[index]), + )), }, - ), - ) - : Container( - height: - model.parentProducts.length * - MediaQuery.of(context) - .size - .height * - 0.122, - child: ListView.builder( - physics: - NeverScrollableScrollPhysics(), - itemCount: model - .parentProducts.length, - itemBuilder: - (BuildContext context, - int index) { - return InkWell( - child: Card( - child: Row( + )); + }, + ), + ) + : Container( + height: model.parentProducts.length * MediaQuery.of(context).size.height * 0.122, + child: ListView.builder( + physics: NeverScrollableScrollPhysics(), + itemCount: model.parentProducts.length, + itemBuilder: (BuildContext context, int index) { + return InkWell( + child: Card( + child: Row( + children: [ + Stack( + children: [ + Column( children: [ - Stack( - children: [ - Column( - children: [ - Container( - decoration: - BoxDecoration(), - child: - Padding( - padding: - EdgeInsets.only( - left: - 9.0, - top: - 8.0, - right: - 10.0, - ), - ), - ), - Container( - margin: EdgeInsets - .fromLTRB( - 0, - 0, - 0, - 0), - alignment: - Alignment - .center, - child: model - .parentProducts[ - index] - .images - .isNotEmpty - ? Image - .network( - model.parentProducts[index].images[0].thumb, - fit: BoxFit.contain, - height: 70, - ) - : Text( - TranslationBase.of(context).noImage), - ), - ], + Container( + decoration: BoxDecoration(), + child: Padding( + padding: EdgeInsets.only( + left: 9.0, + top: 8.0, + right: 10.0, ), - Column( - children: [ - Container( - width: model.parentProducts[index].rxMessage != - null - ? MediaQuery.of(context).size.width / - 5.3 - : 0, - padding: - EdgeInsets.all( - 4), - decoration: - BoxDecoration( - color: Color( - 0xffb23838), - borderRadius: - BorderRadius.only(topLeft: Radius.circular(6)), - ), - child: model.parentProducts[index].rxMessage != - null - ? Texts( - projectProvider.isArabic ? model.parentProducts[index].rxMessagen : model.parentProducts[index].rxMessage, - color: Colors.white, - regular: true, - fontSize: 10, - fontWeight: FontWeight.w400, - ) - : Texts( - ""), + ), + ), + Container( + margin: EdgeInsets.fromLTRB(0, 0, 0, 0), + alignment: Alignment.center, + child: model.parentProducts[index].images.isNotEmpty + ? Image.network( + model.parentProducts[index].images[0].thumb, + fit: BoxFit.contain, + height: 70, + ) + : Text(TranslationBase.of(context).noImage), + ), + ], + ), + Column( + children: [ + Container( + width: model.parentProducts[index].rxMessage != null ? MediaQuery.of(context).size.width / 5.3 : 0, + padding: EdgeInsets.all(4), + decoration: BoxDecoration( + color: Color(0xffb23838), + borderRadius: BorderRadius.only(topLeft: Radius.circular(6)), + ), + child: model.parentProducts[index].rxMessage != null + ? Texts( + projectProvider.isArabic ? model.parentProducts[index].rxMessagen : model.parentProducts[index].rxMessage, + color: Colors.white, + regular: true, + fontSize: 10, + fontWeight: FontWeight.w400, + ) + : Texts(""), // Texts( // model.parentProducts[index].rxMessage != null ? model.parentProducts[index].rxMessage : "", // color: Colors.white, @@ -1105,207 +822,147 @@ class _ParentCategorisePageState extends State { // fontSize: 10, // fontWeight: FontWeight.w400, // ), - ), - ], - ), - ], ), - Container( - margin: EdgeInsets - .symmetric( - horizontal: 0, - vertical: 0, - ), - child: Column( - mainAxisAlignment: - MainAxisAlignment - .spaceAround, - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - SizedBox( - height: 4.0, - ), - Container( - width: MediaQuery.of(context) - .size - .width * - 0.635, - child: - Texts( - projectViewModel - .isArabic - ? model - .parentProducts[ - index] - .namen - : model - .parentProducts[index] - .name, - regular: - true, - fontSize: - 13.2, - fontWeight: - FontWeight - .w500, - maxLines: - 5, - ), - ), - SizedBox( - height: 8.0, - ), - Padding( - padding: const EdgeInsets - .only( - top: 4, - bottom: - 4), - child: - Texts( - "SAR ${model.parentProducts[index].price}", - bold: - true, - fontSize: - 14, - ), - ), - Row( - children: [ + ], + ), + ], + ), + Container( + margin: EdgeInsets.symmetric( + horizontal: 0, + vertical: 0, + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 4.0, + ), + Container( + width: MediaQuery.of(context).size.width * 0.635, + child: Texts( + projectViewModel.isArabic ? model.parentProducts[index].namen : model.parentProducts[index].name, + regular: true, + fontSize: 13.2, + fontWeight: FontWeight.w500, + maxLines: 5, + ), + ), + SizedBox( + height: 8.0, + ), + Padding( + padding: const EdgeInsets.only(top: 4, bottom: 4), + child: Texts( + "SAR ${model.parentProducts[index].price}", + bold: true, + fontSize: 14, + ), + ), + Row( + children: [ // StarRating( // totalAverage: model.parentProducts[index].approvedRatingSum > 0 // ? (model.parentProducts[index].approvedRatingSum.toDouble() / model.parentProducts[index].approvedRatingSum.toDouble()).toDouble() // : 0, // forceStars: true), - RatingBar - .readOnly( - initialRating: model - .parentProducts[index] - .approvedRatingSum - .toDouble(), - size: - 15.0, - filledColor: - Colors.yellow[700], - emptyColor: - Colors.grey[500], - isHalfAllowed: - true, - halfFilledIcon: - Icons.star_half, - filledIcon: - Icons.star, - emptyIcon: - Icons.star, - ), - Texts( - "(${model.parentProducts[index].approvedTotalReviews})", - regular: - true, - fontSize: - 10, - fontWeight: - FontWeight.w400, - ) - ], - ), - ], + RatingBar.readOnly( + initialRating: model.parentProducts[index].approvedRatingSum.toDouble(), + size: 15.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, ), - ), - widget.authenticatedUserObject - .isLogin - ? Container( - child: IconButton( - icon: Icon( - Icons - .shopping_cart, - size: - 18, - color: - CustomColors.green, - ), - onPressed: () async { - if (model.parentProducts[index].rxMessage == - null) { - GifLoaderDialogUtils.showMyDialog(context); - await addToCartFunction(1, - model.parentProducts[index].id); - GifLoaderDialogUtils.hideDialog(context); - Utils.navigateToCartPage(); - } else { - AppToast.showErrorToast(message: TranslationBase.of(context).needPrescription); - } - }), - ) - : Container(), - ], - ), + Texts( + "(${model.parentProducts[index].approvedTotalReviews})", + regular: true, + fontSize: 10, + fontWeight: FontWeight.w400, + ) + ], + ), + ], ), - onTap: () => { - Navigator.push( - context, - FadePage( - page: ProductDetailPage( - model.parentProducts[ - index]), - )), - }, - ); - }), - ) - : Padding( - padding: const EdgeInsets.all(12.0), - child: Container( - child: Center( - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Padding( - padding: - const EdgeInsets.all( - 8.0), - child: Image.asset( - 'assets/images/new-design/empty_box.png', - width: 100, - height: 100, - fit: BoxFit.cover, - ), - ), - Padding( - padding: - const EdgeInsets.all( - 8.0), - child: Text( - TranslationBase.of( - context) - .noData, - // 'There is no data', - style: TextStyle( - fontSize: 30), ), - ) - ], + widget.authenticatedUserObject.isLogin + ? Container( + child: IconButton( + icon: Icon( + Icons.shopping_cart, + size: 18, + color: CustomColors.green, + ), + onPressed: () async { + if (model.parentProducts[index].rxMessage == null) { + GifLoaderDialogUtils.showMyDialog(context); + await addToCartFunction(1, model.parentProducts[index].id); + GifLoaderDialogUtils.hideDialog(context); + Utils.navigateToCartPage(); + } else { + AppToast.showErrorToast(message: TranslationBase.of(context).needPrescription); + } + }), + ) + : Container(), + ], + ), ), + onTap: () => { + Navigator.push( + context, + FadePage( + page: ProductDetailPage(model.parentProducts[index]), + )), + }, + ); + }), + ) + : Padding( + padding: const EdgeInsets.all(12.0), + child: Container( + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Image.asset( + 'assets/images/new-design/empty_box.png', + width: 100, + height: 100, + fit: BoxFit.cover, ), ), - ) - : Center( - child: CircularProgressIndicator( - backgroundColor: Colors.white, - valueColor: - AlwaysStoppedAnimation( - Colors.grey[500], - ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + TranslationBase.of(context).noData, + // 'There is no data', + style: TextStyle(fontSize: 30), + ), + ) + ], ), - ) - ], - ), - ), - ), - ))); + ), + ), + ) + : Center( + child: CircularProgressIndicator( + backgroundColor: Colors.white, + valueColor: AlwaysStoppedAnimation( + Colors.grey[500], + ), + ), + ) + ], + ), + ), + ), + ))); } addToCartFunction(quantity, itemID) async { @@ -1314,8 +971,7 @@ class _ParentCategorisePageState extends State { } bool isEntityListSelected(CategoriseParentModel masterKey) { - Iterable history = - entityList.where((element) => masterKey.id == element.id); + Iterable history = entityList.where((element) => masterKey.id == element.id); if (history.length > 0) { return true; } @@ -1323,8 +979,7 @@ class _ParentCategorisePageState extends State { } bool isEntityListSelectedBrands(CategoriseParentModel masterKey) { - Iterable history = - entityListBrands.where((element) => masterKey.id == element.id); + Iterable history = entityListBrands.where((element) => masterKey.id == element.id); if (history.length > 0) { return true; } From 54ff9931cbb8433a0fa83ee03d2cbb5de77674ff Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Sun, 14 Nov 2021 15:11:29 +0300 Subject: [PATCH 5/5] fixed arrow issue order page --- lib/pages/pharmacy/order/Order.dart | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/pages/pharmacy/order/Order.dart b/lib/pages/pharmacy/order/Order.dart index 8d6a55b0..817cf72a 100644 --- a/lib/pages/pharmacy/order/Order.dart +++ b/lib/pages/pharmacy/order/Order.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/orders_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/order/OrderDetails.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -8,6 +9,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:provider/provider.dart'; dynamic languageID; @@ -107,6 +109,7 @@ class _OrderPageState extends State } Widget getDeliveredOrder(OrderModelViewModel model) { + ProjectViewModel projectViewModel = Provider.of(context); for (int i = 0; i < model.orders.length; i++) { if (model.orders[i].orderStatusId == 30 || model.orders[i].orderStatusId == 997 || @@ -210,7 +213,7 @@ class _OrderPageState extends State Container( margin: EdgeInsets.all(8.0), child: SvgPicture.asset( - languageID == "ar" + projectViewModel.isArabic ? 'assets/images/pharmacy/arrow_left.svg' : 'assets/images/pharmacy/arrow_right.svg', height: 20, @@ -373,6 +376,7 @@ class _OrderPageState extends State } Widget getProcessingOrder(OrderModelViewModel model) { + ProjectViewModel projectViewModel = Provider.of(context); for (int i = 0; i < model.orders.length; i++) { if (model.orders[i].orderStatusId == 20 || model.orders[i].orderStatusId == 995 || @@ -477,7 +481,7 @@ class _OrderPageState extends State Container( margin: EdgeInsets.all(8.0), child: SvgPicture.asset( - languageID == "ar" + projectViewModel.isArabic ? 'assets/images/pharmacy/arrow_left.svg' : 'assets/images/pharmacy/arrow_right.svg', height: 20, @@ -820,6 +824,7 @@ class _OrderPageState extends State } Widget getPendingOrder(OrderModelViewModel model) { + ProjectViewModel projectViewModel = Provider.of(context); for (int i = 0; i < model.orders.length; i++) { if (model.orders[i].orderStatusId == 10) { pendingOrderList.add(model.orders[i]); @@ -922,7 +927,7 @@ class _OrderPageState extends State Container( margin: EdgeInsets.all(8.0), child: SvgPicture.asset( - languageID == "ar" + projectViewModel.isArabic ? 'assets/images/pharmacy/arrow_left.svg' : 'assets/images/pharmacy/arrow_right.svg', height: 20, @@ -1087,6 +1092,7 @@ class _OrderPageState extends State } Widget getCancelledOrder(OrderModelViewModel model) { + ProjectViewModel projectViewModel = Provider.of(context); for (int i = 0; i < model.orders.length; i++) { if (model.orders[i].orderStatusId == 40 || model.orders[i].orderStatus == 996 || @@ -1191,7 +1197,7 @@ class _OrderPageState extends State Container( margin: EdgeInsets.all(8.0), child: SvgPicture.asset( - languageID == "ar" + projectViewModel.isArabic ? 'assets/images/pharmacy/arrow_left.svg' : 'assets/images/pharmacy/arrow_right.svg', height: 20,