finish patient provider

merge-requests/33/head
Elham Rababah 5 years ago
parent 5e7526f2c7
commit de683cb11c

@ -99,6 +99,7 @@ class PatientsProvider with ChangeNotifier {
isError = true;
error = 'Please Check The Internet Connection';
}
notifyListeners();
} catch (error) {
throw error;
}

@ -62,6 +62,7 @@ class ScheduleProvider with ChangeNotifier {
isError = true;
error = 'Please Check The Internet Connection';
}
print('Heeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeer');
notifyListeners();
} catch (error) {
throw error;

@ -67,7 +67,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
sharedPref.getString(TOKEN).then((token) {
print(token+"EEEEEE");
_patientSearchFormValues.TokenID = token;
_patientSearchFormValues.TokenID = '@dm!n';
_patientSearchFormValues.ProjectID= 15;
// print(_patientSearchFormValues.PatientMobileNumber+"dfdfdfddf");
Navigator.of(context).pushNamed(PATIENTS, arguments: {

@ -20,44 +20,57 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
*@return:VitalSignScreen
*@desc: VitalSignScreen class
*/
class VitalSignScreen extends StatefulWidget {
@override
_VitalSignScreenState createState() => _VitalSignScreenState();
}
class _VitalSignScreenState extends State<VitalSignScreen> {
List<String> litems = [
"1",
"1",
"1",
];
PatientsProvider patientsProv;
var _isInit = true;
PatientsProvider getVitalSignList(context, PatientsProvider patientsProv) {
/*
*@author: Elham Rababah
*@Date:28/4/2020
*@param: context
*@return:
*@desc: getVitalSignList Function
*/
getVitalSignList(context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
sharedPref.getString(TOKEN).then((token) {
VitalSignReqModel vitalSignReqModel = VitalSignReqModel(
patientID: patient.patientId,
projectID: patient.projectId,
tokenID: token,
tokenID: '@dm!n',
patientTypeID: patient.patientType,
inOutpatientType: 1,
languageID: 2,
transNo:
patient.admissionNo != null ? int.parse(patient.admissionNo) : 0);
patientsProv.getPatientVitalSign(vitalSignReqModel.toJson());
return patientsProv;
});
}
@override
Widget build(BuildContext context) {
PatientsProvider patientsProv = Provider.of<PatientsProvider>(context);
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
patientsProv = Provider.of<PatientsProvider>(context);
getVitalSignList(context);
}
_isInit = false;
}
getVitalSignList(context, patientsProv);
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: "VITAL SIGN",
body: patientsProv.isLoading?DrAppCircularProgressIndeicator():patientsProv.isError
body: patientsProv.isLoading
? DrAppCircularProgressIndeicator()
: patientsProv.isError
? Center(
child: Text(
patientsProv.error,
@ -71,22 +84,22 @@ class _VitalSignScreenState extends State<VitalSignScreen> {
style: TextStyle(color: Theme.of(context).errorColor),
),
)
:Container(
child: Column(
children: patientsProv.patientVitalSignList.map((item) {
return InkWell(
child: CardWithBgWidget(
line1Text: 'Fahad AlSlehm - 324599',
line2Text: '12/04/2020 - 02:00 PM',
heightPercentage: 0.15,
widthPercentage: 0.80),
onTap: () {
Navigator.of(context).pushNamed(VITAL_SIGN);
},
);
}).toList(),
),
),
: Container(
child: Column(
children: patientsProv.patientVitalSignList.map((item) {
return InkWell(
child: CardWithBgWidget(
line1Text: 'Fahad AlSlehm - 324599',
line2Text: '12/04/2020 - 02:00 PM',
heightPercentage: 0.15,
widthPercentage: 0.80),
onTap: () {
Navigator.of(context).pushNamed(VITAL_SIGN);
},
);
}).toList(),
),
),
);
}
}

Loading…
Cancel
Save