Null Safety

update_flutter_3.16.0_voipcall
Aamir Muhammad 2 years ago
parent c3ff456645
commit cb01308f96

@ -398,10 +398,10 @@ class AuthenticationViewModel extends BaseViewModel {
/// logout function
logout({bool isFromLogin = false}) async {
localToken = "";
String lang = await sharedPref.getString(APP_Language);
String? lang = await sharedPref.getString(APP_Language);
await Utils.clearSharedPref();
doctorProfile = null;
sharedPref.setString(APP_Language, lang);
sharedPref.setString(APP_Language, lang ?? 'en');
deleteUser();
await getDeviceInfoFromFirebase();
this.isFromLogin = isFromLogin;

@ -27,28 +27,20 @@ class PatientsSearchResultScreen extends StatefulWidget {
final String? searchKey;
PatientsSearchResultScreen(
{this.selectedPatientType,
this.patientSearchRequestModel,
this.isSearchWithKeyInfo = true,
this.isSearch = false,
this.isInpatient = false,
this.searchKey,
this.isSearchAndOut = false});
{this.selectedPatientType, this.patientSearchRequestModel, this.isSearchWithKeyInfo = true, this.isSearch = false, this.isInpatient = false, this.searchKey, this.isSearchAndOut = false});
@override
_PatientsSearchResultScreenState createState() =>
_PatientsSearchResultScreenState();
_PatientsSearchResultScreenState createState() => _PatientsSearchResultScreenState();
}
class _PatientsSearchResultScreenState
extends State<PatientsSearchResultScreen> {
class _PatientsSearchResultScreenState extends State<PatientsSearchResultScreen> {
int? clinicId;
AuthenticationViewModel authenticationViewModel = AuthenticationViewModel();
String? patientType;
String patientType = '';
String? patientTypeTitle;
var selectedFilter = 1;
String? arrivalType;
String arrivalType = '';
late ProjectViewModel projectsProvider;
var isView;
final _controller = TextEditingController();
@ -60,12 +52,10 @@ class _PatientsSearchResultScreenState
authenticationViewModel = Provider.of(context);
return BaseView<PatientSearchViewModel>(
onModelReady: (model) async {
if (!widget.isSearchWithKeyInfo &&
widget.selectedPatientType == PatientType.OutPatient) {
if (!widget.isSearchWithKeyInfo && widget.selectedPatientType == PatientType.OutPatient) {
await model.getOutPatient(widget.patientSearchRequestModel!);
} else {
await model
.getPatientFileInformation(widget.patientSearchRequestModel!);
await model.getPatientFileInformation(widget.patientSearchRequestModel!);
}
},
builder: (_, model, w) => AppScaffold(
@ -89,9 +79,10 @@ class _PatientsSearchResultScreenState
DoctorApp.filter_1,
color: Colors.black,
),
iconSize: 20, onPressed: () { },
iconSize: 20, onPressed: () {},
// padding: EdgeInsets.only(bottom: 30),
), onFieldSubmitted: (){},
),
onFieldSubmitted: () {},
),
SizedBox(
height: 10.0,
@ -101,8 +92,7 @@ class _PatientsSearchResultScreenState
child: model.filterData.isEmpty
? Center(
child: ErrorMessage(
error: TranslationBase.of(context)
.youDontHaveAnyPatient,
error: TranslationBase.of(context).youDontHaveAnyPatient,
),
)
: ListView.builder(
@ -114,27 +104,27 @@ class _PatientsSearchResultScreenState
padding: EdgeInsets.all(8.0),
child: PatientCard(
patientInfo: model.filterData[index],
patientType: patientType!,
arrivalType: arrivalType!,
patientType: patientType,
arrivalType: arrivalType,
isFromSearch: widget.isSearchAndOut,
isInpatient: widget.isInpatient,
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
Navigator.of(context).pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": model.filterData[index],
"patientType": "1",
"from": widget
.patientSearchRequestModel!.from,
"to": widget
.patientSearchRequestModel!.from,
"isSearch": widget.isSearch,
"isInpatient": widget.isInpatient,
"arrivalType": "7",
"isSearchAndOut":
widget.isSearchAndOut,
});
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": model.filterData[index],
"patientType": "1",
"from": widget.patientSearchRequestModel!.from,
"to": widget.patientSearchRequestModel!.from,
"isSearch": widget.isSearch,
"isInpatient": widget.isInpatient,
"arrivalType": "7",
"isSearchAndOut": widget.isSearchAndOut,
});
},
// isFromSearch: widget.isSearch,
),

@ -18,7 +18,7 @@ import 'ShowTimer.dart';
class PatientCard extends StatelessWidget {
final PatiantInformtion? patientInfo;
final Function()? onTap;
final Function() onTap;
final String patientType;
final String arrivalType;
final bool isInpatient;
@ -451,7 +451,7 @@ class PatientCard extends StatelessWidget {
: SizedBox()
],
),
onTap: onTap!(),
onTap: onTap,
)),
));
}

@ -63,7 +63,7 @@ class AppTextFieldCustomSearch extends StatelessWidget {
onChangeFun(val!);
},
onFieldSubmitted: () {
onFieldSubmitted();
onFieldSubmitted;
},
validationError: validationError,
onClick: () {},

Loading…
Cancel
Save