Null Safety Fixes

update_flutter_3.16.0_voipcall
Aamir Muhammad 2 years ago
parent e1604b09f8
commit 693d352669

@ -137,7 +137,7 @@ class SOAPViewModel extends BaseViewModel {
planCallBack.nextFunction(model); planCallBack.nextFunction(model);
} }
Future getMasterLookup(MasterKeysService masterKeys, {bool isBusyLocal = false, String searchKey = ""}) async { Future getMasterLookup(MasterKeysService masterKeys, {bool isBusyLocal = false, String searchKey = "", bool allowSetState = false}) async {
if (isBusyLocal) { if (isBusyLocal) {
setState(ViewState.Busy); setState(ViewState.Busy);
} else { } else {

@ -25,7 +25,7 @@ class BaseViewModel extends ChangeNotifier {
Future<DoctorProfileModel> getDoctorProfile({bool isGetProfile = false}) async { Future<DoctorProfileModel> getDoctorProfile({bool isGetProfile = false}) async {
if (isGetProfile) { if (isGetProfile) {
Map<String, dynamic> profile = await sharedPref.getObj(DOCTOR_PROFILE); Map<String, dynamic>? profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (profile != null) { if (profile != null) {
doctorProfile = DoctorProfileModel.fromJson(profile); doctorProfile = DoctorProfileModel.fromJson(profile);
if (doctorProfile != null) { if (doctorProfile != null) {

@ -30,7 +30,7 @@ class PatientReferralViewModel extends BaseViewModel {
List<dynamic>? get branchesList => _referralPatientService.projectsList; List<dynamic>? get branchesList => _referralPatientService.projectsList;
List<dynamic> get clinicsList => _referralPatientService.clinicsList; List<dynamic>? get clinicsList => _referralPatientService.clinicsList;
List<dynamic> get referralFrequencyList => _referralPatientService.frequencyList; List<dynamic> get referralFrequencyList => _referralPatientService.frequencyList;

@ -99,6 +99,7 @@ class _PatientsSearchResultScreenState extends State<PatientsSearchResultScreen>
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemCount: model.filterData.length, itemCount: model.filterData.length,
padding: EdgeInsets.zero,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
return Padding( return Padding(
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
@ -109,11 +110,6 @@ class _PatientsSearchResultScreenState extends State<PatientsSearchResultScreen>
isFromSearch: widget.isSearchAndOut, isFromSearch: widget.isSearchAndOut,
isInpatient: widget.isInpatient, isInpatient: widget.isInpatient,
onTap: () { onTap: () {
print("TODO change the parameter to daynamic");
print("TODO change the parameter to daynamic");
print("TODO change the parameter to daynamic");
print("TODO change the parameter to daynamic");
print("TODO change the parameter to daynamic");
// TODO change the parameter to daynamic // TODO change the parameter to daynamic
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": model.filterData[index], "patient": model.filterData[index],

@ -1,10 +1,10 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteRequestModel.dart'; import 'package:doctor_app_flutter/core/model/note/GetNursingProgressNoteRequestModel.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/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.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/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart';
@ -33,19 +33,17 @@ class _ProgressNoteState extends State<NursingProgressNoteScreen> {
AuthenticationViewModel authenticationViewModel = AuthenticationViewModel(); AuthenticationViewModel authenticationViewModel = AuthenticationViewModel();
late ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
getProgressNoteList(BuildContext context, PatientViewModel model, getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async {
{bool isLocalBusy = false}) async {
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); String? type = await sharedPref.getString(SLECTED_PATIENT_TYPE);
print(type); print(type);
GetNursingProgressNoteRequestModel getNursingProgressNoteRequestModel = GetNursingProgressNoteRequestModel getNursingProgressNoteRequestModel = GetNursingProgressNoteRequestModel(
GetNursingProgressNoteRequestModel( admissionNo: int.parse(patient.admissionNo!),
admissionNo: int.parse(patient.admissionNo!), patientTypeID: patient.patientType,
patientTypeID: patient.patientType, patientID: patient.patientId,
patientID: patient.patientId, );
);
model.getNursingProgressNote(getNursingProgressNoteRequestModel); model.getNursingProgressNote(getNursingProgressNoteRequestModel);
} }
@ -55,8 +53,7 @@ class _ProgressNoteState extends State<NursingProgressNoteScreen> {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
if (routeArgs.containsKey('isDischargedPatient')) if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient'];
isDischargedPatient = routeArgs['isDischargedPatient'];
return BaseView<PatientViewModel>( return BaseView<PatientViewModel>(
onModelReady: (model) => getProgressNoteList(context, model), onModelReady: (model) => getProgressNoteList(context, model),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
@ -67,8 +64,7 @@ class _ProgressNoteState extends State<NursingProgressNoteScreen> {
patient, patient,
isInpatient: true, isInpatient: true,
), ),
body: model.patientNursingProgressNoteList == null || body: model.patientNursingProgressNoteList == null || model.patientNursingProgressNoteList.length == 0
model.patientNursingProgressNoteList.length == 0
? Center( ? Center(
child: ErrorMessage( child: ErrorMessage(
error: TranslationBase.of(context).noDataAvailable, error: TranslationBase.of(context).noDataAvailable,
@ -81,8 +77,7 @@ class _ProgressNoteState extends State<NursingProgressNoteScreen> {
Expanded( Expanded(
child: Container( child: Container(
child: ListView.builder( child: ListView.builder(
itemCount: itemCount: model.patientNursingProgressNoteList.length,
model.patientNursingProgressNoteList.length,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
return FractionallySizedBox( return FractionallySizedBox(
widthFactor: 0.95, widthFactor: 0.95,
@ -92,48 +87,31 @@ class _ProgressNoteState extends State<NursingProgressNoteScreen> {
widget: Column( widget: Column(
children: [ children: [
Column( Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Container( Container(
width: MediaQuery.of(context) width: MediaQuery.of(context).size.width * 0.60,
.size
.width *
0.60,
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Row( Row(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment
.start,
children: [ children: [
AppText( AppText(
TranslationBase.of( TranslationBase.of(context).createdBy,
context)
.createdBy,
fontSize: 10, fontSize: 10,
), ),
Expanded( Expanded(
child: AppText( child: AppText(
model model.patientNursingProgressNoteList[index].createdByName.toString() ?? '',
.patientNursingProgressNoteList[ fontWeight: FontWeight.w600,
index]
.createdByName
.toString() ??
'',
fontWeight:
FontWeight.w600,
fontSize: 12, fontSize: 12,
isCopyable: true, isCopyable: true,
), ),
@ -146,73 +124,39 @@ class _ProgressNoteState extends State<NursingProgressNoteScreen> {
Column( Column(
children: [ children: [
AppText( AppText(
model model.patientNursingProgressNoteList[index].createdOn != null
.patientNursingProgressNoteList[ ? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.patientNursingProgressNoteList[index].createdOn!),
index] isArabic: projectViewModel.isArabic, isMonthShort: true)
.createdOn != : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), isArabic: projectViewModel.isArabic),
null
? AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils
.getDateTimeFromServerFormat(model
.patientNursingProgressNoteList[
index]
.createdOn!),
isArabic:
projectViewModel
.isArabic,
isMonthShort: true)
: AppDateUtils
.getDayMonthYearDateFormatted(
DateTime.now(),
isArabic:
projectViewModel
.isArabic),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 14,
isCopyable: true, isCopyable: true,
), ),
AppText( AppText(
model model.patientNursingProgressNoteList[index].createdOn != null
.patientNursingProgressNoteList[ ? AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(model.patientNursingProgressNoteList[index].createdOn!))
index] : AppDateUtils.getHour(DateTime.now()),
.createdOn !=
null
? AppDateUtils.getHour(
AppDateUtils
.getDateTimeFromServerFormat(model
.patientNursingProgressNoteList[
index]
.createdOn!))
: AppDateUtils.getHour(
DateTime.now()),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 14, fontSize: 14,
isCopyable: true, isCopyable: true,
), ),
], ],
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.end,
CrossAxisAlignment.end,
) )
], ],
), ),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Row( Row(mainAxisAlignment: MainAxisAlignment.start, children: [
mainAxisAlignment: Expanded(
MainAxisAlignment.start, child: AppText(
children: [ model.patientNursingProgressNoteList[index].notes!,
Expanded( fontSize: 10,
child: AppText( isCopyable: true,
model ),
.patientNursingProgressNoteList[ ),
index] ])
.notes!,
fontSize: 10,
isCopyable: true,
),
),
])
], ],
), ),
SizedBox( SizedBox(

@ -167,8 +167,7 @@ class ProfileGridForSearch extends StatelessWidget {
isInPatient: item.isInPatient, isInPatient: item.isInPatient,
isDischargedPatient: item.isDischargedPatient, isDischargedPatient: item.isDischargedPatient,
isDisable: item.isDisable, isDisable: item.isDisable,
onTap: () {}, onTap: item.onTap,
//item.onTap(),
isLoading: item.isLoading, isLoading: item.isLoading,
); );
}).toList(), }).toList(),

@ -279,10 +279,10 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
enabled: false, enabled: false,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
validationError: clinicError, validationError: clinicError,
onClick: _selectedBranch != null && model.clinicsList != null && model.clinicsList.length > 0 onClick: _selectedBranch != null && model.clinicsList != null && model.clinicsList!.length > 0
? () { ? () {
ListSelectDialog dialog = ListSelectDialog( ListSelectDialog dialog = ListSelectDialog(
list: model.clinicsList, list: model.clinicsList!,
attributeName: 'ClinicDescription', attributeName: 'ClinicDescription',
attributeValueId: 'ClinicID', attributeValueId: 'ClinicID',
usingSearch: true, usingSearch: true,

@ -264,10 +264,10 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
enabled: false, enabled: false,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
validationError: clinicError, validationError: clinicError,
onClick: _selectedBranch != null && model.clinicsList != null && model.clinicsList.length > 0 onClick: _selectedBranch != null && model.clinicsList != null && model.clinicsList!.length > 0
? () { ? () {
ListSelectDialog dialog = ListSelectDialog( ListSelectDialog dialog = ListSelectDialog(
list: model.clinicsList, list: model.clinicsList!,
attributeName: 'ClinicDescription', attributeName: 'ClinicDescription',
attributeValueId: 'ClinicID', attributeValueId: 'ClinicID',
usingSearch: true, usingSearch: true,

@ -26,7 +26,7 @@ class NewPrescriptionsPage extends StatelessWidget {
bool isFromLiveCare = routeArgs['isFromLiveCare']; bool isFromLiveCare = routeArgs['isFromLiveCare'];
return BaseView<PrescriptionViewModel>( return BaseView<PrescriptionViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
model.getPrescriptionListNew(mrn: patient.patientMRN, appNo: patient.appointmentNo); model.getPrescriptionListNew(mrn: patient.patientMRN, appNo: patient.appointmentNo ?? 0);
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,

@ -56,8 +56,8 @@ class PatientCard extends StatelessWidget {
decoration: Utils.getCardBoxDecoration(), decoration: Utils.getCardBoxDecoration(),
child: CardWithBgWidget( child: CardWithBgWidget(
padding: 0, padding: 0,
marginLeft: (!isMyPatient && isInpatient) || isFromLiveCare ? 0 : 10, marginLeft: (!isMyPatient && isInpatient) || isFromLiveCare ? 0 : 0,
marginSymmetric: isFromSearch ? 10 : 0.0, marginSymmetric: isFromSearch ? 0 : 0.0,
hasBorder: false, hasBorder: false,
bgColor: isFromLiveCare bgColor: isFromLiveCare
? Colors.white ? Colors.white
@ -292,7 +292,7 @@ class PatientCard extends StatelessWidget {
), ),
Row(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Row(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
Padding( Padding(
padding: EdgeInsets.only(left: 12.0, top: 5), padding: EdgeInsets.only(left: 12.0, top: 5, bottom: 10),
child: Container( child: Container(
width: 60, width: 60,
height: 60, height: 60,

Loading…
Cancel
Save