finish patient provider

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

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

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

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

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

Loading…
Cancel
Save