first step in vital sign and fix some thing in master
parent
8ca37c6b34
commit
691e7dbac6
@ -0,0 +1,104 @@
|
||||
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
|
||||
import 'package:doctor_app_flutter/models/patient_model.dart';
|
||||
import 'package:doctor_app_flutter/providers/patients_provider.dart';
|
||||
import 'package:doctor_app_flutter/routes.dart';
|
||||
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../../../widgets/shared/app_scaffold_widget.dart';
|
||||
import '../../../../widgets/shared/card_with_bg_widget.dart';
|
||||
|
||||
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
|
||||
|
||||
/*
|
||||
*@author: Elham Rababah
|
||||
*@Date:26/4/2020
|
||||
*@param:
|
||||
*@return:VitalSignScreen
|
||||
*@desc: VitalSignScreen class
|
||||
*/
|
||||
class VitalSignScreen extends StatefulWidget {
|
||||
@override
|
||||
_VitalSignScreenState createState() => _VitalSignScreenState();
|
||||
}
|
||||
|
||||
class _VitalSignScreenState extends State<VitalSignScreen> {
|
||||
List<String> litems = [
|
||||
"1",
|
||||
"1",
|
||||
"1",
|
||||
];
|
||||
|
||||
var _isLoading = true;
|
||||
var _hasError;
|
||||
var _isInit = true;
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
||||
var patient = routeArgs['patient'];
|
||||
print(patient);
|
||||
// String patientType = routeArgs['selectedType'];
|
||||
// print(patientType);
|
||||
sharedPref.getString(TOKEN).then((token) {
|
||||
print(token);
|
||||
var model = {
|
||||
"PatientID": patient['PatientID'],
|
||||
"ProjectID": patient['ProjectID'],
|
||||
"PatientTypeID": patient['PatientType'],
|
||||
"InOutPatientType": 1,
|
||||
"TransNo":patient['AdmissionNo'] !=null ? int.parse(patient['AdmissionNo']) : 0,
|
||||
"LanguageID": 2,
|
||||
"stamp": "2020-04-26T09:32:18.317Z",
|
||||
"IPAdress": "11.11.11.11",
|
||||
"VersionID": 1.2,
|
||||
"Channel": 9,
|
||||
"TokenID": token,
|
||||
"SessionID": "E2bsEeYEJo",
|
||||
"IsLoginForDoctorApp": true,
|
||||
"PatientOutSA": false
|
||||
};
|
||||
if (_isInit) {
|
||||
PatientsProvider patientsProv = Provider.of<PatientsProvider>(context);
|
||||
patientsProv.getPatientVitalSign(model).then((res) {
|
||||
print('wwww');
|
||||
debugPrint("${res}");
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
_hasError = res['ErrorEndUserMessage'];
|
||||
});
|
||||
print(res);
|
||||
}).catchError((error) {
|
||||
print(error);
|
||||
});
|
||||
}
|
||||
_isInit = false;
|
||||
});
|
||||
|
||||
super.didChangeDependencies();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
appBarTitle: "VITAL SIGN",
|
||||
body: Container(
|
||||
child: Column(
|
||||
children: litems.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…
Reference in New Issue