6 step from fix screen

merge-requests/896/head
Elham Rababh 4 years ago
parent 28d8449345
commit 359b337b27

@ -1,16 +1,16 @@
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
class MySelectedExamination { class MySelectedExamination {
MasterKeyModel selectedExamination; MasterKeyModel? selectedExamination;
String remark; String? remark;
bool isNormal; bool isNormal;
bool isAbnormal; bool isAbnormal;
bool notExamined; bool notExamined;
bool isNew; bool isNew;
bool isLocal; bool isLocal;
int createdBy; int? createdBy;
String createdOn; String? createdOn;
String editedOn; String? editedOn;
MySelectedExamination({ MySelectedExamination({
this.selectedExamination, this.selectedExamination,

@ -1,8 +1,8 @@
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
class MySelectedHistory { class MySelectedHistory {
MasterKeyModel selectedHistory; MasterKeyModel? selectedHistory;
String remark; String? remark;
bool? isChecked; bool? isChecked;
bool? isLocal; bool? isLocal;

@ -25,7 +25,7 @@ class AddExaminationPage extends StatefulWidget {
} }
class _AddExaminationPageState extends State<AddExaminationPage> { class _AddExaminationPageState extends State<AddExaminationPage> {
List<MySelectedExamination> mySelectedExaminationLocal; late List<MySelectedExamination> mySelectedExaminationLocal;
@override @override
initState() { initState() {

@ -20,7 +20,7 @@ class AddExaminationWidget extends StatefulWidget {
final bool Function(MasterKeyModel) isServiceSelected; final bool Function(MasterKeyModel) isServiceSelected;
bool isExpand; bool isExpand;
final VoidCallback expandClick; final VoidCallback expandClick;
final List<MySelectedExamination> mySelectedExamination; final List<MySelectedExamination>? mySelectedExamination;
AddExaminationWidget({ AddExaminationWidget({
required this.item, required this.item,
@ -44,13 +44,13 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
@override @override
void initState() { void initState() {
if (getSelectedExam(widget.item) != null) { if (getSelectedExam(widget.item) != null) {
examination = getSelectedExam(widget.item); examination = getSelectedExam(widget.item)!;
status = examination.isNormal status = examination.isNormal
? 1 ? 1
: examination.isAbnormal : examination.isAbnormal
? 2 ? 2
: 3; : 3;
remarksController.text = examination.remark; remarksController.text = examination!.remark!;
} else { } else {
examination.selectedExamination = widget.item; examination.selectedExamination = widget.item;
} }
@ -75,7 +75,7 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
Checkbox( Checkbox(
value:widget.isServiceSelected(widget.item), value:widget.isServiceSelected(widget.item),
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (bool newValue) { onChanged: (bool ?newValue) {
onExamTap(); onExamTap();
}), }),
Container( Container(
@ -274,11 +274,11 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
}); });
} }
MySelectedExamination getSelectedExam(MasterKeyModel masterKey) { MySelectedExamination? getSelectedExam(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> exam = widget.mySelectedExamination.where( Iterable<MySelectedExamination> exam = widget.mySelectedExamination!.where(
(element) => (element) =>
masterKey.id == element.selectedExamination.id && masterKey.id == element.selectedExamination!.id &&
masterKey.typeId == element.selectedExamination.typeId); masterKey.typeId == element.selectedExamination!.typeId);
if (exam.length > 0) { if (exam.length > 0) {
return exam.first; return exam.first;
} }

@ -73,7 +73,7 @@ class ExaminationItemCard extends StatelessWidget {
SizedBox( SizedBox(
height: 4, height: 4,
), ),
if (examination.remark.isNotEmpty) if (examination.remark!.isNotEmpty)
RemarkText(remark: examination.remark), RemarkText(remark: examination.remark),
], ],
), ),

@ -19,7 +19,7 @@ class ExaminationsListSearchWidget extends StatefulWidget {
{required this.removeExamination, {required this.removeExamination,
required this.addExamination, required this.addExamination,
required this.isServiceSelected, required this.isServiceSelected,
required this.masterList, this.mySelectedExamination}); required this.masterList, required this.mySelectedExamination});
@override @override
_ExaminationsListSearchWidgetState createState() => _ExaminationsListSearchWidgetState(); _ExaminationsListSearchWidgetState createState() => _ExaminationsListSearchWidgetState();

@ -71,7 +71,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
await model.getMasterLookup(MasterKeysService.PhysicalExamination); await model.getMasterLookup(MasterKeysService.PhysicalExamination);
} }
model.patientPhysicalExamList.forEach((element) { model.patientPhysicalExamList.forEach((element) {
MasterKeyModel examMaster = model.getOneMasterKey( MasterKeyModel? examMaster = model.getOneMasterKey(
masterKeys: MasterKeysService.PhysicalExamination, masterKeys: MasterKeysService.PhysicalExamination,
id: element.examId, id: element.examId,
); );
@ -152,7 +152,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
.map((examination) { .map((examination) {
return ExaminationItemCard(examination, () { return ExaminationItemCard(examination, () {
removeExamination( removeExamination(
examination.selectedExamination); examination!.selectedExamination!);
}); });
}).toList(), }).toList(),
), ),
@ -181,7 +181,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
.map((examination) { .map((examination) {
return ExaminationItemCard(examination, () { return ExaminationItemCard(examination, () {
removeExamination( removeExamination(
examination.selectedExamination); examination.selectedExamination!);
}); });
}).toList(), }).toList(),
) )
@ -205,7 +205,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
submitUpdateObjectivePage(SOAPViewModel model) async { submitUpdateObjectivePage(SOAPViewModel model) async {
if (mySelectedExamination.isNotEmpty) { if (mySelectedExamination.isNotEmpty) {
if(!model.isAddExamInProgress && widget.patientInfo.admissionNo != null && if(!model.isAddExamInProgress && widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo.isNotEmpty) { widget.patientInfo.admissionNo!.isNotEmpty) {
Navigator.of(context).pop(); Navigator.of(context).pop();
}else{ }else{
widget.changeLoadingState(true); widget.changeLoadingState(true);
@ -230,8 +230,8 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
createdOn: exam.createdOn ?? DateTime.now().toIso8601String(), createdOn: exam.createdOn ?? DateTime.now().toIso8601String(),
editedBy: doctorProfile.doctorID, editedBy: doctorProfile.doctorID,
editedOn: DateTime.now().toIso8601String(), editedOn: DateTime.now().toIso8601String(),
examId: exam.selectedExamination.id, examId: exam.selectedExamination!.id,
examType: exam.selectedExamination.typeId, examType: exam.selectedExamination!.typeId,
isAbnormal: exam.isAbnormal, isAbnormal: exam.isAbnormal,
isNormal: exam.isNormal, isNormal: exam.isNormal,
notExamined: exam.notExamined, notExamined: exam.notExamined,
@ -248,13 +248,13 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
isNew: exam.isNew, isNew: exam.isNew,
); );
if (widget.patientInfo.admissionNo != null && if (widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo.isNotEmpty) { widget.patientInfo.admissionNo!.isNotEmpty) {
listHisProgNotePhysicalExaminationVM.admissionNo = listHisProgNotePhysicalExaminationVM.admissionNo =
int.parse(widget.patientInfo.admissionNo); int.parse(widget.patientInfo.admissionNo!);
} else { } else {
listHisProgNotePhysicalExaminationVM.admissionNo = 0; listHisProgNotePhysicalExaminationVM.admissionNo = 0;
} }
postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM!
.add(listHisProgNotePhysicalExaminationVM); .add(listHisProgNotePhysicalExaminationVM);
}); });
@ -268,13 +268,13 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
widget.changeLoadingState(false); widget.changeLoadingState(false);
Helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
if(widget.patientInfo.admissionNo != null && if(widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo.isNotEmpty) { widget.patientInfo.admissionNo!.isNotEmpty) {
// Navigator.of(context).pop(); // Navigator.of(context).pop();
model.isAddExamInProgress = false; model.isAddExamInProgress = false;
} }
} else { } else {
if(widget.patientInfo.admissionNo != null && if(widget.patientInfo.admissionNo != null &&
widget.patientInfo.admissionNo.isNotEmpty) { widget.patientInfo.admissionNo!.isNotEmpty) {
// Navigator.of(context).pop(); // Navigator.of(context).pop();
widget.changeLoadingState(false); widget.changeLoadingState(false);
model.isAddExamInProgress = false; model.isAddExamInProgress = false;
@ -322,9 +322,8 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
mySelectedExaminationLocal.forEach((element) { mySelectedExaminationLocal.forEach((element) {
if ((mySelectedExamination.singleWhere( if ((mySelectedExamination.singleWhere(
(it) => (it) =>
it.selectedExamination.id == it.selectedExamination!.id ==
element.selectedExamination.id, element.selectedExamination!.id)) ==
orElse: () => null)) ==
null) { null) {
mySelectedExamination.insert(0,element); mySelectedExamination.insert(0,element);
} }
@ -335,16 +334,16 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage>
mySelectedExamination.forEach((element) { mySelectedExamination.forEach((element) {
if ((mySelectedExaminationLocal.singleWhere( if ((mySelectedExaminationLocal.singleWhere(
(it) => (it) =>
it.selectedExamination.id == it.selectedExamination!.id ==
element.selectedExamination.id, element.selectedExamination!.id,
orElse: () => null)) == )) ==
null) { null) {
removedList.add(element); removedList.add(element);
} }
}); });
removedList.forEach((element) { removedList.forEach((element) {
removeExamination(element.selectedExamination); removeExamination(element.selectedExamination!);
}); });
Navigator.of(context).pop(); Navigator.of(context).pop();
} }

@ -37,7 +37,8 @@ class UpdatePlanPage extends StatefulWidget {
required this.changeLoadingState, required this.changeLoadingState,
required this.currentIndex, required this.currentIndex,
required this.sOAPViewModel, required this.sOAPViewModel,
this.changeStateFun}); required this.changeStateFun});
@override @override
_UpdatePlanPageState createState() => _UpdatePlanPageState(); _UpdatePlanPageState createState() => _UpdatePlanPageState();
@ -90,7 +91,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
///TODO set progressNote in model; ///TODO set progressNote in model;
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Helpers.parseHtmlString( progressNoteController.text = Helpers.parseHtmlString(
widget.sOAPViewModel.patientProgressNoteList[0].planNote); widget.sOAPViewModel!.patientProgressNoteList[0]!.planNote!);
patientProgressNote.planNote = progressNoteController.text; patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName = patientProgressNote.createdByName =
@ -126,7 +127,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Helpers.parseHtmlString( progressNoteController.text = Helpers.parseHtmlString(
widget.sOAPViewModel.patientProgressNoteList[0].planNote); widget.sOAPViewModel.patientProgressNoteList[0].planNote!);
patientProgressNote.planNote = progressNoteController.text; patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName = patientProgressNote.createdByName =
widget.sOAPViewModel.patientProgressNoteList[0].createdByName; widget.sOAPViewModel.patientProgressNoteList[0].createdByName;
@ -253,7 +254,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
.getDayMonthYearDateFormatted( .getDayMonthYearDateFormatted(
DateTime.parse( DateTime.parse(
patientProgressNote patientProgressNote
.createdOn)) .createdOn!))
: AppDateUtils : AppDateUtils
.getDayMonthYearDateFormatted( .getDayMonthYearDateFormatted(
DateTime.now()), DateTime.now()),
@ -288,7 +289,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
? AppDateUtils.getHour( ? AppDateUtils.getHour(
DateTime.parse( DateTime.parse(
patientProgressNote patientProgressNote
.createdOn)) .createdOn!))
: AppDateUtils.getHour( : AppDateUtils.getHour(
DateTime.now()), DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -385,7 +386,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage>
.getPatientProgressNote(getGetProgressNoteReqModel); .getPatientProgressNote(getGetProgressNoteReqModel);
if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = Helpers.parseHtmlString( progressNoteController.text = Helpers.parseHtmlString(
widget.sOAPViewModel.patientProgressNoteList[0].planNote); widget.sOAPViewModel.patientProgressNoteList[0].planNote!);
patientProgressNote.planNote = progressNoteController.text; patientProgressNote.planNote = progressNoteController.text;
patientProgressNote.createdByName = patientProgressNote.createdByName =
widget.sOAPViewModel.patientProgressNoteList[0].createdByName; widget.sOAPViewModel.patientProgressNoteList[0].createdByName;

@ -9,7 +9,7 @@ class SOAPStepHeader extends StatelessWidget {
const SOAPStepHeader({ const SOAPStepHeader({
Key? key, Key? key,
required this.currentIndex, required this.currentIndex,
required this.changePageViewIndex, this.patientInfo, required this.changePageViewIndex, required this.patientInfo,
}) : super(key: key); }) : super(key: key);
final int currentIndex; final int currentIndex;

@ -4,8 +4,8 @@ import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
class BottomSheetDialogButton extends StatelessWidget { class BottomSheetDialogButton extends StatelessWidget {
final Function onTap; final VoidCallback? onTap;
final String label; final String? label;
double headerHeight = SizeConfig.heightMultiplier * 12; double headerHeight = SizeConfig.heightMultiplier * 12;

@ -3,9 +3,9 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class RemarkText extends StatelessWidget { class RemarkText extends StatelessWidget {
final String remark; final String? remark;
const RemarkText({ const RemarkText({
Key key, this.remark, Key? key, this.remark,
}) : super(key: key); }) : super(key: key);
@override @override

@ -7,8 +7,8 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
class RemoveButton extends StatelessWidget { class RemoveButton extends StatelessWidget {
final Function onTap; final VoidCallback? onTap;
final String label; final String? label;
const RemoveButton({Key? key, this.onTap, this.label}) : super(key: key); const RemoveButton({Key? key, this.onTap, this.label}) : super(key: key);

@ -4,10 +4,10 @@ import 'package:flutter/material.dart';
class StepDetailsWidget extends StatelessWidget { class StepDetailsWidget extends StatelessWidget {
final String stepLabel; final String stepLabel;
final double marginLeft; final double? marginLeft;
const StepDetailsWidget({ const StepDetailsWidget({
Key key, this.stepLabel, this.marginLeft = 0, Key? key, required this.stepLabel, this.marginLeft = 0,
}) : super(key: key); }) : super(key: key);
@override @override

@ -6,9 +6,9 @@ import 'package:hexcolor/hexcolor.dart';
class StatusLabel extends StatelessWidget { class StatusLabel extends StatelessWidget {
const StatusLabel({ const StatusLabel({
Key key, Key? key,
this.stepId, required this.stepId,
this.selectedStepId, required this.selectedStepId,
}) : super(key: key); }) : super(key: key);
final int stepId; final int stepId;

@ -17,10 +17,10 @@ class StepsWidget extends StatelessWidget {
StepsWidget( StepsWidget(
{Key? key, {Key? key,
this.index, required this.index,
this.changeCurrentTab, required this.changeCurrentTab,
this.height = 0.0, this.height = 0.0,
this.patientInfo}); required this.patientInfo});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -52,7 +52,7 @@ class StepsWidget extends StatelessWidget {
child: Container( child: Container(
width: MediaQuery.of(context).size.width * width: MediaQuery.of(context).size.width *
(patientInfo.admissionNo == null || (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty patientInfo.admissionNo!.isEmpty
? 0.9 ? 0.9
: 0.85), : 0.85),
child: Divider( child: Divider(
@ -115,7 +115,7 @@ class StepsWidget extends StatelessWidget {
Positioned( Positioned(
top: circleTop, top: circleTop,
left: patientInfo.admissionNo == null || left: patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty patientInfo.admissionNo!.isEmpty
? MediaQuery.of(context).size.width * 0.25 ? MediaQuery.of(context).size.width * 0.25
: MediaQuery.of(context).size.width * 0.71, : MediaQuery.of(context).size.width * 0.71,
child: InkWell( child: InkWell(
@ -167,7 +167,7 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
if (patientInfo.admissionNo == null || if (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty) patientInfo.admissionNo!.isEmpty)
Positioned( Positioned(
top: circleTop, top: circleTop,
left: MediaQuery.of(context).size.width * 0.47, left: MediaQuery.of(context).size.width * 0.47,
@ -222,7 +222,7 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
if (patientInfo.admissionNo == null || if (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty) patientInfo.admissionNo!.isEmpty)
Positioned( Positioned(
top: circleTop, top: circleTop,
right: 0, right: 0,
@ -289,7 +289,7 @@ class StepsWidget extends StatelessWidget {
child: Center( child: Center(
child: Container( child: Container(
width: MediaQuery.of(context).size.width * (patientInfo.admissionNo == null || width: MediaQuery.of(context).size.width * (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty?0.9:0.85), patientInfo.admissionNo!.isEmpty?0.9:0.85),
child: Divider( child: Divider(
color: Colors.grey, color: Colors.grey,
height: 0.75, height: 0.75,
@ -349,7 +349,7 @@ class StepsWidget extends StatelessWidget {
Positioned( Positioned(
top: circleTop, top: circleTop,
right: MediaQuery.of(context).size.width * (patientInfo.admissionNo == null || right: MediaQuery.of(context).size.width * (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty?0.25:0.71), patientInfo.admissionNo!.isEmpty?0.25:0.71),
child: InkWell( child: InkWell(
onTap: () => index >= 2 ? changeCurrentTab(1) : null, onTap: () => index >= 2 ? changeCurrentTab(1) : null,
child: Column( child: Column(
@ -396,7 +396,7 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
if (patientInfo.admissionNo == null || if (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty) patientInfo.admissionNo!.isEmpty)
Positioned( Positioned(
top: circleTop, top: circleTop,
right: MediaQuery.of(context).size.width * 0.50, right: MediaQuery.of(context).size.width * 0.50,
@ -451,7 +451,7 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
if (patientInfo.admissionNo == null || if (patientInfo.admissionNo == null ||
patientInfo.admissionNo.isEmpty) patientInfo.admissionNo!.isEmpty)
Positioned( Positioned(
top: circleTop, top: circleTop,
left: 0, left: 0,

@ -100,7 +100,7 @@ class _AddAllergiesState extends State<AddAllergies> {
isServiceSelected: (master) => isServiceSelected: (master) =>
isServiceSelected(master), isServiceSelected(master),
getServiceSelectedAllergy: (master) => getServiceSelectedAllergy: (master) =>
getSelectedAllergy(master), getSelectedAllergy(master)!, hintSearchText: '', buttonName: '',
), ),
), ),
), ),
@ -145,7 +145,7 @@ class _AddAllergiesState extends State<AddAllergies> {
myAllergiesListLocal.removeWhere((element) => element.selectedAllergy!.id == masterKey.id); myAllergiesListLocal.removeWhere((element) => element.selectedAllergy!.id == masterKey.id);
} }
MySelectedAllergy? getSelectedAllergy(MasterKeyModel masterKey) { MySelectedAllergy ? getSelectedAllergy(MasterKeyModel masterKey) {
Iterable<MySelectedAllergy> allergy = myAllergiesListLocal.where((element) => Iterable<MySelectedAllergy> allergy = myAllergiesListLocal.where((element) =>
masterKey.id == element.selectedAllergy!.id && masterKey.id == element.selectedAllergy!.id &&
masterKey.typeId == element.selectedAllergy!.typeId && masterKey.typeId == element.selectedAllergy!.typeId &&

@ -27,12 +27,12 @@ class AddAllergiesItem extends StatefulWidget {
const AddAllergiesItem( const AddAllergiesItem(
{Key? key, {Key? key,
this.model, required this.model,
this.removeAllergy, required this.removeAllergy,
this.addAllergy, required this.addAllergy,
this.isServiceSelected, required this.isServiceSelected,
this.getServiceSelectedAllergy, required this.getServiceSelectedAllergy,
this.item}) required this.item})
: super(key: key); : super(key: key);
@override @override
@ -40,7 +40,7 @@ class AddAllergiesItem extends StatefulWidget {
} }
class _AddAllergiesItemState extends State<AddAllergiesItem> { class _AddAllergiesItemState extends State<AddAllergiesItem> {
MasterKeyModel _selectedAllergySeverity; late MasterKeyModel _selectedAllergySeverity;
bool isSubmitted = false; bool isSubmitted = false;
@override @override
@ -48,7 +48,7 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
bool isSelected = widget.isServiceSelected(widget.item); bool isSelected = widget.isServiceSelected(widget.item);
MySelectedAllergy mySelectedAllergy; MySelectedAllergy mySelectedAllergy =MySelectedAllergy() ;
if (isSelected) { if (isSelected) {
mySelectedAllergy = widget.getServiceSelectedAllergy(widget.item); mySelectedAllergy = widget.getServiceSelectedAllergy(widget.item);
} }
@ -58,8 +58,8 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
text: isSelected text: isSelected
? mySelectedAllergy.selectedAllergySeverity != null ? mySelectedAllergy.selectedAllergySeverity != null
? projectViewModel.isArabic ? projectViewModel.isArabic
? mySelectedAllergy.selectedAllergySeverity.nameAr ? mySelectedAllergy.selectedAllergySeverity!.nameAr
: mySelectedAllergy.selectedAllergySeverity.nameEn : mySelectedAllergy.selectedAllergySeverity!.nameEn
: null : null
: null); : null);
return HeaderBodyExpandableNotifier( return HeaderBodyExpandableNotifier(
@ -71,7 +71,7 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
Checkbox( Checkbox(
value: widget.isServiceSelected(widget.item), value: widget.isServiceSelected(widget.item),
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (bool newValue) { onChanged: (bool ?newValue) {
onTapItem(); onTapItem();
}), }),
InkWell( InkWell(
@ -97,12 +97,12 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
if (mySelectedAllergy != null) { if (mySelectedAllergy != null) {
setState(() { setState(() {
mySelectedAllergy.isExpanded = mySelectedAllergy.isExpanded =
mySelectedAllergy.isExpanded ? false : true; mySelectedAllergy.isExpanded! ? false : true;
}); });
} }
}, },
child: Icon( child: Icon(
(mySelectedAllergy != null ? mySelectedAllergy.isExpanded : false) (mySelectedAllergy!.isExpanded!)
? EvaIcons.arrowIosUpwardOutline ? EvaIcons.arrowIosUpwardOutline
: EvaIcons.arrowIosDownwardOutline, : EvaIcons.arrowIosDownwardOutline,
color: Color(0xFF575757), color: Color(0xFF575757),
@ -142,14 +142,14 @@ class _AddAllergiesItemState extends State<AddAllergiesItem> {
} }
: null, : null,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
hintText: TranslationBase.of(context).selectSeverity + "*", hintText: TranslationBase.of(context).selectSeverity! + "*",
enabled: false, enabled: false,
maxLines: 1, maxLines: 1,
minLines: 1, minLines: 1,
height: Helpers.getTextFieldHeight(), height: Helpers.getTextFieldHeight(),
validationError: mySelectedAllergy != null && validationError: mySelectedAllergy != null &&
mySelectedAllergy.selectedAllergySeverity == null && mySelectedAllergy.selectedAllergySeverity == null &&
mySelectedAllergy.hasValidationError mySelectedAllergy!.hasValidationError!
? TranslationBase.of(context).severityValidationError ? TranslationBase.of(context).severityValidationError
: null, : null,
controller: severityController, controller: severityController,

@ -25,15 +25,15 @@ class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget {
MasterKeyCheckboxSearchAllergiesWidget( MasterKeyCheckboxSearchAllergiesWidget(
{Key? key, {Key? key,
this.model, required this.model,
this.addSelectedAllergy, required this.addSelectedAllergy,
this.removeAllergy, required this.removeAllergy,
this.masterList, required this.masterList,
this.addAllergy, required this.addAllergy,
this.isServiceSelected, required this.isServiceSelected,
this.buttonName, required this.buttonName,
this.hintSearchText, required this.hintSearchText,
this.getServiceSelectedAllergy}) required this.getServiceSelectedAllergy})
: super(key: key); : super(key: key);
@override @override
@ -80,7 +80,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
icon: Icon( icon: Icon(
Icons.search, Icons.search,
color: Colors.black, color: Colors.black,
)), ), onPressed: () { },),
), ),
DividerWithSpacesAround(), DividerWithSpacesAround(),
SizedBox( SizedBox(
@ -127,8 +127,8 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
if (query.isNotEmpty) { if (query.isNotEmpty) {
List<MasterKeyModel> dummyListData = []; List<MasterKeyModel> dummyListData = [];
dummySearchList.forEach((items) { dummySearchList.forEach((items) {
if (items.nameAr.toLowerCase().contains(query.toLowerCase()) || if (items.nameAr!.toLowerCase().contains(query.toLowerCase()) ||
items.nameEn.toLowerCase().contains(query.toLowerCase())) { items.nameEn!.toLowerCase().contains(query.toLowerCase())) {
dummyListData.add(items); dummyListData.add(items);
} }
}); });

@ -77,11 +77,11 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
AppText( AppText(
projectViewModel.isArabic projectViewModel.isArabic
? selectedAllergy ? selectedAllergy
.selectedAllergySeverity.nameAr .selectedAllergySeverity!.nameAr
: selectedAllergy : selectedAllergy
.selectedAllergySeverity.nameEn .selectedAllergySeverity!.nameEn!
.toUpperCase(), .toUpperCase(),
textDecoration: selectedAllergy.isChecked textDecoration: selectedAllergy!.isChecked!
? null ? null
: TextDecoration.lineThrough, : TextDecoration.lineThrough,
color: Color(0xFFCC9B14), color: Color(0xFFCC9B14),
@ -132,7 +132,7 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
.toList(); .toList();
if (allergy.length > 0) { if (allergy.length > 0) {
if (allergy.first.isLocal) { if (allergy!.first!.isLocal!) {
setState(() { setState(() {
widget.myAllergiesList.remove(allergy.first); widget.myAllergiesList.remove(allergy.first);
}); });
@ -165,9 +165,8 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
mySelectedAllergy.forEach((element) { mySelectedAllergy.forEach((element) {
if ((widget.myAllergiesList.singleWhere( if ((widget.myAllergiesList.singleWhere(
(it) => (it) =>
it.selectedAllergy.id == it.selectedAllergy!.id ==
element.selectedAllergy.id, element.selectedAllergy!.id,)) ==
orElse: () => null)) ==
null) { null) {
widget.myAllergiesList.add(element); widget.myAllergiesList.add(element);
} }
@ -178,9 +177,8 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
widget.myAllergiesList.forEach((element) { widget.myAllergiesList.forEach((element) {
if ((mySelectedAllergy.singleWhere( if ((mySelectedAllergy.singleWhere(
(it) => (it) =>
it.selectedAllergy.id == it.selectedAllergy!.id ==
element.selectedAllergy.id, element.selectedAllergy!.id)) ==
orElse: () => null)) ==
null) { null) {
removedList.add(element); removedList.add(element);
} }

@ -59,7 +59,7 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBar: appBar:
BottomSheetTitle(title: TranslationBase.of(context).addHistory), BottomSheetTitle(title: TranslationBase.of(context).addHistory!),
body: Center( body: Center(
child: Container( child: Container(
child: Column( child: Column(

@ -70,9 +70,9 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget> with TickerPr
letterSpacing: -0.48,), letterSpacing: -0.48,),
width: MediaQuery.of(context).size.width * 0.5, width: MediaQuery.of(context).size.width * 0.5,
), ),
if (myHistory.isChecked) if (myHistory!.isChecked!)
RemoveButton( RemoveButton(
onTap: () => removeHistory(myHistory.selectedHistory), onTap: () => removeHistory(myHistory!.selectedHistory!),
) )
], ],
), ),
@ -97,7 +97,7 @@ class _UpdateHistoryWidgetState extends State<UpdateHistoryWidget> with TickerPr
.toList(); .toList();
if (history.length > 0){ if (history.length > 0){
if (history.first.isLocal) { if (history!.first!.isLocal!) {
setState(() { setState(() {
widget.myHistoryList.remove(history.first); widget.myHistoryList.remove(history.first);
}); });

Loading…
Cancel
Save