keep show header in bottom sheet while it loading

merge-requests/773/head
Elham Rababh 3 years ago
parent c69f122713
commit ac6a6e7855

@ -32,6 +32,7 @@ class AddAssessmentDetails extends StatefulWidget {
addSelectedAssessment;
final PatiantInformtion patientInfo;
final bool isUpdate;
AddAssessmentDetails(
{Key key,
this.mySelectedAssessment,
@ -129,14 +130,14 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
isShowAppBar: true,
appBar: BottomSheetTitle(
title: TranslationBase.of(context).addAssessmentDetails),
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: SingleChildScrollView(
child: Center(
child: Column(
children: [
BottomSheetTitle(
title: TranslationBase.of(context).addAssessmentDetails),
FractionallySizedBox(
widthFactor: 0.9,
child: Container(

@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -38,39 +39,14 @@ class _AddExaminationPageState extends State<AddExaminationPage> {
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
isShowAppBar: true,
appBar: BottomSheetTitle(
title: "${TranslationBase.of(context).addExamination}",
),
backgroundColor: Color.fromRGBO(248, 248, 248, 1),
body: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.only(
left: 16, top: 70, right: 16, bottom: 16),
color: Colors.white,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: AppText(
"${TranslationBase.of(context).addExamination}",
fontSize: SizeConfig.textMultiplier * 3.3,
color: Colors.black,
fontWeight: FontWeight.w700,
),
),
InkWell(
onTap: () {
Navigator.of(context).pop();
},
child: Icon(
Icons.clear,
size: 40,
),
)
],
),
),
Expanded(
child: SingleChildScrollView(
child: Column(
@ -100,7 +76,7 @@ class _AddExaminationPageState extends State<AddExaminationPage> {
widget.removeExamination(history);
});
},
addExamination: (selectedExamination) {
addHistory: (selectedExamination) {
widget.mySelectedExamination
.add(selectedExamination);
// setState(() {});

@ -82,7 +82,7 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
onChanged: (newValue) {
setState(() {
if (widget.isServiceSelected(widget.item)) {
if (!examination.isLocal)
if (examination.isLocal)
widget.removeExamination(widget.item);
widget.expandClick();
} else {

@ -60,7 +60,7 @@ class ExaminationItemCard extends StatelessWidget {
SizedBox(
height: 4,
),
if(examination.remark.isEmpty)
if(examination.remark.isNotEmpty)
AppText(
examination.remark,
fontWeight: FontWeight.normal,

@ -9,14 +9,14 @@ import 'add_examination_widget.dart';
class ExaminationsListSearchWidget extends StatefulWidget {
final Function(MasterKeyModel) removeExamination;
final Function(MySelectedExamination) addExamination;
final Function(MySelectedExamination) addHistory;
final bool Function(MasterKeyModel) isServiceSelected;
final List<MasterKeyModel> masterList;
final List<MySelectedExamination> mySelectedExamination;
ExaminationsListSearchWidget(
{this.removeExamination,
this.addExamination,
this.addHistory,
this.isServiceSelected,
this.masterList, this.mySelectedExamination});
@ -62,7 +62,7 @@ class _ExaminationsListSearchWidgetState
...items.mapIndexed((index, item) {
return AddExaminationWidget(
item: item,
addExamination: widget.addExamination,
addExamination: widget.addHistory,
removeExamination: widget.removeExamination,
mySelectedExamination: widget.mySelectedExamination,
isServiceSelected: widget.isServiceSelected,

@ -260,11 +260,8 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
widget.changeLoadingState(false);
Helpers.showErrorToast(model.error);
} else {
widget.changeLoadingState(false);
// TODO Elham* return this
// widget.changeLoadingState(true);
//widget.changePageViewIndex(2);
widget.changeLoadingState(true);
widget.changePageViewIndex(2);
}
} else {
Helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg);

@ -1,7 +1,7 @@
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:flutter/material.dart';
class BottomSheetTitle extends StatelessWidget {
class BottomSheetTitle extends StatelessWidget with PreferredSizeWidget {
const BottomSheetTitle({
Key key, this.title,
}) : super(key: key);
@ -57,4 +57,7 @@ class BottomSheetTitle extends StatelessWidget {
),
);
}
@override
Size get preferredSize => Size(double.maxFinite,115);
}

@ -1,5 +1,6 @@
import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart';
@ -83,95 +84,100 @@ class _AddAllergiesState extends State<AddAllergies> {
}
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
body: Center(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
BottomSheetTitle(
title: TranslationBase.of(context).addAllergies,
baseViewModel: model,
isShowAppBar: true,
appBar: BottomSheetTitle(
title: TranslationBase.of(context).addAllergies,
),
body: Center(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 10,
),
SizedBox(
height: 16,
),
Expanded(
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Center(
child: NetworkBaseView(
baseViewModel: model,
child: MasterKeyCheckboxSearchAllergiesWidget(
model: model,
masterList: model.allergiesList,
removeAllergy: (master) {
setState(() {
removeAllergyFromLocalList(master);
});
},
addAllergy:
(MySelectedAllergy mySelectedAllergy) {
addAllergyLocally(mySelectedAllergy);
},
addSelectedAllergy: () => widget
.addAllergiesFun(myAllergiesListLocal),
isServiceSelected: (master) =>
isServiceSelected(master),
getServiceSelectedAllergy: (master) =>
getSelectedAllergy(master),
),
),
),
),
),
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.11,
),
]),
),
),
bottomSheet: 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: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
SizedBox(
height: 16,
),
Expanded(
child: Center(
child: FractionallySizedBox(
widthFactor: 0.9,
child: Center(
child: NetworkBaseView(
baseViewModel: model,
child: MasterKeyCheckboxSearchAllergiesWidget(
model: model,
masterList: model.allergiesList,
removeAllergy: (master) {
setState(() {
removeAllergyFromLocalList(master);
});
},
addAllergy:
(MySelectedAllergy mySelectedAllergy) {
addAllergyLocally(mySelectedAllergy);
},
addSelectedAllergy: () => widget
.addAllergiesFun(myAllergiesListLocal),
isServiceSelected: (master) =>
isServiceSelected(master),
getServiceSelectedAllergy: (master) =>
getSelectedAllergy(master),
),
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: AppButton(
title: TranslationBase.of(context).addAllergies,
padding: 10,
color: Color(0xFF359846),
onPressed: () {
widget.addAllergiesFun(myAllergiesListLocal);
},
),
),
),
),
SizedBox(
height: MediaQuery.of(context).size.height * 0.11,
height: 5,
),
]),
),
),bottomSheet: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(0.0),
),
border: Border.all(color: HexColor('#707070'), width: 0),
),
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: AppButton(
title:
TranslationBase.of(context).addAllergies,
padding: 10,
color: Color(0xFF359846),
onPressed: () {
widget.addAllergiesFun(myAllergiesListLocal);
},
),
],
),
),
),
SizedBox(
height: 5,
),
],
),
),),
),
),
);
}
@ -207,17 +213,15 @@ class _AddAllergiesState extends State<AddAllergies> {
addAllergyLocally(MySelectedAllergy mySelectedAllergy) {
if (mySelectedAllergy.selectedAllergy == null) {
Helpers.showErrorToast(TranslationBase
.of(context)
.requiredMsg);
Helpers.showErrorToast(TranslationBase.of(context).requiredMsg);
} else {
setState(() {
List<MySelectedAllergy> allergy =
// ignore: missing_return
myAllergiesListLocal
.where((element) =>
mySelectedAllergy.selectedAllergy.id ==
element.selectedAllergy.id)
// ignore: missing_return
myAllergiesListLocal
.where((element) =>
mySelectedAllergy.selectedAllergy.id ==
element.selectedAllergy.id)
.toList();
if (allergy.isEmpty) {

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart';
@ -19,10 +20,15 @@ class AddHistoryDialog extends StatefulWidget {
final PageController controller;
final List<MySelectedHistory> myHistoryList;
final Function addSelectedHistories;
final Function (MasterKeyModel) removeHistory;
final Function(MasterKeyModel) removeHistory;
const AddHistoryDialog(
{Key key, this.changePageViewIndex, this.controller, this.myHistoryList, this.addSelectedHistories, this.removeHistory})
{Key key,
this.changePageViewIndex,
this.controller,
this.myHistoryList,
this.addSelectedHistories,
this.removeHistory})
: super(key: key);
@override
@ -51,96 +57,96 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
isShowAppBar: true,
appBar: BottomSheetTitle(
title: TranslationBase.of(context).addHistory),
body: Center(
child: Container(
child: Column(
children: [
BottomSheetTitle(title:TranslationBase.of(context).addHistory),
SizedBox(
height: 10,
),
PriorityBar(onTap: (activePriority) async {
widget.changePageViewIndex(activePriority);
}),
SizedBox(
height: 20,
),
Expanded(
child: FractionallySizedBox(
widthFactor: 0.9,
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: widget.controller,
onPageChanged: (index) {
setState(() {
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
NetworkBaseView(
baseViewModel: model,
child: MasterKeyCheckboxSearchWidget(
model: model,
masterList: model.historyFamilyList,
removeHistory: (history){
setState(() {
widget.removeHistory(history);
});
},
addHistory: (history){
setState(() {
createAndAddHistory(
history);
});
},
addSelectedHistories: (){
widget.addSelectedHistories();
},
isServiceSelected: (master) =>isServiceSelected(master),
),
),
NetworkBaseView(
baseViewModel: model,
child: MasterKeyCheckboxSearchWidget(
model: model,
masterList: model.mergeHistorySurgicalWithHistorySportList,
removeHistory: (history){
setState(() {
widget.removeHistory(history);
});
},
addHistory: (history){
setState(() {
createAndAddHistory(
history);
});
},
addSelectedHistories: (){
widget.addSelectedHistories();
},
isServiceSelected: (master) =>isServiceSelected(master),
),
),
NetworkBaseView(
baseViewModel: model,
child: MasterKeyCheckboxSearchWidget(
model: model,
masterList: model.historyMedicalList,
removeHistory: (history){
setState(() {
widget.removeHistory(history);
});
},
addHistory: (history){
setState(() {
createAndAddHistory(
history);
});
},
addSelectedHistories: (){
widget.addSelectedHistories();
},
children: [
SizedBox(
height: 10,
),
PriorityBar(onTap: (activePriority) async {
widget.changePageViewIndex(activePriority);
}),
SizedBox(
height: 20,
),
Expanded(
child: FractionallySizedBox(
widthFactor: 0.9,
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: widget.controller,
onPageChanged: (index) {
setState(() {});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
NetworkBaseView(
baseViewModel: model,
child: MasterKeyCheckboxSearchWidget(
model: model,
masterList: model.historyFamilyList,
removeHistory: (history) {
setState(() {
widget.removeHistory(history);
});
},
addHistory: (history) {
setState(() {
createAndAddHistory(history);
});
},
addSelectedHistories: () {
widget.addSelectedHistories();
},
isServiceSelected: (master) =>
isServiceSelected(master),
),
),
NetworkBaseView(
baseViewModel: model,
child: MasterKeyCheckboxSearchWidget(
model: model,
masterList: model
.mergeHistorySurgicalWithHistorySportList,
removeHistory: (history) {
setState(() {
widget.removeHistory(history);
});
},
addHistory: (history) {
setState(() {
createAndAddHistory(history);
});
},
addSelectedHistories: () {
widget.addSelectedHistories();
},
isServiceSelected: (master) =>
isServiceSelected(master),
),
),
NetworkBaseView(
baseViewModel: model,
child: MasterKeyCheckboxSearchWidget(
model: model,
masterList: model.historyMedicalList,
removeHistory: (history) {
setState(() {
widget.removeHistory(history);
});
},
addHistory: (history) {
setState(() {
createAndAddHistory(history);
});
},
addSelectedHistories: () {
widget.addSelectedHistories();
},
isServiceSelected: (master) =>
isServiceSelected(master),
),
@ -149,59 +155,63 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
),
),
),
SizedBox(height:MediaQuery.of(context).size.height * 0.11 ,)
SizedBox(
height: MediaQuery.of(context).size.height * 0.11,
)
],
)
),
)),
),
bottomSheet: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(0.0),
),
border: Border.all(color: HexColor('#707070'), width: 0),
),
height: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: AppButton(
title:
TranslationBase.of(context).addSelectedHistories,
padding: 10,
color: Color(0xFF359846),
onPressed: () {
widget.addSelectedHistories();
},
),
bottomSheet: 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: MediaQuery.of(context).size.height * 0.1,
width: double.infinity,
child: Column(
children: [
SizedBox(
height: 10,
),
Container(
child: FractionallySizedBox(
widthFactor: .80,
child: Center(
child: AppButton(
title: TranslationBase.of(context)
.addSelectedHistories,
padding: 10,
color: Color(0xFF359846),
onPressed: () {
widget.addSelectedHistories();
},
),
),
),
),
SizedBox(
height: 5,
),
],
),
),
SizedBox(
height: 5,
),
],
),
),
),
));
}
createAndAddHistory(MasterKeyModel history) {
List<MySelectedHistory> myhistory = widget.myHistoryList.where((element) =>
history.id ==
element.selectedHistory.id &&
history.typeId ==
element.selectedHistory.typeId
).toList();
List<MySelectedHistory> myhistory = widget.myHistoryList
.where((element) =>
history.id == element.selectedHistory.id &&
history.typeId == element.selectedHistory.typeId)
.toList();
if (myhistory.isEmpty) {
setState(() {
@ -217,18 +227,14 @@ class _AddHistoryDialogState extends State<AddHistoryDialog> {
}
isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedHistory> history =
widget
.myHistoryList
.where((element) =>
masterKey.id == element.selectedHistory.id &&
masterKey.typeId == element.selectedHistory.typeId &&
element.isChecked);
Iterable<MySelectedHistory> history = widget.myHistoryList.where(
(element) =>
masterKey.id == element.selectedHistory.id &&
masterKey.typeId == element.selectedHistory.typeId &&
element.isChecked);
if (history.length > 0) {
return true;
}
return false;
}
}

@ -1,6 +1,7 @@
// ignore: must_be_immutable
import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
@ -74,15 +75,15 @@ class _AddMedicationState extends State<AddMedication> {
},
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
isShowAppBar: true,
appBar: BottomSheetTitle(
title: TranslationBase.of(context).addMedication,
),
body: Center(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
BottomSheetTitle(
title: TranslationBase.of(context).addMedication,
),
SizedBox(
height: 10,
),
@ -381,7 +382,7 @@ class _AddMedicationState extends State<AddMedication> {
]),
),
),
bottomSheet: Container(
bottomSheet:model.state == ViewState.Busy?Container(height: 0,): Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(

Loading…
Cancel
Save