done qr code

merge-requests/65/head
her_username 6 years ago
parent c1ddff2994
commit 5fdf34b917

@ -151,7 +151,7 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
patientList = []; patientList = [];
}); });
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
patient.PatientID = 3120269; patient.PatientID = 8808;
patient.TokenID = token; patient.TokenID = token;
Provider.of<PatientsProvider>(context, listen: false) Provider.of<PatientsProvider>(context, listen: false)
.getPatientList(patient, "1") .getPatientList(patient, "1")

@ -17,14 +17,11 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.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/errors/dr_app_embedded_error.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
//*************
import '../../config/size_config.dart'; import '../../config/size_config.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
//********
import '../../widgets/shared/app_scaffold_widget.dart'; import '../../widgets/shared/app_scaffold_widget.dart';
import '../../widgets/shared/card_with_bg_widget.dart'; import '../../widgets/shared/card_with_bg_widget.dart';
@ -38,14 +35,11 @@ class PatientsScreen extends StatefulWidget {
class _PatientsScreenState extends State<PatientsScreen> { class _PatientsScreenState extends State<PatientsScreen> {
List<dynamic> litems; List<dynamic> litems;
// final List parsed;
List parsed; List parsed;
//**********
List date; List date;
List unfilterDate; List unfilterDate;
//***********
List<PatiantInformtion> responseModelList; List<PatiantInformtion> responseModelList;
List<PatiantInformtion> responseModelList2; List<PatiantInformtion> responseModelList2;
@ -59,13 +53,11 @@ class _PatientsScreenState extends State<PatientsScreen> {
String patientTypetitle; String patientTypetitle;
var _isLoading = false; var _isLoading = false;
bool _isError =true; bool _isError = true;
String error =""; String error = "";
//*******Amjad add to search box******
final _controller = TextEditingController(); final _controller = TextEditingController();
//**************
PatientModel patient; PatientModel patient;
PatientsProvider patientsProv; PatientsProvider patientsProv;
@ -75,8 +67,6 @@ class _PatientsScreenState extends State<PatientsScreen> {
patient = routeArgs['patientSearchForm']; patient = routeArgs['patientSearchForm'];
print(patient.TokenID + "EEEEEE");
patientType = routeArgs['selectedType']; patientType = routeArgs['selectedType'];
patientTypetitle = SERVICES_PATIANT_HEADER[int.parse(patientType)]; patientTypetitle = SERVICES_PATIANT_HEADER[int.parse(patientType)];
@ -87,7 +77,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
setState(() { setState(() {
_isLoading = true; _isLoading = true;
_isError = false; _isError = false;
error =""; error = "";
}); });
patientsProv.getPatientList(patient, patientType).then((res) { patientsProv.getPatientList(patient, patientType).then((res) {
setState(() { setState(() {
@ -105,11 +95,10 @@ class _PatientsScreenState extends State<PatientsScreen> {
} }
}); });
}).catchError((error) { }).catchError((error) {
setState(() { setState(() {
_isError = true; _isError = true;
this.error = helpers.generateContactAdminMsg(error); this.error = helpers.generateContactAdminMsg(error);
}); });
}); });
} }
@ -152,7 +141,6 @@ class _PatientsScreenState extends State<PatientsScreen> {
} }
} }
//***********DateFormat**************
/* /*
*@author: Amjad Amireh *@author: Amjad Amireh
*@Date:5/5/2020 *@Date:5/5/2020
@ -288,26 +276,23 @@ class _PatientsScreenState extends State<PatientsScreen> {
return "Old Date"; return "Old Date";
} }
//*************************
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
PatientsProvider patientsProv = Provider.of<PatientsProvider>(context); PatientsProvider patientsProv = Provider.of<PatientsProvider>(context);
return AppScaffold( return AppScaffold(
appBarTitle: patientTypetitle, appBarTitle: patientTypetitle,
//***********Modify by amjad (create List view to insert all new data webservise in scroll )************* body: _isLoading
body: _isLoading ? DrAppCircularProgressIndeicator()
? DrAppCircularProgressIndeicator() : _isError
: _isError ? DrAppEmbeddedError(error: error)
? DrAppEmbeddedError(error:error) : litems == null
: litems == null ? DrAppEmbeddedError(error: 'You don\'t have any patient')
? DrAppEmbeddedError( : Container(
error: 'You don\'t have any patient') child: ListView(
: Container( scrollDirection: Axis.vertical,
child: children: <Widget>[
ListView(scrollDirection: Axis.vertical, children: < Container(
Widget>[
Container(
child: litems == null child: litems == null
? Column( ? Column(
children: <Widget>[ children: <Widget>[
@ -411,11 +396,14 @@ class _PatientsScreenState extends State<PatientsScreen> {
), ),
), ),
], ],
)) ),
]))); )
],
),
),
);
} }
//***********amjad update**buildInputDecoration ***to search box********
InputDecoration buildInputDecoration(BuildContext context, hint) { InputDecoration buildInputDecoration(BuildContext context, hint) {
return InputDecoration( return InputDecoration(
prefixIcon: Icon(Icons.search, color: Colors.red), prefixIcon: Icon(Icons.search, color: Colors.red),
@ -435,45 +423,46 @@ class _PatientsScreenState extends State<PatientsScreen> {
Widget _locationBar(BuildContext _context) { Widget _locationBar(BuildContext _context) {
return Container( return Container(
height: MediaQuery.of(context).size.height * 0.065, height: MediaQuery.of(context).size.height * 0.065,
width: SizeConfig.screenWidth * 0.80, width: SizeConfig.screenWidth * 0.80,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0Xff59434f), borderRadius: BorderRadius.circular(20)), color: Color(0Xff59434f), borderRadius: BorderRadius.circular(20)),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: _locations.map((item) { children: _locations.map((item) {
bool _isActive = _locations[_activeLocation] == item ? true : false; bool _isActive = _locations[_activeLocation] == item ? true : false;
return Column(mainAxisSize: MainAxisSize.min, children: <Widget>[ return Column(mainAxisSize: MainAxisSize.min, children: <Widget>[
InkWell( InkWell(
child: Text( child: Text(
item, item,
style: TextStyle( style: TextStyle(
fontSize: 15, fontSize: 15,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
), ),
onTap: () { onTap: () {
print(_locations.indexOf(item)); print(_locations.indexOf(item));
filterBooking(item.toString()); filterBooking(item.toString());
setState(() { setState(() {
_activeLocation = _locations.indexOf(item); _activeLocation = _locations.indexOf(item);
}); });
}), }),
_isActive _isActive
? Container( ? Container(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
color: Colors.white), color: Colors.white),
height: 3, height: 3,
width: 80, width: 80,
) )
: Container() : Container()
]); ]);
}).toList(), }).toList(),
)); ),
);
} }
} }

Loading…
Cancel
Save