You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
169 lines
7.0 KiB
Dart
169 lines
7.0 KiB
Dart
import 'package:doctor_app_flutter/config/size_config.dart';
|
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
|
import 'package:doctor_app_flutter/models/patient/radiology_req_model.dart';
|
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:provider/provider.dart';
|
|
|
|
import '../../../../config/shared_pref_kay.dart';
|
|
import '../../../../models/patient/vital_sign_req_model.dart';
|
|
import '../../../../providers/patients_provider.dart';
|
|
|
|
import '../../../../util/dr_app_shared_pref.dart';
|
|
import '../../../../widgets/shared/app_scaffold_widget.dart';
|
|
import '../../../../widgets/shared/card_with_bg_widget.dart';
|
|
import '../../../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
|
|
|
|
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
|
|
|
|
/*
|
|
*@author: Elham Rababah
|
|
*@Date:26/4/2020
|
|
*@param:
|
|
*@return:RadiologyScreen
|
|
*@desc: RadiologyScreen class
|
|
*/
|
|
|
|
class RadiologyScreen extends StatefulWidget {
|
|
@override
|
|
_RadiologyScreenState createState() => _RadiologyScreenState();
|
|
}
|
|
|
|
class _RadiologyScreenState extends State<RadiologyScreen> {
|
|
PatientsProvider patientsProv;
|
|
var _isInit = true;
|
|
|
|
/*
|
|
*@author: Elham Rababah
|
|
*@Date:28/4/2020
|
|
*@param: context
|
|
*@return:
|
|
*@desc: getRadiologyList Function
|
|
*/
|
|
getRadiologyList(context) async {
|
|
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
|
PatiantInformtion patient = routeArgs['patient'];
|
|
String token = await sharedPref.getString(TOKEN);
|
|
String type = await sharedPref.getString(SLECTED_PATIENT_TYPE);
|
|
int inOutpatientType = 1;
|
|
if (type == '0') {
|
|
inOutpatientType = 2;
|
|
}
|
|
print(type);
|
|
RadiologyReqModel radiologyReqModel = RadiologyReqModel(
|
|
patientID: patient.patientId,
|
|
projectID: patient.projectId,
|
|
tokenID: token,
|
|
patientTypeID: patient.patientType,
|
|
languageID: 2,
|
|
);
|
|
patientsProv.getPatientRadiology(radiologyReqModel.toJson());
|
|
}
|
|
|
|
@override
|
|
void didChangeDependencies() {
|
|
super.didChangeDependencies();
|
|
if (_isInit) {
|
|
patientsProv = Provider.of<PatientsProvider>(context);
|
|
getRadiologyList(context);
|
|
}
|
|
_isInit = false;
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return AppScaffold(
|
|
appBarTitle: "Radiology",
|
|
showAppDrawer: false,
|
|
showBottomBar: false,
|
|
body: patientsProv.isLoading
|
|
? DrAppCircularProgressIndeicator()
|
|
: patientsProv.isError
|
|
? Center(
|
|
child: Text(
|
|
patientsProv.error,
|
|
style: TextStyle(color: Theme.of(context).errorColor),
|
|
),
|
|
)
|
|
: patientsProv.patientRadiologyList.length == 0
|
|
? Center(
|
|
child: Text(
|
|
'You don\'t have any Vital Sign',
|
|
style: TextStyle(color: Theme.of(context).errorColor),
|
|
),
|
|
)
|
|
: Container(
|
|
margin: EdgeInsets.fromLTRB(
|
|
SizeConfig.realScreenWidth * 0.05,
|
|
0,
|
|
SizeConfig.realScreenWidth * 0.05,
|
|
0),
|
|
child: ListView.builder(
|
|
itemCount: patientsProv.patientRadiologyList.length,
|
|
itemBuilder: (BuildContext ctxt, int index) {
|
|
return InkWell(
|
|
child: CardWithBgWidget(
|
|
widget: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: <Widget>[
|
|
Row(
|
|
children: <Widget>[
|
|
CircleAvatar(
|
|
radius:
|
|
SizeConfig.imageSizeMultiplier *
|
|
12,
|
|
backgroundImage: NetworkImage(
|
|
patientsProv
|
|
.patientRadiologyList[index]
|
|
.doctorImageURL),
|
|
backgroundColor: Colors.transparent,
|
|
),
|
|
Expanded(
|
|
child: Padding(
|
|
padding: const EdgeInsets.fromLTRB(
|
|
8, 0, 0, 0),
|
|
child: Column(
|
|
crossAxisAlignment:
|
|
CrossAxisAlignment.start,
|
|
children: <Widget>[
|
|
AppText(
|
|
'${patientsProv.patientRadiologyList[index].doctorName}',
|
|
fontSize: 2.5 *
|
|
SizeConfig.textMultiplier,
|
|
),
|
|
SizedBox(
|
|
height: 8,
|
|
),
|
|
AppText(
|
|
'Invoice No:${patientsProv.patientRadiologyList[index].invoiceNo}',
|
|
fontSize: 2.5 *
|
|
SizeConfig.textMultiplier,
|
|
),
|
|
SizedBox(
|
|
height: 8,
|
|
),
|
|
AppText(
|
|
' ${patientsProv.patientRadiologyList[index].clinicName}',
|
|
fontSize: 2.5 *
|
|
SizeConfig
|
|
.textMultiplier),
|
|
SizedBox(
|
|
height: 8,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
)
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
onTap: () {},
|
|
);
|
|
}),
|
|
),
|
|
);
|
|
}
|
|
}
|