Merge branch 'doctor-app-design' into 'development'

referral screen design fix

See merge request Cloud_Solution/doctor_app_flutter!923
merge-requests/924/merge
Elham Ali 4 years ago
commit 6375d9fb2d

@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/screens/qr_reader/QR_reader_screen.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_drawer_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/bottom_nav_bar.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/app_showcase_widget.dart';
import 'package:flutter/cupertino.dart';
@ -41,7 +42,13 @@ class _LandingPageState extends State<LandingPage> {
backgroundColor: Colors.grey[100],
//textTheme: TextTheme(headline6: TextStyle(color: Colors.white)),
title: currentTab != 0
? Text(getText(currentTab).toUpperCase())
? AppText(
getText(currentTab),
letterSpacing: -1.44,
fontWeight: FontWeight.w700,
fontSize: 24.0,
color: Color(0xff2B353E),
)
: SizedBox(),
leading: Builder(
builder: (BuildContext context) {
@ -49,7 +56,7 @@ class _LandingPageState extends State<LandingPage> {
icon: Image.asset('assets/images/menu.png',
height: 50, width: 50),
iconSize: 15,
color: Colors.black,
color: Color(0xff2B353E),
onPressed: () => Scaffold.of(context).openDrawer(),
);
},

@ -12,7 +12,6 @@ import '../../../../routes.dart';
class MyReferralPatientScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return BaseView<PatientReferralViewModel>(
onModelReady: (model) => model.getPendingReferralPatients(),
builder: (_, model, w) => AppScaffold(

@ -1,6 +1,7 @@
import 'dart:ui';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
import 'package:doctor_app_flutter/screens/patients/profile/referral/referred-patient-screen.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -17,10 +18,10 @@ class PatientReferralScreen extends StatefulWidget {
_PatientReferralScreen createState() => _PatientReferralScreen();
}
class _PatientReferralScreen extends State<PatientReferralScreen> with SingleTickerProviderStateMixin {
class _PatientReferralScreen extends State<PatientReferralScreen>
with SingleTickerProviderStateMixin {
TabController _tabController;
int index=0;
int index = 0;
@override
void initState() {
@ -41,143 +42,126 @@ class _PatientReferralScreen extends State<PatientReferralScreen> with SingleTic
_tabController.dispose();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).patientsreferral,
body: Scaffold(
extendBodyBehindAppBar: true,
// backgroundColor: Colors.white,
appBar: PreferredSize(
preferredSize: Size.fromHeight(MediaQuery.of(context).size.height * 0.070),
child: Center(
child: Container(
height: MediaQuery.of(context).size.height * 0.070,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Theme.of(context).dividerColor,
width: 1), //width: 0.7
),
color: Colors.white),
child: Center(
child: TabBar(
isScrollable: false,
controller: _tabController,
indicatorColor: Colors.transparent,
indicatorWeight: 1.0,
indicatorSize: TabBarIndicatorSize.tab,
labelColor: Theme.of(context).primaryColor,
labelPadding: EdgeInsets.only(top: 0, left:0, right: 0,bottom: 0),
unselectedLabelColor: Colors.grey[800],
tabs: [
Container(
width: MediaQuery.of(context).size.width * 0.33,
height: MediaQuery.of(context).size.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff), Color(0xFFCCCCCC),
borderRadius: 4, borderWidth: 0),
child: Center(
child: Container(
height: MediaQuery.of(context).size.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
index == 0
? Color(0xFFD02127 )
: Color(0xFFEAEAEA),
index == 0 ? Color(0xFFD02127) : Color(0xFFEAEAEA),
borderRadius: 4,
borderWidth: 0),
child: Center(
child: AppText(
TranslationBase.of(context).myReferredPatient,
fontSize: SizeConfig.textMultiplier * 1.8,
color: index == 0 ? Colors.white : Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
),
),
appBar: PatientSearchHeader(
title: TranslationBase.of(context).patientsreferral,
),
body: Column(
children: <Widget>[
Container(
//height: MediaQuery.of(context).size.height * 0.050,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Theme.of(context).dividerColor,
width: 1), //width: 0.7
),
color: Colors.white),
child: TabBar(
isScrollable: false,
controller: _tabController,
indicatorColor: Colors.transparent,
indicatorWeight: 1.0,
indicatorSize: TabBarIndicatorSize.tab,
labelColor: Theme.of(context).primaryColor,
labelPadding:
EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0),
unselectedLabelColor: Colors.grey[800],
tabs: [
Container(
width: MediaQuery.of(context).size.width * 0.33,
height: MediaQuery.of(context).size.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff), Color(0xFFCCCCCC),
borderRadius: 4, borderWidth: 0),
child: Center(
child: Container(
height: MediaQuery.of(context).size.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
index == 0 ? Color(0xFFD02127) : Color(0xFFEAEAEA),
index == 0 ? Color(0xFFD02127) : Color(0xFFEAEAEA),
borderRadius: 4,
borderWidth: 0),
child: Center(
child: AppText(
TranslationBase.of(context).myReferredPatient,
fontSize: SizeConfig.textMultiplier * 1.8,
color: index == 0 ? Colors.white : Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
),
Container(
width: MediaQuery.of(context).size.width * 0.34,
height: MediaQuery.of(context).size.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff), Color(0xFFCCCCCC),
borderRadius: 4, borderWidth: 0),
child: Center(
child: Container(
height: MediaQuery.of(context).size.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
index == 1
? Color(0xFFD02127 )
: Color(0xFFEAEAEA),
index == 1 ? Color(0xFFD02127) : Color(0xFFEAEAEA),
borderRadius: 4,
borderWidth: 0),
child: Center(
child: AppText(
TranslationBase.of(context).referral,
fontSize: SizeConfig.textMultiplier * 1.8,
color: index == 1 ? Colors.white : Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
),
),
),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.34,
height: MediaQuery.of(context).size.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff), Color(0xFFCCCCCC),
borderRadius: 4, borderWidth: 0),
child: Center(
child: Container(
height: MediaQuery.of(context).size.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
index == 1 ? Color(0xFFD02127) : Color(0xFFEAEAEA),
index == 1 ? Color(0xFFD02127) : Color(0xFFEAEAEA),
borderRadius: 4,
borderWidth: 0),
child: Center(
child: AppText(
TranslationBase.of(context).referral,
fontSize: SizeConfig.textMultiplier * 1.8,
color: index == 1 ? Colors.white : Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
),
Container(
width: MediaQuery.of(context).size.width * 0.33,
height: MediaQuery.of(context).size.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff), Color(0xFFCCCCCC),
borderRadius: 4, borderWidth: 0),
child: Center(
child: Container(
height: MediaQuery.of(context).size.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
index == 2
? Color(0xFFD02127 )
: Color(0xFFEAEAEA),
index == 2 ? Color(0xFFD02127) : Color(0xFFEAEAEA),
borderRadius: 4,
borderWidth: 0),
child: Center(
child: AppText(
TranslationBase.of(context).discharged,
fontSize: SizeConfig.textMultiplier * 1.8,
color: index == 2 ? Colors.white : Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
),
),
),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.33,
height: MediaQuery.of(context).size.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff), Color(0xFFCCCCCC),
borderRadius: 4, borderWidth: 0),
child: Center(
child: Container(
height: MediaQuery.of(context).size.height * 0.070,
decoration: TextFieldsUtils.containerBorderDecoration(
index == 2 ? Color(0xFFD02127) : Color(0xFFEAEAEA),
index == 2 ? Color(0xFFD02127) : Color(0xFFEAEAEA),
borderRadius: 4,
borderWidth: 0),
child: Center(
child: AppText(
TranslationBase.of(context).discharged,
fontSize: SizeConfig.textMultiplier * 1.8,
color: index == 2 ? Colors.white : Color(0xFF2B353E),
fontWeight: FontWeight.w700,
),
),
],
),
),
),
),
],
),
),
body: Column(
children: <Widget>[
Expanded(
child: TabBarView(
physics: BouncingScrollPhysics(),
controller: _tabController,
children: <Widget>[
ReferredPatientScreen(),
MyReferralInPatientScreen(),
ReferralDischargedPatientPage()
// MyReferredPatient(),
],
),
)
],
),
));
Expanded(
child: TabBarView(
physics: BouncingScrollPhysics(),
controller: _tabController,
children: <Widget>[
ReferredPatientScreen(),
MyReferralInPatientScreen(),
ReferralDischargedPatientPage()
// MyReferredPatient(),
],
),
)
],
),
);
}
}

@ -23,7 +23,8 @@ import 'package:hexcolor/hexcolor.dart';
class PatientMakeReferralScreen extends StatefulWidget {
// previous design page is: ReferPatientScreen
@override
_PatientMakeReferralScreenState createState() => _PatientMakeReferralScreenState();
_PatientMakeReferralScreenState createState() =>
_PatientMakeReferralScreenState();
}
class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
@ -56,8 +57,14 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
String arrivalType = routeArgs['arrivalType'];
referToList = List();
dynamic sameBranch = {"id": 1, "name": TranslationBase.of(context).sameBranch};
dynamic otherBranch = {"id": 2, "name": TranslationBase.of(context).otherBranch};
dynamic sameBranch = {
"id": 1,
"name": TranslationBase.of(context).sameBranch
};
dynamic otherBranch = {
"id": 2,
"name": TranslationBase.of(context).otherBranch
};
referToList.add(sameBranch);
referToList.add(otherBranch);
@ -103,25 +110,57 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
model.patientReferral.length == 0
? referralForm(model, screenSize)
: PatientReferralItemWidget(
referralStatus: model.patientReferral[model.patientReferral.length - 1].referralStatus,
patientName: model.patientReferral[model.patientReferral.length - 1].patientName,
patientGender:
model.patientReferral[model.patientReferral.length - 1].patientDetails.gender,
referredDate:
model.patientReferral[model.patientReferral.length - 1].referredOn.split(" ")[0],
referredTime:
model.patientReferral[model.patientReferral.length - 1].referredOn.split(" ")[1],
patientID: "${model.patientReferral[model.patientReferral.length - 1].patientID}",
isSameBranch:
model.patientReferral[model.patientReferral.length - 1].isReferralDoctorSameBranch,
referralStatus: model
.patientReferral[
model.patientReferral.length - 1]
.referralStatus,
patientName: model
.patientReferral[
model.patientReferral.length - 1]
.patientName,
patientGender: model
.patientReferral[
model.patientReferral.length - 1]
.patientDetails
.gender,
referredDate: model
.patientReferral[
model.patientReferral.length - 1]
.referredOn
.split(" ")[0],
referredTime: model
.patientReferral[
model.patientReferral.length - 1]
.referredOn
.split(" ")[1],
patientID:
"${model.patientReferral[model.patientReferral.length - 1].patientID}",
isSameBranch: model
.patientReferral[
model.patientReferral.length - 1]
.isReferralDoctorSameBranch,
isReferral: true,
remark: model.patientReferral[model.patientReferral.length - 1].remarksFromSource,
nationality:
model.patientReferral[model.patientReferral.length - 1].patientDetails.nationalityName,
nationalityFlag: model.patientReferral[model.patientReferral.length - 1].nationalityFlagUrl,
doctorAvatar: model.patientReferral[model.patientReferral.length - 1].doctorImageUrl,
referralDoctorName:
model.patientReferral[model.patientReferral.length - 1].referredByDoctorInfo,
remark: model
.patientReferral[
model.patientReferral.length - 1]
.remarksFromSource,
nationality: model
.patientReferral[
model.patientReferral.length - 1]
.patientDetails
.nationalityName,
nationalityFlag: model
.patientReferral[
model.patientReferral.length - 1]
.nationalityFlagUrl,
doctorAvatar: model
.patientReferral[
model.patientReferral.length - 1]
.doctorImageUrl,
referralDoctorName: model
.patientReferral[
model.patientReferral.length - 1]
.referredByDoctorInfo,
clinicDescription: null,
),
],
@ -140,22 +179,26 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
eventAction: "Submit Refer",
);
if (_referTo == null) {
branchError = TranslationBase.of(context).fieldRequired;
branchError =
TranslationBase.of(context).fieldRequired;
} else {
branchError = null;
}
if (_selectedBranch == null) {
hospitalError = TranslationBase.of(context).fieldRequired;
hospitalError =
TranslationBase.of(context).fieldRequired;
} else {
hospitalError = null;
}
if (_selectedClinic == null) {
clinicError = TranslationBase.of(context).fieldRequired;
clinicError =
TranslationBase.of(context).fieldRequired;
} else {
clinicError = null;
}
if (_selectedDoctor == null) {
doctorError = TranslationBase.of(context).fieldRequired;
doctorError =
TranslationBase.of(context).fieldRequired;
} else {
doctorError = null;
}
@ -166,10 +209,16 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
_selectedDoctor == null ||
_remarksController.text == null) return;
model
.makeReferral(patient, appointmentDate.toIso8601String(), _selectedBranch['facilityId'],
_selectedClinic['ClinicID'], _selectedDoctor['DoctorID'], _remarksController.text)
.makeReferral(
patient,
appointmentDate.toIso8601String(),
_selectedBranch['facilityId'],
_selectedClinic['ClinicID'],
_selectedDoctor['DoctorID'],
_remarksController.text)
.then((_) {
DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsg);
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context).referralSuccessMsg);
Navigator.pop(context);
});
},
@ -215,7 +264,8 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
GifLoaderDialogUtils.showMyDialog(context);
await model
.getClinics(_selectedBranch['facilityId'])
.then((_) => GifLoaderDialogUtils.hideDialog(context));
.then((_) =>
GifLoaderDialogUtils.hideDialog(context));
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
}
@ -242,42 +292,47 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).hospital,
dropDownText: _selectedBranch != null ? _selectedBranch['facilityName'] : null,
dropDownText: _selectedBranch != null
? _selectedBranch['facilityName']
: null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: hospitalError,
onClick:
model.branchesList != null && model.branchesList.length > 0 && _referTo != null && _referTo['id'] == 2
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.branchesList,
attributeName: 'facilityName',
attributeValueId: 'facilityId',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() async {
_selectedBranch = selectedValue;
_selectedClinic = null;
_selectedDoctor = null;
GifLoaderDialogUtils.showMyDialog(context);
await model
.getClinics(_selectedBranch['facilityId'])
.then((_) => GifLoaderDialogUtils.hideDialog(context));
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
}
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
onClick: model.branchesList != null &&
model.branchesList.length > 0 &&
_referTo != null &&
_referTo['id'] == 2
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.branchesList,
attributeName: 'facilityName',
attributeValueId: 'facilityId',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) {
setState(() async {
_selectedBranch = selectedValue;
_selectedClinic = null;
_selectedDoctor = null;
GifLoaderDialogUtils.showMyDialog(context);
await model
.getClinics(_selectedBranch['facilityId'])
.then((_) =>
GifLoaderDialogUtils.hideDialog(context));
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
}
});
},
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
),
SizedBox(
height: 10,
@ -285,11 +340,15 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).clinic,
dropDownText: _selectedClinic != null ? _selectedClinic['ClinicDescription'] : null,
dropDownText: _selectedClinic != null
? _selectedClinic['ClinicDescription']
: null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: clinicError,
onClick: _selectedBranch != null && model.clinicsList != null && model.clinicsList.length > 0
onClick: _selectedBranch != null &&
model.clinicsList != null &&
model.clinicsList.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.clinicsList,
@ -304,8 +363,12 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
_selectedClinic = selectedValue;
GifLoaderDialogUtils.showMyDialog(context);
await model
.getClinicDoctors(patient, _selectedClinic['ClinicID'], _selectedBranch['facilityId'])
.then((_) => GifLoaderDialogUtils.hideDialog(context));
.getClinicDoctors(
patient,
_selectedClinic['ClinicID'],
_selectedBranch['facilityId'])
.then((_) =>
GifLoaderDialogUtils.hideDialog(context));
if (model.state == ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(model.error);
}
@ -328,11 +391,14 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).doctor,
dropDownText: _selectedDoctor != null ? _selectedDoctor['Name'] : null,
dropDownText:
_selectedDoctor != null ? _selectedDoctor['Name'] : null,
enabled: false,
isTextFieldHasSuffix: true,
validationError: doctorError,
onClick: _selectedClinic != null && model.doctorsList != null && model.doctorsList.length > 0
onClick: _selectedClinic != null &&
model.doctorsList != null &&
model.doctorsList.length > 0
? () {
ListSelectDialog dialog = ListSelectDialog(
list: model.doctorsList,
@ -357,9 +423,12 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
}
: () {
if (_selectedClinic == null) {
DrAppToastMsg.showErrorToast("You need to select a clinic first");
} else if (model.doctorsList == null || model.doctorsList.length == 0) {
DrAppToastMsg.showErrorToast("There is no doctors for this clinic");
DrAppToastMsg.showErrorToast(
"You need to select a clinic first");
} else if (model.doctorsList == null ||
model.doctorsList.length == 0) {
DrAppToastMsg.showErrorToast(
"There is no doctors for this clinic");
}
},
),
@ -369,8 +438,9 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
AppTextFieldCustom(
height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).date,
dropDownText:
appointmentDate != null ? "${AppDateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}" : null,
dropDownText: appointmentDate != null
? "${AppDateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}"
: null,
enabled: false,
isTextFieldHasSuffix: true,
suffixIcon: IconButton(

@ -269,7 +269,7 @@ class PatientReferralItemWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
referralDoctorName,
referralDoctorName ?? "",
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
fontSize: 14.0,

Loading…
Cancel
Save