|
|
|
@ -7,6 +7,7 @@
|
|
|
|
|
*@desc:
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/config/config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/models/patient/patient_model.dart';
|
|
|
|
@ -14,23 +15,16 @@ import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/providers/patients_provider.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/providers/project_provider.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/routes.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget.dart';
|
|
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/profile_image_widget.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
import '../../config/size_config.dart';
|
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
|
|
|
|
|
|
import '../../widgets/shared/app_scaffold_widget.dart';
|
|
|
|
|
import '../../widgets/shared/card_with_bg_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/config/config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
|
|
|
|
|
|
class PatientsScreen extends StatefulWidget {
|
|
|
|
|
@override
|
|
|
|
@ -38,12 +32,12 @@ class PatientsScreen extends StatefulWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _PatientsScreenState extends State<PatientsScreen> {
|
|
|
|
|
List<dynamic> litems;
|
|
|
|
|
List<dynamic> lItems;
|
|
|
|
|
|
|
|
|
|
List parsed;
|
|
|
|
|
|
|
|
|
|
List date;
|
|
|
|
|
List unfilterDate;
|
|
|
|
|
List unFilterDate;
|
|
|
|
|
|
|
|
|
|
Color sideColor = Colors.black;
|
|
|
|
|
List<PatiantInformtion> responseModelList;
|
|
|
|
@ -60,7 +54,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
|
|
|
|
|
|
|
|
|
|
bool _isInit = true;
|
|
|
|
|
String patientType;
|
|
|
|
|
String patientTypetitle;
|
|
|
|
|
String patientTypeTitle;
|
|
|
|
|
var _isLoading = false;
|
|
|
|
|
|
|
|
|
|
bool _isError = true;
|
|
|
|
@ -83,9 +77,9 @@ class _PatientsScreenState extends State<PatientsScreen> {
|
|
|
|
|
patientType = routeArgs['selectedType'];
|
|
|
|
|
|
|
|
|
|
if (!projectsProvider.isArabic)
|
|
|
|
|
patientTypetitle = SERVICES_PATIANT_HEADER[int.parse(patientType)];
|
|
|
|
|
patientTypeTitle = SERVICES_PATIANT_HEADER[int.parse(patientType)];
|
|
|
|
|
else
|
|
|
|
|
patientTypetitle = SERVICES_PATIANT_HEADER_AR[int.parse(patientType)];
|
|
|
|
|
patientTypeTitle = SERVICES_PATIANT_HEADER_AR[int.parse(patientType)];
|
|
|
|
|
|
|
|
|
|
print(patientType);
|
|
|
|
|
|
|
|
|
@ -101,8 +95,8 @@ class _PatientsScreenState extends State<PatientsScreen> {
|
|
|
|
|
_isLoading = false;
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
int val2 = int.parse(patientType);
|
|
|
|
|
litems = res[SERVICES_PATIANT2[val2]];
|
|
|
|
|
parsed = litems;
|
|
|
|
|
lItems = res[SERVICES_PATIANT2[val2]];
|
|
|
|
|
parsed = lItems;
|
|
|
|
|
responseModelList = new ModelResponse.fromJson(parsed).list;
|
|
|
|
|
responseModelList2 = responseModelList;
|
|
|
|
|
_isError = false;
|
|
|
|
@ -314,12 +308,12 @@ class _PatientsScreenState extends State<PatientsScreen> {
|
|
|
|
|
PatientsProvider patientsProv = Provider.of<PatientsProvider>(context);
|
|
|
|
|
|
|
|
|
|
return AppScaffold(
|
|
|
|
|
appBarTitle: patientTypetitle,
|
|
|
|
|
appBarTitle: patientTypeTitle,
|
|
|
|
|
body: _isLoading
|
|
|
|
|
? DrAppCircularProgressIndeicator()
|
|
|
|
|
: _isError
|
|
|
|
|
? DrAppEmbeddedError(error: error)
|
|
|
|
|
: litems == null
|
|
|
|
|
: lItems == null || lItems.length == 0
|
|
|
|
|
? DrAppEmbeddedError(
|
|
|
|
|
error: TranslationBase.of(context).youDontHaveAnyPatient)
|
|
|
|
|
: Container(
|
|
|
|
@ -327,7 +321,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
|
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
child: litems == null
|
|
|
|
|
child: lItems == null
|
|
|
|
|
? Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
@ -373,71 +367,70 @@ class _PatientsScreenState extends State<PatientsScreen> {
|
|
|
|
|
height: 10.0,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
//===============
|
|
|
|
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Color(0Xffffffff),
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.circular(20)),
|
|
|
|
|
//================
|
|
|
|
|
margin:
|
|
|
|
|
EdgeInsets.fromLTRB(15, 0, 15, 0),
|
|
|
|
|
child: Column(
|
|
|
|
|
child: (responseModelList.length > 0)
|
|
|
|
|
? Column(
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: responseModelList
|
|
|
|
|
.map((PatiantInformtion item) {
|
|
|
|
|
return Container(
|
|
|
|
|
decoration: myBoxDecoration(),
|
|
|
|
|
child: InkWell(
|
|
|
|
|
child: CardWithBgWidgetNew(
|
|
|
|
|
//CardWithBgWidget(
|
|
|
|
|
|
|
|
|
|
widget: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
// decoration: myBoxDecoration(),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Column(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment
|
|
|
|
|
.start,
|
|
|
|
|
children: <
|
|
|
|
|
Widget>[
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
decoration:
|
|
|
|
|
BoxDecoration(
|
|
|
|
|
gradient: LinearGradient(
|
|
|
|
|
begin: Alignment(
|
|
|
|
|
begin:
|
|
|
|
|
Alignment(
|
|
|
|
|
-1,
|
|
|
|
|
-1),
|
|
|
|
|
end: Alignment(
|
|
|
|
|
1,
|
|
|
|
|
1),
|
|
|
|
|
end:
|
|
|
|
|
Alignment(
|
|
|
|
|
1, 1),
|
|
|
|
|
colors: [
|
|
|
|
|
Colors.grey[100],
|
|
|
|
|
Colors.grey[200],
|
|
|
|
|
Colors.grey[
|
|
|
|
|
100],
|
|
|
|
|
Colors.grey[
|
|
|
|
|
200],
|
|
|
|
|
]),
|
|
|
|
|
boxShadow: [
|
|
|
|
|
BoxShadow(
|
|
|
|
|
color: Color.fromRGBO(
|
|
|
|
|
color: Color
|
|
|
|
|
.fromRGBO(
|
|
|
|
|
0,
|
|
|
|
|
0,
|
|
|
|
|
0,
|
|
|
|
|
0.08),
|
|
|
|
|
offset: Offset(0.0,
|
|
|
|
|
offset:
|
|
|
|
|
Offset(
|
|
|
|
|
0.0,
|
|
|
|
|
5.0),
|
|
|
|
|
blurRadius:
|
|
|
|
|
16.0)
|
|
|
|
|
],
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.all(
|
|
|
|
|
Radius.circular(50.0)),
|
|
|
|
|
borderRadius: BorderRadius
|
|
|
|
|
.all(Radius
|
|
|
|
|
.circular(
|
|
|
|
|
50.0)),
|
|
|
|
|
),
|
|
|
|
|
width: 80,
|
|
|
|
|
height: 80,
|
|
|
|
|
child: Icon(
|
|
|
|
|
item.genderDescription ==
|
|
|
|
|
item
|
|
|
|
|
.genderDescription ==
|
|
|
|
|
"Male"
|
|
|
|
|
? DoctorApp
|
|
|
|
|
.male
|
|
|
|
@ -450,12 +443,15 @@ class _PatientsScreenState extends State<PatientsScreen> {
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 10,
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment
|
|
|
|
|
.start,
|
|
|
|
|
children: <
|
|
|
|
|
Widget>[
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 15,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
item.firstName +
|
|
|
|
|
" " +
|
|
|
|
@ -464,17 +460,16 @@ class _PatientsScreenState extends State<PatientsScreen> {
|
|
|
|
|
SizeConfig
|
|
|
|
|
.textMultiplier,
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight
|
|
|
|
|
.bold,
|
|
|
|
|
FontWeight.bold,
|
|
|
|
|
backGroundcolor:
|
|
|
|
|
Colors
|
|
|
|
|
.white,
|
|
|
|
|
Colors.white,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 8,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(
|
|
|
|
|
TranslationBase
|
|
|
|
|
.of(
|
|
|
|
|
context)
|
|
|
|
|
.fileNo +
|
|
|
|
|
item.patientId
|
|
|
|
@ -483,18 +478,13 @@ class _PatientsScreenState extends State<PatientsScreen> {
|
|
|
|
|
SizeConfig
|
|
|
|
|
.textMultiplier,
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight
|
|
|
|
|
.bold,
|
|
|
|
|
FontWeight.bold,
|
|
|
|
|
backGroundcolor:
|
|
|
|
|
Colors
|
|
|
|
|
.white,
|
|
|
|
|
Colors.white,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
// SizedBox(
|
|
|
|
|
// height: 8,
|
|
|
|
|
// ),
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(
|
|
|
|
|
TranslationBase
|
|
|
|
|
.of(
|
|
|
|
|
context)
|
|
|
|
|
.age +
|
|
|
|
|
item.age
|
|
|
|
@ -503,73 +493,92 @@ class _PatientsScreenState extends State<PatientsScreen> {
|
|
|
|
|
SizeConfig
|
|
|
|
|
.textMultiplier,
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight
|
|
|
|
|
.bold,
|
|
|
|
|
FontWeight.bold,
|
|
|
|
|
backGroundcolor:
|
|
|
|
|
Colors
|
|
|
|
|
.white,
|
|
|
|
|
Colors.white,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 8,
|
|
|
|
|
),
|
|
|
|
|
SERVICES_PATIANT2[
|
|
|
|
|
int.parse(patientType)] ==
|
|
|
|
|
int.parse(
|
|
|
|
|
patientType)] ==
|
|
|
|
|
"List_MyOutPatient"
|
|
|
|
|
? Row(
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
MainAxisAlignment
|
|
|
|
|
.spaceBetween,
|
|
|
|
|
children: <
|
|
|
|
|
Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
height:
|
|
|
|
|
20,
|
|
|
|
|
width:
|
|
|
|
|
80,
|
|
|
|
|
width: 80,
|
|
|
|
|
decoration:
|
|
|
|
|
BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.circular(50),
|
|
|
|
|
color: Hexcolor("#20A169"),
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius
|
|
|
|
|
.circular(
|
|
|
|
|
50),
|
|
|
|
|
color: Hexcolor(
|
|
|
|
|
"#20A169"),
|
|
|
|
|
),
|
|
|
|
|
child:
|
|
|
|
|
AppText(
|
|
|
|
|
item.startTime,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: 2 * SizeConfig.textMultiplier,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
item
|
|
|
|
|
.startTime,
|
|
|
|
|
color: Colors
|
|
|
|
|
.white,
|
|
|
|
|
fontSize:
|
|
|
|
|
2 * SizeConfig
|
|
|
|
|
.textMultiplier,
|
|
|
|
|
textAlign:
|
|
|
|
|
TextAlign
|
|
|
|
|
.center,
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight
|
|
|
|
|
.bold,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
width:
|
|
|
|
|
60,
|
|
|
|
|
width: 60,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
child:
|
|
|
|
|
AppText(
|
|
|
|
|
convertDateFormat2(item.appointmentDate.toString()),
|
|
|
|
|
fontSize: 2.0 * SizeConfig.textMultiplier,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
convertDateFormat2(
|
|
|
|
|
item
|
|
|
|
|
.appointmentDate
|
|
|
|
|
.toString()),
|
|
|
|
|
fontSize:
|
|
|
|
|
2.0 *
|
|
|
|
|
SizeConfig
|
|
|
|
|
.textMultiplier,
|
|
|
|
|
fontWeight:
|
|
|
|
|
FontWeight
|
|
|
|
|
.bold,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: AppText(
|
|
|
|
|
item.nationalityName ??
|
|
|
|
|
item.nationalityNameN,
|
|
|
|
|
fontSize:
|
|
|
|
|
2.5 *
|
|
|
|
|
SizeConfig.textMultiplier,
|
|
|
|
|
item
|
|
|
|
|
.nationalityName ??
|
|
|
|
|
item
|
|
|
|
|
.nationalityNameN,
|
|
|
|
|
fontSize: 2.5 *
|
|
|
|
|
SizeConfig
|
|
|
|
|
.textMultiplier,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 15,
|
|
|
|
|
),
|
|
|
|
|
// Divider(color: Colors.grey)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
// Divider(color: Colors.grey)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.of(context)
|
|
|
|
|
.pushNamed(
|
|
|
|
@ -581,6 +590,12 @@ class _PatientsScreenState extends State<PatientsScreen> {
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
)
|
|
|
|
|
: Center(
|
|
|
|
|
child: DrAppEmbeddedError(
|
|
|
|
|
error: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.youDontHaveAnyPatient),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
@ -610,9 +625,13 @@ class _PatientsScreenState extends State<PatientsScreen> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget _locationBar(BuildContext _context) {
|
|
|
|
|
return Container(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.065,
|
|
|
|
|
width: SizeConfig.screenWidth * 0.9,
|
|
|
|
|
return Expanded(
|
|
|
|
|
child: Container(
|
|
|
|
|
height: MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.height * 0.065,
|
|
|
|
|
width: SizeConfig.screenWidth * 0.95,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Color(0Xffffffff), borderRadius: BorderRadius.circular(20)),
|
|
|
|
|
child: Row(
|
|
|
|
@ -639,9 +658,6 @@ class _PatientsScreenState extends State<PatientsScreen> {
|
|
|
|
|
color: _isActive
|
|
|
|
|
? Colors.white
|
|
|
|
|
: Colors.black, //Colors.black,
|
|
|
|
|
// backgroundColor:_isActive
|
|
|
|
|
// ? Hexcolor("#B8382B")
|
|
|
|
|
// : Colors.white,//sideColor,
|
|
|
|
|
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
),
|
|
|
|
@ -670,6 +686,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
|
|
|
|
|
]);
|
|
|
|
|
}).toList(),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -677,7 +694,6 @@ class _PatientsScreenState extends State<PatientsScreen> {
|
|
|
|
|
return BoxDecoration(
|
|
|
|
|
border: Border(
|
|
|
|
|
bottom: BorderSide(
|
|
|
|
|
// <--- top side
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
width: 1.0,
|
|
|
|
|
),
|
|
|
|
|