Pharmacy prescriptions page design

merge-update-with-lab-changes
haroon amjad 4 years ago
parent 20076f2f2b
commit eed4fd2509

@ -14,7 +14,7 @@ class PrescriptionViewModel extends BaseViewModel {
getPrescription() async { getPrescription() async {
await getSavedLanguage(); await getSavedLanguage();
if(prescriptionsList.isNotEmpty){ if(prescriptionsList.isEmpty){
setState(ViewState.Busy); setState(ViewState.Busy);
await _prescriptionService.getPrescription(); await _prescriptionService.getPrescription();
if (_prescriptionService.hasError) { if (_prescriptionService.hasError) {

@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/models/gradient_color.dart';
import 'package:diplomaticquarterapp/models/hmg_services.dart'; import 'package:diplomaticquarterapp/models/hmg_services.dart';
import 'package:diplomaticquarterapp/models/slider_data.dart'; import 'package:diplomaticquarterapp/models/slider_data.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart';
import 'package:diplomaticquarterapp/pages/landing/widgets/logged_slider_view.dart'; import 'package:diplomaticquarterapp/pages/landing/widgets/logged_slider_view.dart';
import 'package:diplomaticquarterapp/pages/landing/widgets/services_view.dart'; import 'package:diplomaticquarterapp/pages/landing/widgets/services_view.dart';
import 'package:diplomaticquarterapp/pages/landing/widgets/slider_view.dart'; import 'package:diplomaticquarterapp/pages/landing/widgets/slider_view.dart';
@ -236,7 +237,7 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
), ),
FlatButton( FlatButton(
onPressed: () { onPressed: () {
Navigator.push(context, FadePage(page: AllHabibMedicalService())); Navigator.push(context, FadePage(page: AllHabibMedicalSevicePage2()));
}, },
child: Text( child: Text(
TranslationBase.of(context).viewAllServices, TranslationBase.of(context).viewAllServices,

@ -5,8 +5,6 @@ import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_h
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/home/ViewAllHomeWidget.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/home/ViewAllHomeWidget.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -27,30 +25,21 @@ class PrescriptionsWidget extends StatelessWidget {
isLocalLoader: true, isLocalLoader: true,
baseViewModel: model, baseViewModel: model,
child: Container( child: Container(
height: model.prescriptionsList.length > 0
? MediaQuery.of(context).size.height * 0.28
: 0,
child: Column( child: Column(
children: [ children: [
ViewAllHomeWidget( ViewAllHomeWidget(TranslationBase.of(context).myPrescription, HomePrescriptionsPage()),
TranslationBase.of(context).myPrescription,
HomePrescriptionsPage()),
Container( Container(
padding: EdgeInsets.symmetric( margin: EdgeInsets.only(right: 10.0, left: 10.0),
horizontal: 18.0, vertical: 14.0), height: MediaQuery.of(context).size.height * 0.18,
margin: EdgeInsets.only(left: 10),
child: ListView.builder( child: ListView.builder(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
shrinkWrap: true, shrinkWrap: true,
physics: ScrollPhysics(), physics: ScrollPhysics(),
// physics: NeverScrollableScrollPhysics(),
itemCount: model.prescriptionsList.length, itemCount: model.prescriptionsList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Container( return Container(
height: MediaQuery.of(context).size.height * 0.3, padding: EdgeInsets.only(left: 8.0, right: 8.0),
padding: EdgeInsets.only( margin: EdgeInsets.only(right: 5.0, left: 5.0),
bottom: 5.0, left: 5.0, right: 8.0),
margin: EdgeInsets.only(right: 10.0),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
color: Colors.grey, color: Colors.grey,
@ -59,9 +48,7 @@ class PrescriptionsWidget extends StatelessWidget {
), ),
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(10.0)), borderRadius: BorderRadius.circular(10.0)),
child: Column( child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row( Row(
children: <Widget>[ children: <Widget>[
Column(children: [ Column(children: [
@ -74,11 +61,9 @@ class PrescriptionsWidget extends StatelessWidget {
), ),
child: CircleAvatar( child: CircleAvatar(
radius: 30, radius: 30,
backgroundColor: backgroundColor: Colors.transparent,
Colors.transparent,
child: Image.network( child: Image.network(
model.prescriptionsList[index] model.prescriptionsList[index].doctorImageURL,
.doctorImageURL,
width: 60, width: 60,
height: 60, height: 60,
), ),
@ -88,10 +73,8 @@ class PrescriptionsWidget extends StatelessWidget {
Column( Column(
children: [ children: [
Container( Container(
margin: margin: EdgeInsets.only(left: 1),
EdgeInsets.only(left: 1), padding: EdgeInsets.only(left: 15.0, right: 15.0),
padding: EdgeInsets.only(
left: 15.0, right: 15.0),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
color: Colors.green, color: Colors.green,
@ -99,21 +82,11 @@ class PrescriptionsWidget extends StatelessWidget {
width: 4.0, width: 4.0,
), ),
color: Colors.green, color: Colors.green,
borderRadius: borderRadius: BorderRadius.circular(30.0)),
BorderRadius.circular(
30.0)),
child: Text( child: Text(
model.languageID == "ar" model.languageID == "ar"
? model ? model.prescriptionsList[index].isInOutPatientDescriptionN.toString()
.prescriptionsList[ : model.prescriptionsList[index].isInOutPatientDescription.toString(),
index]
.isInOutPatientDescriptionN
.toString()
: model
.prescriptionsList[
index]
.isInOutPatientDescription
.toString(),
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 15.0, fontSize: 15.0,
@ -126,14 +99,7 @@ class PrescriptionsWidget extends StatelessWidget {
height: 30, height: 30,
), ),
Text( Text(
DateUtil.convertStringToDate( DateUtil.convertStringToDate(model.prescriptionsList[index].appointmentDate.toString()).toString().substring(0, 10),
model
.prescriptionsList[
index]
.appointmentDate
.toString())
.toString()
.substring(0, 10),
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 15.0, fontSize: 15.0,
@ -145,16 +111,13 @@ class PrescriptionsWidget extends StatelessWidget {
], ],
), ),
Row( Row(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Container(
margin: EdgeInsets.only(left: 5), margin: EdgeInsets.only(left: 5),
child: Row(children: <Widget>[ child: Row(children: <Widget>[
Text( Text(
model.prescriptionsList[index] model.prescriptionsList[index].doctorTitle.toString(),
.doctorTitle
.toString(),
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 15.0, fontSize: 15.0,
@ -162,9 +125,7 @@ class PrescriptionsWidget extends StatelessWidget {
), ),
), ),
Text( Text(
model.prescriptionsList[index] model.prescriptionsList[index].doctorName.toString(),
.doctorName
.toString(),
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 15.0, fontSize: 15.0,
@ -176,15 +137,12 @@ class PrescriptionsWidget extends StatelessWidget {
], ],
), ),
Row( Row(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Container(
margin: EdgeInsets.only(left: 5), margin: EdgeInsets.only(left: 5),
child: Text( child: Text(
model.prescriptionsList[index] model.prescriptionsList[index].clinicDescription.toString(),
.clinicDescription
.toString(),
style: TextStyle( style: TextStyle(
color: Colors.green, color: Colors.green,
fontSize: 15.0, fontSize: 15.0,
@ -194,19 +152,13 @@ class PrescriptionsWidget extends StatelessWidget {
), ),
], ],
), ),
Row( Row(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Container( Container(
margin: EdgeInsets.only(left: 5), margin: EdgeInsets.only(left: 5),
child: Align( child: Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RatingBar.readOnly( child: RatingBar.readOnly(
initialRating: model initialRating: model.prescriptionsList[index].actualDoctorRate.toDouble(),
.prescriptionsList[index]
.actualDoctorRate
.toDouble(),
// initialRating: productRate, // initialRating: productRate,
size: 15.0, size: 15.0,
filledColor: Colors.yellow[700], filledColor: Colors.yellow[700],

Loading…
Cancel
Save