Null Safety Fixes & Overrides

update_flutter_3.16.0_voipcall
Aamir Muhammad 2 years ago
parent ea497ff8b1
commit 499cdc77d4

@ -11,7 +11,6 @@ import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteRequest
import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteResposeModel.dart'; import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteResposeModel.dart';
import 'package:doctor_app_flutter/core/model/note/note_model.dart'; import 'package:doctor_app_flutter/core/model/note/note_model.dart';
import 'package:doctor_app_flutter/core/model/note/stp_master_list_req_model.dart'; import 'package:doctor_app_flutter/core/model/note/stp_master_list_req_model.dart';
import 'package:doctor_app_flutter/core/model/note/stp_master_list_res_model.dart';
import 'package:doctor_app_flutter/core/model/note/update_note_model.dart'; import 'package:doctor_app_flutter/core/model/note/update_note_model.dart';
import 'package:doctor_app_flutter/core/model/patient/get_clinic_by_project_id_request.dart'; import 'package:doctor_app_flutter/core/model/patient/get_clinic_by_project_id_request.dart';
import 'package:doctor_app_flutter/core/model/patient/get_doctor_by_clinic_id_request.dart'; import 'package:doctor_app_flutter/core/model/patient/get_doctor_by_clinic_id_request.dart';
@ -39,15 +38,12 @@ class PatientService extends BaseService {
List<LabOrdersResModel> _patientLabResultOrdersList = []; List<LabOrdersResModel> _patientLabResultOrdersList = [];
List<LabOrdersResModel> get patientLabResultOrdersList => List<LabOrdersResModel> get patientLabResultOrdersList => _patientLabResultOrdersList;
_patientLabResultOrdersList;
List<PrescriptionResModel> get patientPrescriptionsList => List<PrescriptionResModel> get patientPrescriptionsList => _patientPrescriptionsList;
_patientPrescriptionsList;
List<PrescriptionResModel> _patientPrescriptionsList = []; List<PrescriptionResModel> _patientPrescriptionsList = [];
List<PrescriptionReportForInPatient> get prescriptionReportForInPatientList => List<PrescriptionReportForInPatient> get prescriptionReportForInPatientList => _prescriptionReportForInPatientList;
_prescriptionReportForInPatientList;
List<PrescriptionReportForInPatient> _prescriptionReportForInPatientList = []; List<PrescriptionReportForInPatient> _prescriptionReportForInPatientList = [];
List<RadiologyResModel> _patientRadiologyList = []; List<RadiologyResModel> _patientRadiologyList = [];
@ -68,17 +64,14 @@ class PatientService extends BaseService {
List<GetNursingProgressNoteResposeModel> _patientNursingProgressNoteList = []; List<GetNursingProgressNoteResposeModel> _patientNursingProgressNoteList = [];
List<GetNursingProgressNoteResposeModel> get patientNursingProgressNoteList => List<GetNursingProgressNoteResposeModel> get patientNursingProgressNoteList => _patientNursingProgressNoteList;
_patientNursingProgressNoteList;
List<GetDiagnosisForInPatientResponseModel> _diagnosisForInPatientList = []; List<GetDiagnosisForInPatientResponseModel> _diagnosisForInPatientList = [];
List<GetDiagnosisForInPatientResponseModel> get diagnosisForInPatientList => List<GetDiagnosisForInPatientResponseModel> get diagnosisForInPatientList => _diagnosisForInPatientList;
_diagnosisForInPatientList;
List<GetDiabeticChartValuesResponseModel> _diabeticChartValuesList = []; List<GetDiabeticChartValuesResponseModel> _diabeticChartValuesList = [];
List<GetDiabeticChartValuesResponseModel> get diabeticChartValuesList => List<GetDiabeticChartValuesResponseModel> get diabeticChartValuesList => _diabeticChartValuesList;
_diabeticChartValuesList;
List<dynamic> stpMasterList = []; List<dynamic> stpMasterList = [];
@ -106,12 +99,9 @@ class PatientService extends BaseService {
get referalFrequancyList => _referalFrequancyList; get referalFrequancyList => _referalFrequancyList;
DoctorsByClinicIdRequest _doctorsByClinicIdRequest = DoctorsByClinicIdRequest _doctorsByClinicIdRequest = DoctorsByClinicIdRequest();
DoctorsByClinicIdRequest(); STPReferralFrequencyRequest _referralFrequencyRequest = STPReferralFrequencyRequest();
STPReferralFrequencyRequest _referralFrequencyRequest = ClinicByProjectIdRequest _clinicByProjectIdRequest = ClinicByProjectIdRequest();
STPReferralFrequencyRequest();
ClinicByProjectIdRequest _clinicByProjectIdRequest =
ClinicByProjectIdRequest();
ReferToDoctorRequest? _referToDoctorRequest; ReferToDoctorRequest? _referToDoctorRequest;
Future<dynamic> getPatientList(patient, patientType, {isView}) async { Future<dynamic> getPatientList(patient, patientType, {isView}) async {
@ -165,8 +155,7 @@ class PatientService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future getInPatient( Future getInPatient(PatientSearchRequestModel requestModel, bool isMyInpatient) async {
PatientSearchRequestModel requestModel, bool isMyInpatient) async {
hasError = false; hasError = false;
await getDoctorProfile(); await getDoctorProfile();
@ -206,7 +195,7 @@ class PatientService extends BaseService {
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_patientLabResultOrdersList = []; _patientLabResultOrdersList = [];
response['List_GetLabOreders'].forEach((v) { response['List_GetLabOreders'].forEach((v) {
_patientLabResultOrdersList.add(new LabOrdersResModel.fromJson(v)); _patientLabResultOrdersList.add(LabOrdersResModel.fromJson(v));
}); });
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
@ -242,8 +231,7 @@ class PatientService extends BaseService {
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_prescriptionReportForInPatientList = []; _prescriptionReportForInPatientList = [];
response['List_PrescriptionReportForInPatient'].forEach((v) { response['List_PrescriptionReportForInPatient'].forEach((v) {
prescriptionReportForInPatientList prescriptionReportForInPatientList.add(PrescriptionReportForInPatient.fromJson(v));
.add(PrescriptionReportForInPatient.fromJson(v));
}); });
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
@ -498,9 +486,7 @@ class PatientService extends BaseService {
); );
} }
Future getNursingProgressNote( Future getNursingProgressNote(GetNursingProgressNoteRequestModel getNursingProgressNoteRequestModel) async {
GetNursingProgressNoteRequestModel
getNursingProgressNoteRequestModel) async {
hasError = false; hasError = false;
await baseAppClient.post( await baseAppClient.post(
@ -508,8 +494,7 @@ class PatientService extends BaseService {
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_patientNursingProgressNoteList = []; _patientNursingProgressNoteList = [];
response['List_NursingProgressNote'].forEach((v) { response['List_NursingProgressNote'].forEach((v) {
_patientNursingProgressNoteList _patientNursingProgressNoteList.add(GetNursingProgressNoteResposeModel.fromJson(v));
.add(GetNursingProgressNoteResposeModel.fromJson(v));
}); });
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
@ -520,9 +505,7 @@ class PatientService extends BaseService {
); );
} }
Future getDiagnosisForInPatient( Future getDiagnosisForInPatient(GetDiagnosisForInPatientRequestModel getDiagnosisForInPatientRequestModel) async {
GetDiagnosisForInPatientRequestModel
getDiagnosisForInPatientRequestModel) async {
hasError = false; hasError = false;
await baseAppClient.post( await baseAppClient.post(
@ -530,8 +513,7 @@ class PatientService extends BaseService {
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_diagnosisForInPatientList = []; _diagnosisForInPatientList = [];
response['List_DiagnosisForInPatient'].forEach((v) { response['List_DiagnosisForInPatient'].forEach((v) {
_diagnosisForInPatientList _diagnosisForInPatientList.add(GetDiagnosisForInPatientResponseModel.fromJson(v));
.add(GetDiagnosisForInPatientResponseModel.fromJson(v));
}); });
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
@ -542,9 +524,7 @@ class PatientService extends BaseService {
); );
} }
Future getDiabeticChartValues( Future getDiabeticChartValues(GetDiabeticChartValuesRequestModel getDiabeticChartValuesRequestModel) async {
GetDiabeticChartValuesRequestModel
getDiabeticChartValuesRequestModel) async {
hasError = false; hasError = false;
await baseAppClient.post( await baseAppClient.post(
@ -552,8 +532,7 @@ class PatientService extends BaseService {
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_diabeticChartValuesList = []; _diabeticChartValuesList = [];
response['List_DiabeticChartValues'].forEach((v) { response['List_DiabeticChartValues'].forEach((v) {
_diabeticChartValuesList _diabeticChartValuesList.add(GetDiabeticChartValuesResponseModel.fromJson(v));
.add(GetDiabeticChartValuesResponseModel.fromJson(v));
}); });
}, },
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
@ -564,8 +543,7 @@ class PatientService extends BaseService {
); );
} }
Future getStpMasterList( Future getStpMasterList(StpMasterListRequestModel stpMasterListRequestModel) async {
StpMasterListRequestModel stpMasterListRequestModel) async {
hasError = false; hasError = false;
await baseAppClient.post( await baseAppClient.post(

@ -142,10 +142,6 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Busy); setState(ViewState.Busy);
} else } else
setState(ViewState.Busy); setState(ViewState.Busy);
//else
// setState(ViewState.Busy);
await _SOAPService.getMasterLookup(masterKeys, searchKey: searchKey); await _SOAPService.getMasterLookup(masterKeys, searchKey: searchKey);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
error = _SOAPService.error; error = _SOAPService.error;
@ -259,7 +255,7 @@ class SOAPViewModel extends BaseViewModel {
return allergiesString; return allergiesString;
} }
Future getPatientPhysicalExam(PatiantInformtion patientInfo, {required bool allowSetState}) async { Future getPatientPhysicalExam(PatiantInformtion patientInfo) async {
GetPhysicalExamReqModel getPhysicalExamReqModel = GetPhysicalExamReqModel( GetPhysicalExamReqModel getPhysicalExamReqModel = GetPhysicalExamReqModel(
patientMRN: patientInfo.patientMRN, patientMRN: patientInfo.patientMRN,
episodeID: patientInfo.episodeNo == null ? "0" : patientInfo.episodeNo.toString(), episodeID: patientInfo.episodeNo == null ? "0" : patientInfo.episodeNo.toString(),
@ -273,12 +269,13 @@ class SOAPViewModel extends BaseViewModel {
getPhysicalExamReqModel.admissionNo = int.parse(patientInfo.admissionNo!); getPhysicalExamReqModel.admissionNo = int.parse(patientInfo.admissionNo!);
else else
getPhysicalExamReqModel.admissionNo = 0; getPhysicalExamReqModel.admissionNo = 0;
if (allowSetState) setState(ViewState.Busy); setState(ViewState.Busy);
await _SOAPService.getPatientPhysicalExam(getPhysicalExamReqModel); await _SOAPService.getPatientPhysicalExam(getPhysicalExamReqModel);
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
error = _SOAPService.error; error = _SOAPService.error;
if (allowSetState) setState(ViewState.Error); setState(ViewState.Error);
} else if (allowSetState) setState(ViewState.Idle); } else
setState(ViewState.Idle);
} }
Future getPatientProgressNote(GetProgressNoteReqModel getGetProgressNoteReqModel) async { Future getPatientProgressNote(GetProgressNoteReqModel getGetProgressNoteReqModel) async {
@ -520,8 +517,8 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future onAddMedicationStart({required bool allowSetState}) async { Future onAddMedicationStart() async {
if (allowSetState) setState(ViewState.Busy); setState(ViewState.Busy);
List services = []; List services = [];
if (medicationStrengthList.length == 0) { if (medicationStrengthList.length == 0) {
if (services.isEmpty) { if (services.isEmpty) {
@ -563,8 +560,12 @@ class SOAPViewModel extends BaseViewModel {
if (_SOAPService.hasError || _prescriptionService.hasError) { if (_SOAPService.hasError || _prescriptionService.hasError) {
error = _SOAPService.error.toString() + _prescriptionService.error.toString(); error = _SOAPService.error.toString() + _prescriptionService.error.toString();
if (allowSetState) setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else if (allowSetState) setState(ViewState.Idle); } else {
setState(
ViewState.Idle,
);
}
} }
callAddAssessmentLookupsServices({String searchKey = "", bool allowSetState = true}) async { callAddAssessmentLookupsServices({String searchKey = "", bool allowSetState = true}) async {

@ -7,9 +7,11 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dart';
import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_custom_serach.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_custom_serach.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';

@ -1,5 +1,4 @@
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
@ -29,7 +28,7 @@ class _AddExaminationPageState extends State<AddExaminationPage> {
@override @override
initState() { initState() {
super.initState(); super.initState();
mySelectedExaminationLocal = [...?widget.mySelectedExamination]; mySelectedExaminationLocal = widget.mySelectedExamination!;
} }
@override @override
@ -37,9 +36,11 @@ class _AddExaminationPageState extends State<AddExaminationPage> {
return BaseView<SOAPViewModel>( return BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
if (model.physicalExaminationList.length == 0) { if (model.physicalExaminationList.length == 0) {
await model.getMasterLookup( WidgetsBinding.instance.addPostFrameCallback((_) async {
MasterKeysService.PhysicalExamination, await model.getMasterLookup(
); MasterKeysService.PhysicalExamination,
);
});
} }
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
@ -71,7 +72,7 @@ class _AddExaminationPageState extends State<AddExaminationPage> {
child: Column( child: Column(
children: [ children: [
ExaminationsListSearchWidget( ExaminationsListSearchWidget(
mySelectedExamination: widget.mySelectedExamination!, mySelectedExamination: widget.mySelectedExamination,
masterList: model.physicalExaminationList, masterList: model.physicalExaminationList,
isServiceSelected: (master) => isServiceSelected(master), isServiceSelected: (master) => isServiceSelected(master),
removeExamination: (selectedExamination) { removeExamination: (selectedExamination) {
@ -93,23 +94,27 @@ class _AddExaminationPageState extends State<AddExaminationPage> {
), ),
], ],
), ),
bottomSheet: model.state != ViewState.Idle bottomSheet:
? Container(
height: 0, // model.state != ViewState.Idle
) // ? Container(
: CustomBottomSheetContainer( // height: 10,
label: "${TranslationBase.of(context).addExamination}", // color: Colors.red,
onTap: () { // )
widget.addSelectedExamination(mySelectedExaminationLocal); // :
},
), CustomBottomSheetContainer(
label: "${TranslationBase.of(context).addExamination}",
onTap: () {
widget.addSelectedExamination(mySelectedExaminationLocal);
},
),
)); ));
} }
isServiceSelected(MasterKeyModel masterKey) { isServiceSelected(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> exam = mySelectedExaminationLocal.where((element) => masterKey.id == element.selectedExamination!.id && masterKey.typeId == element.selectedExamination!.typeId); Iterable<MySelectedExamination> exam = mySelectedExaminationLocal.where((element) => masterKey.id == element.selectedExamination!.id && masterKey.typeId == element.selectedExamination!.typeId);
if (exam.length > 0) { if (exam.length > 0) {
print("--------------");
return true; return true;
} }
return false; return false;

@ -23,12 +23,12 @@ class ExaminationsListSearchWidget extends StatefulWidget {
class _ExaminationsListSearchWidgetState extends State<ExaminationsListSearchWidget> { class _ExaminationsListSearchWidgetState extends State<ExaminationsListSearchWidget> {
int expandedIndex = -1; int expandedIndex = -1;
List<MasterKeyModel> items = []; List<MasterKeyModel>? items = [];
TextEditingController filteredSearchController = TextEditingController(); TextEditingController filteredSearchController = TextEditingController();
@override @override
void initState() { void initState() {
items.addAll(widget.masterList as Iterable<MasterKeyModel>); items!.addAll(widget.masterList!);
super.initState(); super.initState();
} }
@ -58,7 +58,7 @@ class _ExaminationsListSearchWidgetState extends State<ExaminationsListSearchWid
DividerWithSpacesAround( DividerWithSpacesAround(
height: 2, height: 2,
), ),
...items.mapIndexed((index, item) { ...items!.mapIndexed((index, item) {
return AddExaminationWidget( return AddExaminationWidget(
item: item, item: item,
addExamination: widget.addExamination, addExamination: widget.addExamination,
@ -92,14 +92,14 @@ class _ExaminationsListSearchWidgetState extends State<ExaminationsListSearchWid
} }
}); });
setState(() { setState(() {
items.clear(); items!.clear();
items.addAll(dummyListData); items!.addAll(dummyListData);
}); });
return; return;
} else { } else {
setState(() { setState(() {
items.clear(); items!.clear();
items.addAll(widget.masterList as Iterable<MasterKeyModel>); items!.addAll(widget.masterList as Iterable<MasterKeyModel>);
}); });
} }
} }

@ -60,7 +60,7 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
model.setObjectiveCallBack(this); model.setObjectiveCallBack(this);
mySelectedExamination.clear(); mySelectedExamination.clear();
model.isAddExamInProgress = true; model.isAddExamInProgress = true;
await model.getPatientPhysicalExam(widget.patientInfo, allowSetState: false); await model.getPatientPhysicalExam(widget.patientInfo);
if (model.patientPhysicalExamList.isNotEmpty) { if (model.patientPhysicalExamList.isNotEmpty) {
if (model.physicalExaminationList.length == 0) { if (model.physicalExaminationList.length == 0) {
await model.getMasterLookup(MasterKeysService.PhysicalExamination); await model.getMasterLookup(MasterKeysService.PhysicalExamination);
@ -273,28 +273,25 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> implements Ob
page: AddExaminationPage( page: AddExaminationPage(
mySelectedExamination: mySelectedExamination, mySelectedExamination: mySelectedExamination,
addSelectedExamination: (List<MySelectedExamination> mySelectedExaminationLocal) { addSelectedExamination: (List<MySelectedExamination> mySelectedExaminationLocal) {
setState(() { mySelectedExaminationLocal.forEach((element) {
{ if (mySelectedExamination.singleWhere((it) => it.selectedExamination!.id == element.selectedExamination!.id, orElse: () => MySelectedExamination()) == MySelectedExamination()) {
mySelectedExaminationLocal.forEach((element) { mySelectedExamination.insert(0, element);
if ((mySelectedExamination.singleWhere((it) => it.selectedExamination!.id == element.selectedExamination!.id, orElse: () => MySelectedExamination())) == null) { }
mySelectedExamination.insert(0, element); });
}
});
/// remove items.
List<MySelectedExamination> removedList = [];
mySelectedExamination.forEach((element) {
if ((mySelectedExaminationLocal.singleWhere((it) => it.selectedExamination!.id == element.selectedExamination!.id, orElse: () => MySelectedExamination())) == null) {
removedList.add(element);
}
});
removedList.forEach((element) { /// remove items.
removeExamination(element.selectedExamination!); List<MySelectedExamination> removedList = [];
}); mySelectedExamination.forEach((element) {
Navigator.of(context).pop(); if (mySelectedExaminationLocal.singleWhere((it) => it.selectedExamination!.id == element.selectedExamination!.id, orElse: () => MySelectedExamination()) == MySelectedExamination()) {
removedList.add(element);
} }
}); });
removedList.forEach((element) {
removeExamination(element.selectedExamination!);
});
Navigator.of(context).pop();
setState(() {});
}, },
removeExamination: (masterKey) => removeExamination(masterKey)), removeExamination: (masterKey) => removeExamination(masterKey)),
), ),

@ -54,7 +54,7 @@ class _AddMedicationState extends State<AddMedication> {
return FractionallySizedBox( return FractionallySizedBox(
child: BaseView<SOAPViewModel>( child: BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
model.onAddMedicationStart(allowSetState: false).whenComplete(() {}); model.onAddMedicationStart();
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,

@ -49,9 +49,7 @@ class _ShowTimerState extends State<ShowTimer> {
generateShowTimerString() { generateShowTimerString() {
DateTime now = DateTime.now(); DateTime now = DateTime.now();
DateTime liveCareDate = DateTime.parse(widget.patientInfo.arrivalTime!); DateTime liveCareDate = DateTime.parse(widget.patientInfo.arrivalTime!);
String timer = AppDateUtils.differenceBetweenDateAndCurrent( String timer = AppDateUtils.differenceBetweenDateAndCurrent(liveCareDate, context, isShowSecond: true, isShowDays: false);
liveCareDate, context,
isShowSecond: true, isShowDays: false);
return timer; return timer;
} }

@ -3,22 +3,19 @@ import 'package:flutter/material.dart';
class HeaderBodyExpandableNotifier extends StatefulWidget { class HeaderBodyExpandableNotifier extends StatefulWidget {
final Widget? headerWidget; final Widget? headerWidget;
final Widget? bodyWidget; final Widget bodyWidget;
final Widget? collapsed; final Widget? collapsed;
final bool isExpand; final bool isExpand;
bool expandFlag = false; bool expandFlag = false;
var controller = new ExpandableController(); var controller = ExpandableController();
HeaderBodyExpandableNotifier( HeaderBodyExpandableNotifier({this.headerWidget, required this.bodyWidget, this.collapsed, this.isExpand = false});
{this.headerWidget, this.bodyWidget, this.collapsed, this.isExpand = false});
@override @override
_HeaderBodyExpandableNotifierState createState() => _HeaderBodyExpandableNotifierState createState() => _HeaderBodyExpandableNotifierState();
_HeaderBodyExpandableNotifierState();
} }
class _HeaderBodyExpandableNotifierState class _HeaderBodyExpandableNotifierState extends State<HeaderBodyExpandableNotifier> {
extends State<HeaderBodyExpandableNotifier> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -50,7 +47,7 @@ class _HeaderBodyExpandableNotifierState
), ),
// header: widget.headerWidget, // header: widget.headerWidget,
collapsed: Container(), collapsed: Container(),
expanded: widget.bodyWidget!, expanded: widget.bodyWidget,
builder: (_, collapsed, expanded) { builder: (_, collapsed, expanded) {
return Padding( return Padding(
padding: EdgeInsets.only(left: 0, right: 0, bottom: 0), padding: EdgeInsets.only(left: 0, right: 0, bottom: 0),

Loading…
Cancel
Save