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

Doctor app design

See merge request Cloud_Solution/doctor_app_flutter!917
merge-requests/918/merge
Elham Ali 3 years ago
commit adc9f8b4dc

@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/core/model/search_drug/get_medication_respons
import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/medicine/pharmacies_list_screen.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
@ -124,7 +125,10 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
return AppScaffold(
// baseViewModel: model,
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).searchMedicine,
appBar: PatientSearchHeader(
title: TranslationBase.of(context).searchMedicine,
),
//appBarTitle: TranslationBase.of(context).searchMedicine + "6",
body: SingleChildScrollView(
child: FractionallySizedBox(
widthFactor: 0.97,

@ -36,9 +36,7 @@ class AddPatientSickLeaveScreen extends StatefulWidget {
final SickLeaveViewModel previousModel;
AddPatientSickLeaveScreen(
{this.appointmentNo,
this.patientMRN,
this.patient, this.previousModel});
{this.appointmentNo, this.patientMRN, this.patient, this.previousModel});
@override
_AddPatientSickLeaveScreenState createState() =>
@ -59,9 +57,9 @@ class _AddPatientSickLeaveScreenState extends State<AddPatientSickLeaveScreen> {
void _presentDatePicker() {
showDatePicker(
context: context,
initialDate: currentDate??DateTime.now(),
firstDate: DateTime(DateTime.now().year-1),
lastDate: DateTime(DateTime.now().year+1),
initialDate: currentDate ?? DateTime.now(),
firstDate: DateTime(DateTime.now().year - 1),
lastDate: DateTime(DateTime.now().year + 1),
).then((pickedDate) {
if (pickedDate == null) {
return;
@ -70,7 +68,9 @@ class _AddPatientSickLeaveScreenState extends State<AddPatientSickLeaveScreen> {
final df = new DateFormat('yyyy-MM-dd');
addSickLeave.startDate = df.format(pickedDate);
currentDate = pickedDate;
_toDateController.text = AppDateUtils.getDayMonthYearDateFormatted(pickedDate,isMonthShort: true );
_toDateController.text = AppDateUtils.getDayMonthYearDateFormatted(
pickedDate,
isMonthShort: true);
});
});
}
@ -91,256 +91,251 @@ class _AddPatientSickLeaveScreenState extends State<AddPatientSickLeaveScreen> {
widget.appointmentNo, widget.patientMRN);
},
builder: (_, model, w) => GestureDetector(
onTap: () {
FocusScope.of(context).requestFocus(new FocusNode());
},
child: AppScaffold(
baseViewModel: model,
appBar: BottomSheetTitle(
title: TranslationBase.of(context).addSickLeave,
),
isShowAppBar: true,
body: Center(
child: Container(
margin: EdgeInsets.only(top: 10),
child: FractionallySizedBox(
widthFactor: 0.9,
child: ListView(
children: [
SizedBox(
height: 30,
),
AppTextFieldCustom(
height: Helpers.getTextFieldHeight(),
hintText: TranslationBase.of(context).sickLeave +
' ' +
TranslationBase.of(context).days,
maxLines: 1,
minLines: 1,
dropDownColor: Colors.white,
isTextFieldHasSuffix: true,
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(ONLY_NUMBERS))
],
inputType:TextInputType.number,
controller: _numberOfDayController,
onChanged: (value) {
if(value.isNotEmpty)
setState(() {
addSickLeave.noOfDays = value;
});
},
validationError: isFormSubmitted &&
(addSickLeave.noOfDays == null)
? TranslationBase.of(context)
.pleaseEnterNoOfDays
: null,
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: Helpers.getTextFieldHeight(),
onClick: () {
Helpers.hideKeyboard(context);
_presentDatePicker();
},
hintText: TranslationBase.of(context)
.sickLeaveDate,
enabled: false,
maxLines: 1,
minLines: 1,
isTextFieldHasSuffix: true,
suffixIcon: IconButton(
icon: Icon(Icons.calendar_today)),
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(ONLY_NUMBERS))
],
controller: _toDateController,
onChanged: (value) {
setState(() {
addSickLeave.startDate = value;
});
},
validationError: isFormSubmitted &&
(addSickLeave.startDate == null)
? TranslationBase.of(context)
.pleaseEnterDate
: null,
),
SizedBox(
height: 5,
),
AppTextFieldCustom(
height: Helpers.getTextFieldHeight(),
hintText: TranslationBase.of(context).clinic,
enabled: false,
maxLines: 1,
minLines: 1,
dropDownColor: Colors.white,
isTextFieldHasSuffix: true,
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(ONLY_NUMBERS))
],
controller: _clinicController,
onChanged: (value) {},
),
SizedBox(
height: 10,
),
model.sickLeaveStatistics.recommendedSickLeaveDays!=
null
? Row(
crossAxisAlignment:
CrossAxisAlignment.center,
onTap: () {
FocusScope.of(context).requestFocus(new FocusNode());
},
child: AppScaffold(
baseViewModel: model,
appBar: BottomSheetTitle(
title: TranslationBase.of(context).addSickLeave,
),
isShowAppBar: true,
body: Center(
child: Container(
margin: EdgeInsets.only(top: 10),
child: FractionallySizedBox(
widthFactor: 0.9,
child: ListView(
children: [
SizedBox(
width: 10,
height: 30,
),
Icon(
DoctorApp.warning,
size: 20,
color: IN_PROGRESS_COLOR,
AppTextFieldCustom(
height: Helpers.getTextFieldHeight(),
hintText: TranslationBase.of(context).sickLeave +
' ' +
TranslationBase.of(context).days,
maxLines: 1,
minLines: 1,
dropDownColor: Colors.white,
isTextFieldHasSuffix: true,
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(ONLY_NUMBERS))
],
inputType: TextInputType.number,
controller: _numberOfDayController,
onChanged: (value) {
if (value.isNotEmpty)
setState(() {
addSickLeave.noOfDays = value;
});
},
validationError: isFormSubmitted &&
(addSickLeave.noOfDays == null)
? TranslationBase.of(context)
.pleaseEnterNoOfDays
: null,
),
SizedBox(
width: 10,
height: 10,
),
Expanded(
child: AppText(
model.sickLeaveStatistics.recommendedSickLeaveDays,
textAlign: TextAlign.start,
fontSize: 12,
color: IN_PROGRESS_COLOR,
),
AppTextFieldCustom(
height: Helpers.getTextFieldHeight(),
onClick: () {
Helpers.hideKeyboard(context);
_presentDatePicker();
},
hintText:
TranslationBase.of(context).sickLeaveDate,
enabled: false,
maxLines: 1,
minLines: 1,
isTextFieldHasSuffix: true,
suffixIcon:
IconButton(icon: Icon(Icons.calendar_today)),
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(ONLY_NUMBERS))
],
controller: _toDateController,
onChanged: (value) {
setState(() {
addSickLeave.startDate = value;
});
},
validationError: isFormSubmitted &&
(addSickLeave.startDate == null)
? TranslationBase.of(context).pleaseEnterDate
: null,
),
SizedBox(
height: 5,
),
AppTextFieldCustom(
height: Helpers.getTextFieldHeight(),
hintText: TranslationBase.of(context).clinic,
enabled: false,
maxLines: 1,
minLines: 1,
dropDownColor: Colors.white,
isTextFieldHasSuffix: true,
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(ONLY_NUMBERS))
],
controller: _clinicController,
onChanged: (value) {},
),
SizedBox(
height: 10,
),
model.sickLeaveStatistics
.recommendedSickLeaveDays !=
null
? Row(
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
SizedBox(
width: 10,
),
Icon(
DoctorApp.warning,
size: 20,
color: IN_PROGRESS_COLOR,
),
SizedBox(
width: 10,
),
Expanded(
child: AppText(
model.sickLeaveStatistics
.recommendedSickLeaveDays,
textAlign: TextAlign.start,
fontSize: 12,
color: IN_PROGRESS_COLOR,
),
),
],
)
: SizedBox(
height: 10,
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: Helpers.getTextFieldHeight(),
hintText: TranslationBase.of(context).doctor,
enabled: false,
maxLines: 1,
minLines: 1,
dropDownColor: Colors.white,
isTextFieldHasSuffix: true,
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(ONLY_NUMBERS))
],
controller: _doctorController,
onChanged: (value) {},
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: Helpers.getTextFieldHeight(),
hintText: TranslationBase.of(context).remarks,
maxLines: 30,
minLines: 5,
dropDownColor: Colors.white,
isTextFieldHasSuffix: true,
controller: _remarkController,
onChanged: (value) {
setState(() {
addSickLeave.remarks = value;
});
},
),
SizedBox(
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 12 : 10) +
20,
),
],
)
: SizedBox(
height: 10,
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: Helpers.getTextFieldHeight(),
hintText: TranslationBase.of(context).doctor,
enabled: false,
maxLines: 1,
minLines: 1,
dropDownColor: Colors.white,
isTextFieldHasSuffix: true,
inputFormatters: [
FilteringTextInputFormatter.allow(
RegExp(ONLY_NUMBERS))
],
controller: _doctorController,
onChanged: (value) {},
),
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: Helpers.getTextFieldHeight(),
hintText: TranslationBase.of(context).remarks,
maxLines: 30,
minLines: 5,
dropDownColor: Colors.white,
isTextFieldHasSuffix: true,
controller: _remarkController,
onChanged: (value) {
setState(() {
addSickLeave.remarks = value;
});
},
),
SizedBox(
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 12 : 10) +20,
),
],
),
),
),
),
),
bottomSheet: model.state == ViewState.Busy ||
model.state == ViewState.Busy
? Container(
height: 0,
)
: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(0.0),
),
border: Border.all(
color: HexColor('#707070'), width: 0),
),
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 12 : 10),
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
FractionallySizedBox(
widthFactor: 0.9,
child: AppButton(
title: TranslationBase.of(context)
.addSickLeaverequest,
color: AppGlobal.appGreenColor,
onPressed: () async {
submitForm(model);
}),
),
SizedBox(
height: 5,
),
],
),
)),
));
bottomSheet: model.state == ViewState.Busy ||
model.state == ViewState.Busy
? Container(
height: 0,
)
: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(0.0),
),
border: Border.all(
color: HexColor('#707070'), width: 0),
),
height: SizeConfig.heightMultiplier *
(SizeConfig.isHeightVeryShort ? 12 : 10),
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
FractionallySizedBox(
widthFactor: 0.9,
child: AppButton(
title: TranslationBase.of(context)
.addSickLeaverequest,
color: AppGlobal.appGreenColor,
onPressed: () async {
submitForm(model);
}),
),
SizedBox(
height: 5,
),
],
),
)),
));
}
submitForm(SickLeaveViewModel model) async {
{
try {
setState(() {
isFormSubmitted = true;
});
if (addSickLeave.noOfDays == null ||
addSickLeave.startDate == null ) {
return;
try {
setState(() {
isFormSubmitted = true;
});
if (addSickLeave.noOfDays == null || addSickLeave.startDate == null) {
return;
} else {
GifLoaderDialogUtils.showMyDialog(context);
addSickLeave.patientMRN = widget.patient.patientMRN.toString();
addSickLeave.appointmentNo = widget.patient.appointmentNo.toString();
await model.addSickLeave(addSickLeave);
if (model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error);
} else {
GifLoaderDialogUtils.showMyDialog(context);
addSickLeave.patientMRN = widget.patient.patientMRN.toString();
addSickLeave.appointmentNo =
widget.patient.appointmentNo.toString();
await model.addSickLeave(addSickLeave);
if (model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(model.error);
} else {
await widget.previousModel
.getSickLeaveForPatient(widget.patient, isLocalBusy: true);
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context).replySuccessfully);
Navigator.of(context).pop();
}
GifLoaderDialogUtils.hideDialog(context);
await widget.previousModel
.getSickLeaveForPatient(widget.patient, isLocalBusy: true);
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context).replySuccessfully);
Navigator.of(context).pop();
}
} catch (err) {
print(err);
}
GifLoaderDialogUtils.hideDialog(context);
}
} catch (err) {
print(err);
}
}
}
}

@ -37,15 +37,16 @@ class InPatientHeader extends StatelessWidget with PreferredSizeWidget {
child: Row(children: [
IconButton(
icon: Icon(Icons.arrow_back_ios),
color: Colors.black, //Colors.black,
color: Color(0xFF2B353E), //Colors.black,
onPressed: () => Navigator.pop(context),
),
Expanded(
child: AppText(
TranslationBase.of(context).inPatient,
fontSize: SizeConfig.textMultiplier * 2.8,
fontWeight: FontWeight.bold,
fontSize: 24.0,
fontWeight: FontWeight.w700,
color: Color(0xFF2B353E),
letterSpacing: -1.44,
),
),
if (model.specialClinicalCareMappingList.isNotEmpty &&
@ -53,71 +54,72 @@ class InPatientHeader extends StatelessWidget with PreferredSizeWidget {
activeTab != 2)
Container(
width: MediaQuery.of(context).size.width * .3,
child
: DropdownButtonHideUnderline(
child: DropdownButton(
dropdownColor: Colors.white,
iconEnabledColor: Colors.black,
isExpanded: true,
value: selectedMapId??model.specialClinicalCareMappingList[0].nursingStationID,
iconSize: 25,
elevation: 16,
selectedItemBuilder: (BuildContext context) {
return model.specialClinicalCareMappingList.map((item) {
return Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
padding: EdgeInsets.all(2),
margin: EdgeInsets.all(2),
decoration: new BoxDecoration(
color: Colors.red[800],
borderRadius: BorderRadius.circular(20),
),
constraints: BoxConstraints(
minWidth: 20,
minHeight: 20,
),
child: Center(
child: AppText(
model.specialClinicalCareMappingList
.length
.toString(),
color: Colors.white,
fontSize: projectsProvider.isArabic
? 10
: 11,
textAlign: TextAlign.center,
),
)),
],
),
AppText(selectedMapId == null?TranslationBase.of(context).all:item.description,
fontSize: 12,
color: Colors.black,
fontWeight: FontWeight.bold,
textAlign: TextAlign.end),
],
);
}).toList();
},
onChanged: (newValue) async {
onChangeFunc(newValue);
},
items: model.specialClinicalCareMappingList.map((item) {
return DropdownMenuItem(
child: AppText(
item.description,
textAlign: TextAlign.left,
),
value: item.nursingStationID,
);
}).toList(),
)),
child: DropdownButtonHideUnderline(
child: DropdownButton(
dropdownColor: Colors.white,
iconEnabledColor: Colors.black,
isExpanded: true,
value: selectedMapId ??
model.specialClinicalCareMappingList[0].nursingStationID,
iconSize: 25,
elevation: 16,
selectedItemBuilder: (BuildContext context) {
return model.specialClinicalCareMappingList.map((item) {
return Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
padding: EdgeInsets.all(2),
margin: EdgeInsets.all(2),
decoration: new BoxDecoration(
color: Colors.red[800],
borderRadius: BorderRadius.circular(20),
),
constraints: BoxConstraints(
minWidth: 20,
minHeight: 20,
),
child: Center(
child: AppText(
model.specialClinicalCareMappingList.length
.toString(),
color: Colors.white,
fontSize:
projectsProvider.isArabic ? 10 : 11,
textAlign: TextAlign.center,
),
)),
],
),
AppText(
selectedMapId == null
? TranslationBase.of(context).all
: item.description,
fontSize: 12,
color: Colors.black,
fontWeight: FontWeight.bold,
textAlign: TextAlign.end),
],
);
}).toList();
},
onChanged: (newValue) async {
onChangeFunc(newValue);
},
items: model.specialClinicalCareMappingList.map((item) {
return DropdownMenuItem(
child: AppText(
item.description,
textAlign: TextAlign.left,
),
value: item.nursingStationID,
);
}).toList(),
)),
),
]),
),

@ -9,27 +9,28 @@ class PatientSearchHeader extends StatelessWidget with PreferredSizeWidget {
@override
Widget build(BuildContext context) {
return Container(
return Container(
padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5),
decoration: BoxDecoration(
color: Colors.white,
),
child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
padding: EdgeInsets.only(left: 10, right: 10, bottom: 5),
margin: EdgeInsets.only(top: 35),
child: Row(children: [
IconButton(
icon: Icon(Icons.arrow_back_ios),
color: Colors.black, //Colors.black,
color: Color(0xFF2B353E), //Colors.black,
onPressed: () => Navigator.pop(context),
),
Expanded(
child: AppText(
title,
fontSize: SizeConfig.textMultiplier * 2.8,
fontWeight: FontWeight.bold,
fontSize: 24.0,
fontWeight: FontWeight.w700,
color: Color(0xFF2B353E),
fontFamily: 'Poppins',
letterSpacing: -1.44,
),
),
]),
@ -38,5 +39,5 @@ class PatientSearchHeader extends StatelessWidget with PreferredSizeWidget {
}
@override
Size get preferredSize => Size(double.maxFinite,65);
Size get preferredSize => Size(double.maxFinite, 65);
}

@ -2,13 +2,14 @@ import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:flutter/material.dart';
class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget {
BottomSheetTitle({
Key key, this.title,
class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget {
BottomSheetTitle({
Key key,
this.title,
}) : super(key: key);
final String title;
double headerHeight = SizeConfig.heightMultiplier*15;
double headerHeight = SizeConfig.heightMultiplier * 15;
@override
Widget build(BuildContext context) {
return Container(
@ -20,29 +21,25 @@ class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget {
height: headerHeight,
child: Center(
child: Container(
padding: EdgeInsets.only(
left: 10, right: 10),
margin: EdgeInsets.only(top: headerHeight *0.5),
padding: EdgeInsets.only(left: 10, right: 10),
margin: EdgeInsets.only(top: headerHeight * 0.5),
child: Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
RichText(
text: TextSpan(
style: TextStyle(
fontSize:20,
color: Colors.black),
style: TextStyle(fontSize: 20, color: Colors.black),
children: <TextSpan>[
new TextSpan(
text: title,
style: TextStyle(
color: Color(0xFF2B353E),
fontWeight: FontWeight.bold,
fontWeight: FontWeight.w700,
fontFamily: 'Poppins',
fontSize: SizeConfig.getTextMultiplierBasedOnWidth()*6)),
letterSpacing: -1.44,
fontSize: 24.0)),
],
),
),
@ -51,7 +48,7 @@ class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget {
Navigator.pop(context);
},
child: Icon(DoctorApp.close_1,
size:SizeConfig.getTextMultiplierBasedOnWidth()*5,
size: SizeConfig.getTextMultiplierBasedOnWidth() * 5,
color: Color(0xFF2B353E)))
],
),
@ -63,5 +60,5 @@ class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget {
}
@override
Size get preferredSize => Size(double.maxFinite,headerHeight);
Size get preferredSize => Size(double.maxFinite, headerHeight);
}

@ -37,7 +37,8 @@ import 'package:provider/provider.dart';
import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_to_text.dart' as stt;
addPrescriptionForm(context, PrescriptionViewModel model, PatiantInformtion patient, prescription) {
addPrescriptionForm(context, PrescriptionViewModel model,
PatiantInformtion patient, prescription) {
showModalBottomSheet(
isScrollControlled: true,
context: context,
@ -62,7 +63,8 @@ postPrescription(
String icdCode,
PatiantInformtion patient,
String patientType}) async {
PostPrescriptionReqModel postProcedureReqModel = new PostPrescriptionReqModel();
PostPrescriptionReqModel postProcedureReqModel =
new PostPrescriptionReqModel();
List<PrescriptionRequestModel> prescriptionList = List();
postProcedureReqModel.appointmentNo = patient.appointmentNo;
@ -126,7 +128,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
DateTime selectedDate;
int strengthChar;
GetMedicationResponseModel _selectedMedication;
GlobalKey key = new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
GlobalKey key =
new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
TextEditingController drugIdController = TextEditingController();
TextEditingController doseController = TextEditingController();
@ -170,7 +173,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
onVoiceText() async {
new SpeechToText(context: context).showAlertDialog(context);
var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode;
bool available = await speech.initialize(onStatus: statusListener, onError: errorListener);
bool available = await speech.initialize(
onStatus: statusListener, onError: errorListener);
if (available) {
speech.listen(
onResult: resultListener,
@ -213,7 +217,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
}
Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener);
bool hasSpeech = await speech.initialize(
onError: errorListener, onStatus: statusListener);
print(hasSpeech);
if (!mounted) return;
}
@ -259,13 +264,15 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
initialChildSize: 0.98,
maxChildSize: 0.98,
minChildSize: 0.9,
builder: (BuildContext context, ScrollController scrollController) {
builder:
(BuildContext context, ScrollController scrollController) {
return SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * 1.65,
color: Color(0xffF8F8F8),
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0),
padding: EdgeInsets.symmetric(
horizontal: 12.0, vertical: 10.0),
child: Column(
children: [
Column(
@ -287,8 +294,11 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
widthFactor: 0.9,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)),
border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(10),
child: AppTextFormField(
onTap: () {
@ -296,7 +306,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
visbiltySearch = true;
},
borderColor: Colors.white,
hintText: TranslationBase.of(context).searchMedicineNameHere,
hintText: TranslationBase.of(context)
.searchMedicineNameHere,
controller: myController,
onSaved: (value) {},
onFieldSubmitted: (value) {
@ -322,9 +333,12 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
children: <Widget>[
// TODO change it secondary button and add loading
AppButton(
title: TranslationBase.of(context).search,
title: TranslationBase.of(
context)
.search,
onPressed: () async {
await searchMedicine(context, model);
await searchMedicine(
context, model);
},
),
],
@ -333,23 +347,44 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
),
if (myController.text != '')
Container(
height: MediaQuery.of(context).size.height * 0.5,
height: MediaQuery.of(context)
.size
.height *
0.5,
child: ListView.builder(
padding: const EdgeInsets.only(top: 20),
padding: const EdgeInsets.only(
top: 20),
scrollDirection: Axis.vertical,
itemCount: model.allMedicationList == null
? 0
: model.allMedicationList.length,
itemBuilder: (BuildContext context, int index) {
itemCount:
model.allMedicationList ==
null
? 0
: model
.allMedicationList
.length,
itemBuilder:
(BuildContext context,
int index) {
return InkWell(
child: MedicineItemWidget(
label: model.allMedicationList[index].description),
label: model
.allMedicationList[
index]
.description),
onTap: () {
model.getItem(itemID: model.allMedicationList[index].itemId);
visbiltyPrescriptionForm = true;
model.getItem(
itemID: model
.allMedicationList[
index]
.itemId);
visbiltyPrescriptionForm =
true;
visbiltySearch = false;
_selectedMedication = model.allMedicationList[index];
uom = _selectedMedication.uom;
_selectedMedication =
model.allMedicationList[
index];
uom = _selectedMedication
.uom;
},
);
},
@ -368,53 +403,68 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: Column(
children: [
AppText(
_selectedMedication?.description ?? "",
_selectedMedication?.description ??
"",
bold: true,
),
Container(
child: Row(
children: [
AppText(
TranslationBase.of(context).orderType,
TranslationBase.of(context)
.orderType,
fontWeight: FontWeight.w600,
),
Radio(
activeColor: Color(0xFFB9382C),
activeColor:
Color(0xFFB9382C),
value: 1,
groupValue: selectedType,
onChanged: (value) {
setSelectedType(value);
},
),
Text(TranslationBase.of(context).regular),
Text(TranslationBase.of(context)
.regular),
],
),
),
SizedBox(height: spaceBetweenTextFileds),
SizedBox(
height: spaceBetweenTextFileds),
Container(
width: double.infinity,
child: Row(
children: [
Container(
width: MediaQuery.of(context).size.width * 0.35,
width: MediaQuery.of(context)
.size
.width *
0.35,
child: AppTextFieldCustom(
height: 40,
validationError: strengthError,
//height: 40,
validationError:
strengthError,
hintText: 'Strength',
isTextFieldHasSuffix: false,
enabled: true,
controller: strengthController,
controller:
strengthController,
onChanged: (String value) {
setState(() {
strengthChar = value.length;
strengthChar =
value.length;
});
if (strengthChar >= 5) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(context).only5DigitsAllowedForStrength,
DrAppToastMsg
.showErrorToast(
TranslationBase.of(
context)
.only5DigitsAllowedForStrength,
);
}
},
inputType: TextInputType.numberWithOptions(
inputType: TextInputType
.numberWithOptions(
decimal: true,
),
),
@ -423,15 +473,23 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
width: 5.0,
),
PrescriptionTextFiled(
width: MediaQuery.of(context).size.width * 0.517,
element: model.itemMedicineListUnit.length == 1
? model.itemMedicineListUnit[0]
width: MediaQuery.of(context)
.size
.width *
0.510,
element: model
.itemMedicineListUnit
.length ==
1
? model
.itemMedicineListUnit[0]
: units,
elementError: unitError,
keyName: 'description',
keyId: 'parameterCode',
hintText: 'Select',
elementList: model.itemMedicineListUnit,
hintText: 'Unit',
elementList: model
.itemMedicineListUnit,
okFunction: (selectedValue) {
setState(() {
units = selectedValue;
@ -442,10 +500,14 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
],
),
),
SizedBox(height: spaceBetweenTextFileds),
SizedBox(
height: spaceBetweenTextFileds),
PrescriptionTextFiled(
elementList: model.itemMedicineListRoute,
element: model.itemMedicineListRoute.length == 1
elementList:
model.itemMedicineListRoute,
element: model.itemMedicineListRoute
.length ==
1
? model.itemMedicineListRoute[0]
: route,
elementError: routeError,
@ -457,40 +519,58 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
route['isDefault'] = true;
});
},
hintText: TranslationBase.of(context).route,
hintText:
TranslationBase.of(context)
.route,
),
SizedBox(height: spaceBetweenTextFileds),
SizedBox(
height: spaceBetweenTextFileds),
PrescriptionTextFiled(
hintText: TranslationBase.of(context).frequency,
hintText:
TranslationBase.of(context)
.frequency,
elementError: frequencyError,
element: frequency,
elementList: model.itemMedicineList,
elementList:
model.itemMedicineList,
keyId: 'parameterCode',
keyName: 'description',
okFunction: (selectedValue) {
setState(() {
frequency = selectedValue;
frequency['isDefault'] = true;
if (_selectedMedication != null &&
if (_selectedMedication !=
null &&
duration != null &&
frequency != null &&
strengthController.text != null) {
strengthController.text !=
null) {
model.getBoxQuantity(
freq: frequency['parameterCode'],
duration: duration['id'],
itemCode: _selectedMedication.itemId,
strength: double.parse(strengthController.text));
freq: frequency[
'parameterCode'],
duration:
duration['id'],
itemCode:
_selectedMedication
.itemId,
strength: double.parse(
strengthController
.text));
return;
}
});
}),
SizedBox(height: spaceBetweenTextFileds),
SizedBox(
height: spaceBetweenTextFileds),
PrescriptionTextFiled(
hintText: TranslationBase.of(context).doseTime,
hintText:
TranslationBase.of(context)
.doseTime,
elementError: doseTimeError,
element: doseTime,
elementList: model.medicationDoseTimeList,
elementList:
model.medicationDoseTimeList,
keyId: 'id',
keyName: 'nameEn',
okFunction: (selectedValue) {
@ -498,8 +578,10 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
doseTime = selectedValue;
});
}),
SizedBox(height: spaceBetweenTextFileds),
if (model.patientAssessmentList.isNotEmpty)
SizedBox(
height: spaceBetweenTextFileds),
if (model
.patientAssessmentList.isNotEmpty)
Container(
height: screenSize.height * 0.070,
width: double.infinity,
@ -507,25 +589,49 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: Row(
children: [
Container(
width: MediaQuery.of(context).size.width * 0.29,
width:
MediaQuery.of(context)
.size
.width *
0.29,
child: TextField(
decoration: textFieldSelectorDecoration(
model.patientAssessmentList[0].icdCode10ID.toString(),
indication != null ? indication['name'] : null,
false),
decoration:
textFieldSelectorDecoration(
model
.patientAssessmentList[
0]
.icdCode10ID
.toString(),
indication != null
? indication[
'name']
: null,
false),
enabled: true,
readOnly: true,
),
),
Container(
width: MediaQuery.of(context).size.width * 0.59,
width:
MediaQuery.of(context)
.size
.width *
0.57,
color: Colors.white,
child: TextField(
maxLines: 5,
decoration: textFieldSelectorDecoration(
model.patientAssessmentList[0].asciiDesc.toString(),
indication != null ? indication['name'] : null,
false),
decoration:
textFieldSelectorDecoration(
model
.patientAssessmentList[
0]
.asciiDesc
.toString(),
indication != null
? indication[
'name']
: null,
false),
enabled: true,
readOnly: true,
),
@ -533,47 +639,63 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
],
),
),
SizedBox(height: spaceBetweenTextFileds),
SizedBox(
height: spaceBetweenTextFileds),
Container(
height: screenSize.height * 0.070,
color: Colors.white,
child: InkWell(
onTap: () => selectDate(context, widget.model),
onTap: () => selectDate(
context, widget.model),
child: TextField(
decoration: textFieldSelectorDecoration(
TranslationBase.of(context).date,
selectedDate != null
? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}"
: null,
true,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
decoration:
textFieldSelectorDecoration(
TranslationBase.of(
context)
.date,
selectedDate != null
? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}"
: null,
true,
suffixIcon: Icon(
Icons.calendar_today,
color: Colors.black,
)),
enabled: false,
),
),
),
SizedBox(height: spaceBetweenTextFileds),
SizedBox(
height: spaceBetweenTextFileds),
PrescriptionTextFiled(
element: duration,
elementError: durationError,
hintText: TranslationBase.of(context).duration,
elementList: model.medicationDurationList,
hintText:
TranslationBase.of(context)
.duration,
elementList:
model.medicationDurationList,
keyName: 'nameEn',
keyId: 'id',
okFunction: (selectedValue) {
setState(() {
duration = selectedValue;
if (_selectedMedication != null &&
if (_selectedMedication !=
null &&
duration != null &&
frequency != null &&
strengthController.text != null) {
strengthController.text !=
null) {
model.getBoxQuantity(
freq: frequency['parameterCode'],
freq: frequency[
'parameterCode'],
duration: duration['id'],
itemCode: _selectedMedication.itemId,
strength: double.parse(strengthController.text),
itemCode:
_selectedMedication
.itemId,
strength: double.parse(
strengthController
.text),
);
box = model.boxQuintity;
@ -582,38 +704,53 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
});
},
),
SizedBox(height: spaceBetweenTextFileds),
SizedBox(
height: spaceBetweenTextFileds),
Container(
color: Colors.white,
child: AppTextFieldCustom(
hintText: "UOM",
isTextFieldHasSuffix: false,
dropDownText: uom != null ? uom : null,
dropDownText:
uom != null ? uom : null,
enabled: false,
),
),
SizedBox(height: spaceBetweenTextFileds),
SizedBox(
height: spaceBetweenTextFileds),
Container(
color: Colors.white,
child: AppTextFieldCustom(
hintText: TranslationBase.of(context).boxQuantity,
hintText:
TranslationBase.of(context)
.boxQuantity,
isTextFieldHasSuffix: false,
dropDownText: box != null ? model.boxQuintity.toString() : null,
dropDownText: box != null
? model.boxQuintity.toString()
: null,
enabled: false,
),
),
SizedBox(height: spaceBetweenTextFileds),
SizedBox(
height: spaceBetweenTextFileds),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)),
border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
borderRadius: BorderRadius.all(
Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color:
HexColor("#CCCCCC"))),
child: Stack(
children: [
TextFields(
maxLines: 6,
minLines: 4,
hintText: TranslationBase.of(context).instruction,
controller: instructionController,
hintText: TranslationBase.of(
context)
.instruction,
controller:
instructionController,
//keyboardType: TextInputType.number,
),
Positioned(
@ -626,51 +763,77 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
size: 35,
),
onPressed: () {
initSpeechState().then((value) => {onVoiceText()});
initSpeechState().then(
(value) =>
{onVoiceText()});
},
),
),
],
),
),
SizedBox(height: spaceBetweenTextFileds),
SizedBox(
height: spaceBetweenTextFileds),
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
margin: EdgeInsets.all(
SizeConfig.widthMultiplier * 5),
child: Wrap(
alignment: WrapAlignment.center,
children: <Widget>[
AppButton(
color: Color(0xff359846),
title: TranslationBase.of(context).addMedication,
title: TranslationBase.of(
context)
.addMedication,
fontWeight: FontWeight.w600,
onPressed: () async {
await locator<AnalyticsService>().logEvent(
eventCategory: "Add Prescription Form",
eventAction: "Add Prescription",
await locator<
AnalyticsService>()
.logEvent(
eventCategory:
"Add Prescription Form",
eventAction:
"Add Prescription",
);
if (duration != null &&
doseTime != null &&
frequency != null &&
selectedDate != null &&
strengthController.text != "") {
if (_selectedMedication.isNarcotic == true) {
DrAppToastMsg.showErrorToast(TranslationBase.of(context)
.narcoticMedicineCanOnlyBePrescribedFromVida);
strengthController
.text !=
"") {
if (_selectedMedication
.isNarcotic ==
true) {
DrAppToastMsg.showErrorToast(
TranslationBase.of(
context)
.narcoticMedicineCanOnlyBePrescribedFromVida);
Navigator.pop(context);
return;
}
if (double.parse(strengthController.text) > 1000.0) {
DrAppToastMsg.showErrorToast(
"1000 is the MAX for the strength");
if (double.parse(
strengthController
.text) >
1000.0) {
DrAppToastMsg
.showErrorToast(
"1000 is the MAX for the strength");
return;
}
if (double.parse(strengthController.text) < 0.0) {
DrAppToastMsg.showErrorToast("strength can't be zero");
if (double.parse(
strengthController
.text) <
0.0) {
DrAppToastMsg
.showErrorToast(
"strength can't be zero");
return;
}
if (formKey.currentState.validate()) {
if (formKey.currentState
.validate()) {
Navigator.pop(context);
openDrugToDrug(model);
{
@ -759,32 +922,52 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
} else {
setState(() {
if (duration == null) {
durationError = TranslationBase.of(context).fieldRequired;
durationError =
TranslationBase.of(
context)
.fieldRequired;
} else {
durationError = null;
}
if (doseTime == null) {
doseTimeError = TranslationBase.of(context).fieldRequired;
doseTimeError =
TranslationBase.of(
context)
.fieldRequired;
} else {
doseTimeError = null;
}
if (route == null) {
routeError = TranslationBase.of(context).fieldRequired;
routeError =
TranslationBase.of(
context)
.fieldRequired;
} else {
routeError = null;
}
if (frequency == null) {
frequencyError = TranslationBase.of(context).fieldRequired;
frequencyError =
TranslationBase.of(
context)
.fieldRequired;
} else {
frequencyError = null;
}
if (units == null) {
unitError = TranslationBase.of(context).fieldRequired;
unitError =
TranslationBase.of(
context)
.fieldRequired;
} else {
unitError = null;
}
if (strengthController.text == "") {
strengthError = TranslationBase.of(context).fieldRequired;
if (strengthController
.text ==
"") {
strengthError =
TranslationBase.of(
context)
.fieldRequired;
} else {
strengthError = null;
}
@ -834,7 +1017,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
}
}
InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown,
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{Icon suffixIcon}) {
return InputDecoration(
focusedBorder: OutlineInputBorder(
@ -885,7 +1069,9 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
DrugToDrug(widget.patient, getPriscriptionforDrug(widget.prescriptionList, model),
DrugToDrug(
widget.patient,
getPriscriptionforDrug(widget.prescriptionList, model),
model.patientAssessmentList),
Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 3),
@ -896,23 +1082,28 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
postPrescription(
icdCode: model.patientAssessmentList.isNotEmpty
? model.patientAssessmentList[0].icdCode10ID.isEmpty
? model.patientAssessmentList[0].icdCode10ID
.isEmpty
? "test"
: model.patientAssessmentList[0].icdCode10ID.toString()
: model.patientAssessmentList[0].icdCode10ID
.toString()
: "test",
dose: strengthController.text,
doseUnit: model.itemMedicineListUnit.length == 1
? model.itemMedicineListUnit[0]['parameterCode'].toString()
? model.itemMedicineListUnit[0]['parameterCode']
.toString()
: units['parameterCode'].toString(),
patient: widget.patient,
doseTimeIn: doseTime['id'].toString(),
model: widget.model,
duration: duration['id'].toString(),
frequency: model.itemMedicineList.length == 1
? model.itemMedicineList[0]['parameterCode'].toString()
? model.itemMedicineList[0]['parameterCode']
.toString()
: frequency['parameterCode'].toString(),
route: model.itemMedicineListRoute.length == 1
? model.itemMedicineListRoute[0]['parameterCode'].toString()
? model.itemMedicineListRoute[0]['parameterCode']
.toString()
: route['parameterCode'].toString(),
drugId: _selectedMedication.itemId.toString(),
strength: strengthController.text,
@ -931,7 +1122,8 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
});
}
getPriscriptionforDrug(List<PrescriptionModel> prescriptionList, MedicineViewModel model) {
getPriscriptionforDrug(
List<PrescriptionModel> prescriptionList, MedicineViewModel model) {
var prescriptionDetails = [];
if (prescriptionList.length > 0) {
prescriptionList[0].entityList.forEach((element) {

@ -17,7 +17,6 @@ import 'app_texts_widget.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
class AppDrawer extends StatefulWidget {
@override
_AppDrawerState createState() => _AppDrawerState();
@ -37,7 +36,7 @@ class _AppDrawerState extends State<AppDrawer> {
child: Drawer(
child: Column(children: <Widget>[
Expanded(
flex: 4,
flex: 7,
child: ListView(padding: EdgeInsets.zero, children: <Widget>[
Container(
margin: EdgeInsets.symmetric(horizontal: 15),
@ -50,6 +49,8 @@ class _AppDrawerState extends State<AppDrawer> {
Container(
child: Image.asset(
'assets/images/dr_app_logo.png',
width: MediaQuery.of(context).size.width * 0.16,
height: MediaQuery.of(context).size.height * 0.16,
),
margin: EdgeInsets.only(top: 10, bottom: 10),
),
@ -61,6 +62,7 @@ class _AppDrawerState extends State<AppDrawer> {
child: Icon(
DoctorApp.close_1,
size: 20,
color: Color(0xff2B353E),
),
),
margin: EdgeInsets.only(top: 20, bottom: 10),
@ -83,24 +85,29 @@ class _AppDrawerState extends State<AppDrawer> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(top: 10),
padding: EdgeInsets.only(top: 8.0),
child: AppText(
TranslationBase.of(context).dr +
authenticationViewModel.doctorProfile?.doctorName,
fontWeight: FontWeight.bold,
authenticationViewModel
.doctorProfile?.doctorName,
fontWeight: FontWeight.w700,
color: Color(0xFF2E303A),
fontFamily: 'Poppins',
fontSize: 17,
fontSize: 25.0,
letterSpacing: -1.5,
),
),
Padding(
padding: EdgeInsets.only(top: 0),
child: AppText(
authenticationViewModel.doctorProfile?.clinicDescription,
fontWeight: FontWeight.w600,
authenticationViewModel
.doctorProfile?.clinicDescription,
fontWeight: FontWeight.w500,
color: Color(0xFF2E303A),
fontSize: 15,
fontSize: 16,
fontFamily: 'Poppins',
letterSpacing: -0.96,
//textAlign: TextAlign.left,
))
],
),
@ -110,6 +117,7 @@ class _AppDrawerState extends State<AppDrawer> {
child: DrawerItem(
TranslationBase.of(context).applyOrRescheduleLeave,
icon: DoctorApp.reschedule__1,
// subTitle: ,
),
onTap: () {
@ -117,10 +125,11 @@ class _AppDrawerState extends State<AppDrawer> {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AddRescheduleLeavScreen(),
settings: RouteSettings(name: 'AddRescheduleLeaveScreen')
// MyReferredPatient(),
));
builder: (context) => AddRescheduleLeavScreen(),
settings: RouteSettings(
name: 'AddRescheduleLeaveScreen')
// MyReferredPatient(),
));
},
),
SizedBox(height: 15),
@ -131,10 +140,11 @@ class _AppDrawerState extends State<AppDrawer> {
// subTitle: ,
),
),
SizedBox(height: 15),
SizedBox(height: MediaQuery.of(context).size.height * 0.02),
InkWell(
child: Container(
height: 80,
height: MediaQuery.of(context).size.height * 0.16,
width: MediaQuery.of(context).size.width * 0.16,
child: Image.asset('assets/images/qr_code.png'),
),
onTap: () {},
@ -143,7 +153,7 @@ class _AppDrawerState extends State<AppDrawer> {
),
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.09,
height: MediaQuery.of(context).size.height * 0.02,
),
Container(
margin: EdgeInsets.symmetric(horizontal: 20),
@ -174,8 +184,8 @@ class _AppDrawerState extends State<AppDrawer> {
),
onTap: () async {
Navigator.pop(context);
await authenticationViewModel.logout(isFromLogin: false);
await authenticationViewModel.logout(
isFromLogin: false);
},
),
],
@ -191,38 +201,44 @@ class _AppDrawerState extends State<AppDrawer> {
child: Align(
alignment: FractionalOffset.bottomCenter,
child: Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width * 0.3,
child: RichText(
text: TextSpan(
text: 'Powered by',
style: TextStyle(
color: Color(0xFF989898),
fontWeight: FontWeight.bold,
fontSize: 14,
fontFamily: 'Poppins',
),
children: <TextSpan>[
TextSpan(
text: ' Cloud Solutions',
style: TextStyle(
color: Color(0xFF2E303A),
fontSize: 15,
fontFamily: 'Poppins',
),
)
]),
child: Padding(
padding: EdgeInsets.only(
left: projectsProvider.isArabic ? 0 : 15.0,
right: projectsProvider.isArabic ? 15.0 : 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width * 0.3,
child: RichText(
text: TextSpan(
text: 'Powered by',
style: TextStyle(
color: Color(0xFF989898),
fontWeight: FontWeight.w600,
fontSize: 14,
fontFamily: 'Poppins',
letterSpacing: -0.56,
),
children: <TextSpan>[
TextSpan(
text: ' Cloud Solutions',
style: TextStyle(
color: Color(0xFF2E303A),
fontSize: 14,
fontFamily: 'Poppins',
letterSpacing: -0.56,
fontWeight: FontWeight.w700),
)
]),
),
),
),
// Text("Powered by"),
Image.asset(
'assets/images/cs_logo_container.png',
width: SizeConfig.imageSizeMultiplier * 20,
)
],
// Text("Powered by"),
Image.asset('assets/images/cs_logo_container.png',
width:
MediaQuery.of(context).size.width * 0.13)
],
),
))))
]))
])),

@ -103,7 +103,10 @@ class _AppTextState extends State<AppText> {
margin: widget.margin != null
? EdgeInsets.all(widget.margin)
: EdgeInsets.only(
top: widget.marginTop, right: widget.marginRight, bottom: widget.marginBottom, left: widget.marginLeft),
top: widget.marginTop,
right: widget.marginRight,
bottom: widget.marginBottom,
left: widget.marginLeft),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
@ -118,16 +121,21 @@ class _AppTextState extends State<AppText> {
right: 0,
child: Container(
decoration: BoxDecoration(
gradient: LinearGradient(colors: [
Theme.of(context).backgroundColor,
Theme.of(context).backgroundColor.withOpacity(0),
], begin: Alignment.bottomCenter, end: Alignment.topCenter)),
gradient: LinearGradient(
colors: [
Theme.of(context).backgroundColor,
Theme.of(context).backgroundColor.withOpacity(0),
],
begin: Alignment.bottomCenter,
end: Alignment.topCenter)),
height: 30,
),
)
],
),
if (widget.allowExpand && widget.readMore && text.length > widget.maxLength)
if (widget.allowExpand &&
widget.readMore &&
text.length > widget.maxLength)
Padding(
padding: EdgeInsets.only(top: 8.0, right: 8.0, bottom: 8.0),
child: InkWell(
@ -164,7 +172,13 @@ class _AppTextState extends State<AppText> {
),
child: Container(
child: SelectableText(
!hidden ? text : (text.substring(0, text.length > widget.maxLength ? widget.maxLength : text.length)),
!hidden
? text
: (text.substring(
0,
text.length > widget.maxLength
? widget.maxLength
: text.length)),
textAlign: widget.textAlign,
// overflow: widget.maxLines != null
// ? ((widget.maxLines > 1)
@ -180,9 +194,11 @@ class _AppTextState extends State<AppText> {
height: widget.fontHeight)
: TextStyle(
fontStyle: widget.italic ? FontStyle.italic : null,
color: widget.color != null ? widget.color : Colors.black,
color:
widget.color != null ? widget.color : Color(0xff2E303A),
fontSize: widget.fontSize ?? _getFontSize(),
letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null),
letterSpacing: widget.letterSpacing ??
(widget.variant == "overline" ? 1.5 : null),
fontWeight: widget.fontWeight ?? _getFontWeight(),
fontFamily: widget.fontFamily ?? 'Poppins',
decoration: widget.textDecoration,
@ -192,9 +208,19 @@ class _AppTextState extends State<AppText> {
);
} else {
return Text(
!hidden ? text : (text.substring(0, text.length > widget.maxLength ? widget.maxLength : text.length)),
!hidden
? text
: (text.substring(
0,
text.length > widget.maxLength
? widget.maxLength
: text.length)),
textAlign: widget.textAlign,
overflow: widget.maxLines != null ? ((widget.maxLines > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null,
overflow: widget.maxLines != null
? ((widget.maxLines > 1)
? TextOverflow.fade
: TextOverflow.ellipsis)
: null,
maxLines: widget.maxLines ?? null,
style: widget.style != null
? _getFontStyle().copyWith(
@ -206,7 +232,8 @@ class _AppTextState extends State<AppText> {
fontStyle: widget.italic ? FontStyle.italic : null,
color: widget.color != null ? widget.color : Colors.black,
fontSize: widget.fontSize ?? _getFontSize(),
letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null),
letterSpacing: widget.letterSpacing ??
(widget.variant == "overline" ? 1.5 : null),
fontWeight: widget.fontWeight ?? _getFontWeight(),
fontFamily: widget.fontFamily ?? 'Poppins',
decoration: widget.textDecoration,

@ -12,7 +12,8 @@ class DrawerItem extends StatefulWidget {
final Color color;
final String assetLink;
DrawerItem(this.title, {this.icon, this.color, this.subTitle = '', this.assetLink});
DrawerItem(this.title,
{this.icon, this.color, this.subTitle = '', this.assetLink});
@override
_DrawerItemState createState() => _DrawerItemState();
@ -26,33 +27,34 @@ class _DrawerItemState extends State<DrawerItem> {
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
if(widget.assetLink!=null)
if (widget.assetLink != null)
Container(
height: 20,
width: 20,
child: Image.asset(widget.assetLink),
),
if(widget.assetLink==null)
Icon(
widget.icon,
color: widget.color ?? Colors.black87,
size: SizeConfig.imageSizeMultiplier * 5,
),
if (widget.assetLink == null)
Icon(
widget.icon,
color: widget.color ?? Colors.black87,
size: SizeConfig.imageSizeMultiplier * 5,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width *0.45,
width: MediaQuery.of(context).size.width * 0.45,
child: AppText(
widget.title,
marginLeft: 5,
marginRight: 5,
color:widget.color ??Color(0xFF2E303A),
color: widget.color ?? Color(0xFF2E303A),
fontSize: 14,
fontFamily: 'Poppins',
fontWeight: FontWeight.w600,
letterSpacing: -0.84,
),
),
],

@ -664,7 +664,7 @@ packages:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.2"
version: "0.6.3-nullsafety.1"
json_annotation:
dependency: transitive
description:
@ -706,7 +706,7 @@ packages:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.3"
version: "1.3.0-nullsafety.4"
mime:
dependency: transitive
description:
@ -1040,7 +1040,7 @@ packages:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0-nullsafety.1"
version: "1.10.0-nullsafety.2"
sticky_headers:
dependency: "direct main"
description:
@ -1245,5 +1245,5 @@ packages:
source: hosted
version: "2.2.1"
sdks:
dart: ">=2.10.2 <2.11.0"
dart: ">=2.10.2 <=2.11.0-213.1.beta"
flutter: ">=1.22.2 <2.0.0"

Loading…
Cancel
Save