Merge branch 'mohammad' into 'master'

Mohammad

See merge request Cloud_Solution/doctor_app_flutter!65
merge-requests/66/merge
Mohammad Aljammal 6 years ago
commit 8f56c5104a

@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android { android {
compileSdkVersion 28 compileSdkVersion 29
sourceSets { sourceSets {
main.java.srcDirs += 'src/main/kotlin' main.java.srcDirs += 'src/main/kotlin'
@ -39,8 +39,8 @@ android {
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.doctor_app_flutter" applicationId "com.example.doctor_app_flutter"
minSdkVersion 16 minSdkVersion 18
targetSdkVersion 28 targetSdkVersion 29
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

@ -5,6 +5,8 @@
In most cases you can leave this as-is, but you if you want to provide In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. --> FlutterApplication and put your custom class here. -->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA" />
<application <application
android:name="io.flutter.app.FlutterApplication" android:name="io.flutter.app.FlutterApplication"
android:label="doctor_app_flutter" android:label="doctor_app_flutter"

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

@ -43,5 +43,7 @@
</array> </array>
<key>UIViewControllerBasedStatusBarAppearance</key> <key>UIViewControllerBasedStatusBarAppearance</key>
<false/> <false/>
<key>NSCameraUsageDescription</key>
<string>Camera permission is required for barcode scanning.</string>
</dict> </dict>
</plist> </plist>

@ -3,5 +3,13 @@ const Map<String, Map<String, String>> localizedValues = {
'settings': {'en': 'Settings', 'ar': 'الاعدادات'}, 'settings': {'en': 'Settings', 'ar': 'الاعدادات'},
'language': {'en': 'App Language', 'ar': 'لغة التطبيق'}, 'language': {'en': 'App Language', 'ar': 'لغة التطبيق'},
'lanEnglish': {'en': 'English', 'ar': 'English'}, 'lanEnglish': {'en': 'English', 'ar': 'English'},
'lanArabic': {'en': 'العربية', 'ar': 'العربية'} 'lanArabic': {'en': 'العربية', 'ar': 'العربية'},
'doctorReply':{'en': 'Doctor Reply', 'ar': 'رد الطبيب'},
'time' :{'en': 'Time','ar':'الوقت'},
'fileNo' :{'en':'File No', 'ar':'رقم الملف'},
'mobileNo' :{'en':'Mobile No', 'ar':'رقم الموبايل'},
'messagesScreenToolbarTitle' : {'en': 'Messages','ar': 'الرسائل' },
'mySchedule' : {'en': 'My Schedule', 'ar' : 'جدولي'},
'errorNoSchedule' :{'en': 'You don\'t have any Schedule' , 'ar': 'ليس لديك أي جدول زمني'},
}; };

@ -89,7 +89,7 @@ class PatiantInformtion {
this.nursingStationName, this.nursingStationName,
this.appointmentDate, this.appointmentDate,
this.startTime, this.startTime,
}); });
factory PatiantInformtion.fromJson(Map<String, dynamic> json) => PatiantInformtion( factory PatiantInformtion.fromJson(Map<String, dynamic> json) => PatiantInformtion(
@ -125,7 +125,7 @@ class PatiantInformtion {
age: json["Age"], age: json["Age"],
genderDescription: json["GenderDescription"], genderDescription: json["GenderDescription"],
nursingStationName: json["NursingStationName"], nursingStationName: json["NursingStationName"],
appointmentDate: json["AppointmentDate"], appointmentDate: json["AppointmentDate"]?? '',
startTime: json["StartTime"], startTime: json["StartTime"],
); );

@ -144,6 +144,31 @@ class PatientModel {
LastName: json["LasttName"], LastName: json["LasttName"],
); );
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ProjectID'] = this.ProjectID;
data['ClinicID'] = this.ClinicID;
data['DoctorID'] = this.DoctorID;
data['PatientID'] = this.PatientID;
data['FirstName'] = this.FirstName;
data['MiddleName'] = this.MiddleName;
data['LastName'] = this.LastName;
data['PatientMobileNumber'] = this.PatientMobileNumber;
data['PatientIdentificationID'] = this.PatientIdentificationID;
data['PatientID'] = this.PatientID;
data['From'] = this.From;
data['To'] = this.To;
data['LanguageID'] = this.LanguageID;
data['stamp'] = this.stamp;
data['IPAdress'] = this.IPAdress;
data['VersionID'] = this.VersionID;
data['Channel'] = this.Channel;
data['TokenID'] = this.TokenID;
data['SessionID'] = this.SessionID;
data['IsLoginForDoctorApp'] = this.IsLoginForDoctorApp;
data['PatientOutSA'] = this.PatientOutSA;
return data;
}
} }
//*************************** //***************************

@ -1,6 +1,8 @@
import 'dart:convert'; import 'dart:convert';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/models/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/request_doctor_reply.dart'; import 'package:doctor_app_flutter/models/request_doctor_reply.dart';
import 'package:doctor_app_flutter/models/list_gt_my_pationents_question_model.dart'; import 'package:doctor_app_flutter/models/list_gt_my_pationents_question_model.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
@ -26,6 +28,12 @@ class DoctorReplyProvider with ChangeNotifier {
getDoctorSchedule() async { getDoctorSchedule() async {
const url = BASE_URL + 'DoctorApplication.svc/REST/GtMyPatientsQuestions'; const url = BASE_URL + 'DoctorApplication.svc/REST/GtMyPatientsQuestions';
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
_requestSchedule.doctorID = doctorProfile.doctorID;
_requestSchedule.projectID = doctorProfile.projectID;
_requestSchedule.tokenID = token;
try { try {
if (await Helpers.checkConnection()) { if (await Helpers.checkConnection()) {
final response = await client.post(url, final response = await client.post(url,
@ -45,7 +53,8 @@ class DoctorReplyProvider with ChangeNotifier {
isLoading = false; isLoading = false;
} else { } else {
isError = true; isError = true;
error = parsed['ErrorMessage'] ?? parsed['ErrorEndUserMessage']; isLoading = false;
error = parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'] ;
} }
} }
} else { } else {

@ -1,6 +1,8 @@
import 'dart:convert'; import 'dart:convert';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/models/doctor_profile_model.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:http/http.dart'; import 'package:http/http.dart';
@ -11,14 +13,14 @@ import '../models/list_doctor_working_hours_table_model.dart';
import '../models/request_schedule.dart'; import '../models/request_schedule.dart';
class ScheduleProvider with ChangeNotifier { class ScheduleProvider with ChangeNotifier {
Client client =
HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]); Client client = HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]);
List<ListDoctorWorkingHoursTable> listDoctorWorkingHoursTable = []; List<ListDoctorWorkingHoursTable> listDoctorWorkingHoursTable = [];
bool isLoading = true; bool isLoading = true;
bool isError = false; bool isError = false;
String error = ''; String error = '';
RequestSchedule requestSchedule = RequestSchedule(15, 1, 70907, 7, 2, '2020-04-22T11:25:57.640Z', '11.11.11.11', 1.2, 9, '2lMDFT8U+Uy5jxRzCO8n2w==', 'vV6tg9yyVJ222', true, false, 1); RequestSchedule requestSchedule = RequestSchedule(15, 1, 1485, 7, 2, '2020-04-22T11:25:57.640Z', '11.11.11.11', 1.2, 9, '2lMDFT8U+Uy5jxRzCO8n2w==', 'vV6tg9yyVJ222', true, false, 1);
ScheduleProvider() { ScheduleProvider() {
getDoctorSchedule(); getDoctorSchedule();
@ -26,6 +28,13 @@ class ScheduleProvider with ChangeNotifier {
getDoctorSchedule() async { getDoctorSchedule() async {
const url = BASE_URL + 'Doctors.svc/REST/GetDoctorWorkingHoursTable'; const url = BASE_URL + 'Doctors.svc/REST/GetDoctorWorkingHoursTable';
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
requestSchedule.doctorID = doctorProfile.doctorID;
requestSchedule.projectID = doctorProfile.projectID;
requestSchedule.clinicID = doctorProfile.clinicID;
requestSchedule.tokenID = token;
try { try {
if (await Helpers.checkConnection()) { if (await Helpers.checkConnection()) {

@ -1,11 +1,205 @@
import 'package:barcode_scan/platform_wrapper.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.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/patient_model.dart';
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/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/widgets/shared/app_button.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class QrReaderScreen extends StatelessWidget { import 'package:provider/provider.dart';
import '../routes.dart';
class QrReaderScreen extends StatefulWidget {
@override
_QrReaderScreenState createState() => _QrReaderScreenState();
}
class _QrReaderScreenState extends State<QrReaderScreen> {
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
bool isLoading = false;
bool isError = false;
PatientModel patient = PatientModel(
ProjectID: 15,
ClinicID: 0,
DoctorID: 1485,
FirstName: "0",
MiddleName: "0",
LastName: "0",
PatientMobileNumber: "0",
PatientIdentificationID: "0",
PatientID: 0,
From: "0",
To: "0",
LanguageID: 2,
stamp: "2020-03-02T13:56:39.170Z",
IPAdress: "11.11.11.11",
VersionID: 1.2,
Channel: 9,
TokenID: "@dm!n",
SessionID: "5G0yXn0Jnq",
IsLoginForDoctorApp: true,
PatientOutSA: false);
List<PatiantInformtion> patientList = [];
String error = '';
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
appBarTitle: "QR Reader", appBarTitle: "QR Reader",
body: Container(), body: Center(
child: Container(
margin: EdgeInsets.only(top: SizeConfig.realScreenHeight / 7),
child: FractionallySizedBox(
widthFactor: 0.9,
child: ListView(
children: [
AppText(
'Start Scanning',
fontSize: 18,
fontWeight: FontWeight.bold,
textAlign: TextAlign.center,
),
SizedBox(
height: 7,
),
AppText(
'scan Qr code to retrieve patient profile',
fontSize: 14,
fontWeight: FontWeight.w400,
textAlign: TextAlign.center
),
SizedBox(
height: 15,
),
Container(
height: 150,
child: Image.asset('assets/images/qr_code.png'),
),
SizedBox(
height: 35,
),
Button(
onTap: () {
_scanQrAndGetPatient(context);
},
title: 'Scan Qr',
loading: isLoading,
icon: Image.asset('assets/images/qr_code_white.png'),
),
isError ? Container(
margin: EdgeInsets.only(top: 8),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.0),
color: Theme.of(context).errorColor.withOpacity(0.06),
),
padding: EdgeInsets.symmetric(vertical: 8.0, horizontal: 12.0),
child: Row(
children: <Widget>[
Expanded(child: AppText(error ?? "Something went wrong.", color: Theme.of(context).errorColor)),
],
),
):Container(),
Column(
children: patientList.map((item) {
return InkWell(
onTap: (){
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": item,
});
},
child: AnimatedContainer(
duration: Duration(milliseconds: 200),
child: CardWithBgWidget(
widget: Container(
child: AppText(
'${item.firstName} ${item.lastName}',
fontSize: 2.5 * SizeConfig.textMultiplier,
),
),
),
),
);
}).toList()
),
],
),
),
),
),
); );
} }
}
_scanQrAndGetPatient(BuildContext context) async {
/// When give qr we will change this method to get data
/// var result = await BarcodeScanner.scan();
/// int patientID = get from qr result
var result = await BarcodeScanner.scan();
// if (result.rawContent == "") {
List<String> listOfParams = result.rawContent.split(',');
String patientType = "1";
setState(() {
isLoading = true;
isError = false;
patientList = [];
});
String token = await sharedPref.getString(TOKEN);
patient.PatientID = 8808;
patient.TokenID = token;
Provider.of<PatientsProvider>(context, listen: false)
.getPatientList(patient, "1")
.then((response) {
if (response['MessageStatus'] == 1) {
switch (patientType) {
case "0":
if (response['List_MyOutPatient'] != null) {
setState(() {
patientList = ModelResponse
.fromJson(response['List_MyOutPatient'])
.list;
isLoading = false;
});
} else {
setState(() {
isError = true;
error = 'No patient';
isLoading = false;
});
}
break;
case "1":
if (response['List_MyInPatient'] != null) {
setState(() {
patientList = ModelResponse.fromJson(response['List_MyInPatient']).list;
isLoading = false;
error = "";
});
} else {
setState(() {
error = 'No patient';
isError = true;
isLoading = false;
});
break;
}
}
} else {
setState(() {
error = response['ErrorEndUserMessage'] ?? response['ErrorMessage'] ;
isLoading = false;
isError = true;
});
}
});
}
// }
}

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/providers/doctor_reply_provider.dart'; import 'package:doctor_app_flutter/providers/doctor_reply_provider.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
@ -24,7 +25,7 @@ class DoctorReplyScreen extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
_doctorReplyProvider = Provider.of(context); _doctorReplyProvider = Provider.of(context);
return AppScaffold( return AppScaffold(
appBarTitle: 'Doctor Reply', appBarTitle: TranslationBase.of(context).doctorReply,
showAppDrawer: false, showAppDrawer: false,
body:_doctorReplyProvider.isLoading? DrAppCircularProgressIndeicator(): body:_doctorReplyProvider.isLoading? DrAppCircularProgressIndeicator():
_doctorReplyProvider.isError? Center( _doctorReplyProvider.isError? Center(
@ -62,7 +63,7 @@ class DoctorReplyScreen extends StatelessWidget {
Row( Row(
children: [ children: [
AppText( AppText(
'Time', TranslationBase.of(context).time,
fontSize: 2.5 * SizeConfig.textMultiplier, fontSize: 2.5 * SizeConfig.textMultiplier,
), ),
Container( Container(
@ -80,7 +81,7 @@ class DoctorReplyScreen extends StatelessWidget {
Row( Row(
children: [ children: [
AppText( AppText(
'File No', TranslationBase.of(context).fileNo,
fontSize: 2.5 * SizeConfig.textMultiplier, fontSize: 2.5 * SizeConfig.textMultiplier,
), ),
Container( Container(
@ -98,7 +99,7 @@ class DoctorReplyScreen extends StatelessWidget {
Row( Row(
children: [ children: [
AppText( AppText(
'Mobile No', TranslationBase.of(context).mobileNo,
fontSize: 2.5 * SizeConfig.textMultiplier, fontSize: 2.5 * SizeConfig.textMultiplier,
), ),
Container( Container(

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -6,7 +7,7 @@ class MessagesScreen extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
current: 1, current: 1,
appBarTitle: 'Messages', appBarTitle: TranslationBase.of(context).messagesScreenToolbarTitle,
body: Center( body: Center(
child: Text('Messages heeer'), child: Text('Messages heeer'),
), ),

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/providers/schedule_provider.dart'; import 'package:doctor_app_flutter/providers/schedule_provider.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/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:flutter/material.dart'; import 'package:flutter/material.dart';
@ -18,7 +19,7 @@ class MyScheduleScreen extends StatelessWidget {
// pageOnly: false, // pageOnly: false,
showBottomBar: false, showBottomBar: false,
showAppDrawer: false, showAppDrawer: false,
appBarTitle: 'My Schedule', appBarTitle: TranslationBase.of(context).mySchedule,
body: scheduleProvider.isLoading body: scheduleProvider.isLoading
? DrAppCircularProgressIndeicator() ? DrAppCircularProgressIndeicator()
: scheduleProvider.isError : scheduleProvider.isError
@ -31,7 +32,7 @@ class MyScheduleScreen extends StatelessWidget {
: scheduleProvider.listDoctorWorkingHoursTable.length == 0 : scheduleProvider.listDoctorWorkingHoursTable.length == 0
? Center( ? Center(
child: AppText( child: AppText(
'You don\'t have any Schedule', TranslationBase.of(context).errorNoSchedule,
color: Theme.of(context).errorColor, color: Theme.of(context).errorColor,
), ),
) )
@ -48,7 +49,7 @@ class MyScheduleScreen extends StatelessWidget {
SizedBox( SizedBox(
height: 20, height: 20,
), ),
AppText('My Schedule', AppText(TranslationBase.of(context).mySchedule,
fontSize: fontSize:
2.5 * SizeConfig.textMultiplier), 2.5 * SizeConfig.textMultiplier),
scheduleListByDate(), scheduleListByDate(),

@ -65,8 +65,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
if (_formKey.currentState.validate()) { if (_formKey.currentState.validate()) {
_formKey.currentState.save(); _formKey.currentState.save();
//*********************************** */
sharedPref.setString(TOKEN, '@dm!n');
sharedPref.setString(SLECTED_PATIENT_TYPE, _selectedType); sharedPref.setString(SLECTED_PATIENT_TYPE, _selectedType);
print('_selectedType${_selectedType}'); print('_selectedType${_selectedType}');
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
@ -83,7 +82,6 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
"selectedType": _selectedType "selectedType": _selectedType
}); });
} else { } else {
// If all data are not valid then start auto validation.
setState(() { setState(() {
_autoValidate = true; _autoValidate = true;
}); });
@ -237,9 +235,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
_patientSearchFormValues.setLastName = "0"; _patientSearchFormValues.setLastName = "0";
} }
}, },
// validator: (value) {
// return TextValidator().validateName(value);
// },
inputFormatter: ONLY_LETTERS), inputFormatter: ONLY_LETTERS),
SizedBox( SizedBox(
height: 10, height: 10,
@ -269,7 +265,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
), ),
AppTextFormField( AppTextFormField(
textInputType: TextInputType.number, textInputType: TextInputType.number,
hintText: 'Patiant ID', hintText: 'Patient ID',
// //
inputFormatter: ONLY_NUMBERS, inputFormatter: ONLY_NUMBERS,
onSaved: (value) { onSaved: (value) {
@ -288,7 +284,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
), ),
AppTextFormField( AppTextFormField(
textInputType: TextInputType.number, textInputType: TextInputType.number,
hintText: 'Patiant File', hintText: 'Patient File',
// validator: (value) { // validator: (value) {
// return TextValidator().validateIdNumber(value); // return TextValidator().validateIdNumber(value);
// }, // },

@ -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';
@ -37,15 +34,16 @@ 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;
// List<String> _locations = ['Today', 'Old Date', 'YESTERDAY']; // List<String> _locations = ['Today', 'Old Date', 'YESTERDAY'];
List<String> _locations = ['Today', 'Tomorrow', 'Next Week']; List<String> _locations = ['Today', 'Tomorrow', 'Next Week'];
int _activeLocation = 0; int _activeLocation = 0;
@ -53,12 +51,13 @@ class _PatientsScreenState extends State<PatientsScreen> {
bool _isInit = true; bool _isInit = true;
String patientType; String patientType;
String patientTypetitle; String patientTypetitle;
var _isLoading = true; var _isLoading = false;
bool _isError = true;
String error = "";
var _hasError;
//*******Amjad add to search box******
final _controller = TextEditingController(); final _controller = TextEditingController();
//**************
PatientModel patient; PatientModel patient;
PatientsProvider patientsProv; PatientsProvider patientsProv;
@ -68,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)];
@ -77,26 +74,31 @@ class _PatientsScreenState extends State<PatientsScreen> {
if (_isInit) { if (_isInit) {
PatientsProvider patientsProv = Provider.of<PatientsProvider>(context); PatientsProvider patientsProv = Provider.of<PatientsProvider>(context);
setState(() {
_isLoading = true;
_isError = false;
error = "";
});
patientsProv.getPatientList(patient, patientType).then((res) { patientsProv.getPatientList(patient, patientType).then((res) {
setState(() { setState(() {
int val2 = int.parse(patientType);
litems = res[SERVICES_PATIANT2[val2]];
parsed = litems;
responseModelList = new ModelResponse.fromJson(parsed).list;
responseModelList2 = responseModelList;
//********************
_isLoading = false; _isLoading = false;
if (res['MessageStatus'] == 1) {
_hasError = res['ErrorEndUserMessage']; int val2 = int.parse(patientType);
litems = res[SERVICES_PATIANT2[val2]];
parsed = litems;
responseModelList = new ModelResponse.fromJson(parsed).list;
responseModelList2 = responseModelList;
_isError = false;
} else {
_isError = true;
error = res['ErrorEndUserMessage'] ?? res['ErrorMessage'] ;
}
}); });
print(res);
}).catchError((error) { }).catchError((error) {
// patientsProv.isLoading=false; setState(() {
// patientsProv.isError=true; _isError = true;
print("====================error================"); this.error = helpers.generateContactAdminMsg(error);
print(error); });
}); });
} }
@ -106,7 +108,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
} }
/* /*
*@author: Amjad Amireh *@author: Amjad Amireh
*@Date:2/5/2020 *@Date:2/5/2020
*@param: *@param:
*@return:PatientsScreen Search textbox filter *@return:PatientsScreen Search textbox filter
@ -139,9 +141,8 @@ class _PatientsScreenState extends State<PatientsScreen> {
} }
} }
//***********DateFormat**************
/* /*
*@author: Amjad Amireh *@author: Amjad Amireh
*@Date:5/5/2020 *@Date:5/5/2020
*@param: *@param:
*@return:Convert time from Milesecond to date with time *@return:Convert time from Milesecond to date with time
@ -177,10 +178,10 @@ class _PatientsScreenState extends State<PatientsScreen> {
} }
/* /*
*@author: Amjad Amireh *@author: Amjad Amireh
*@Date:5/5/2020 *@Date:5/5/2020
*@param: *@param:
*@return:Convert time from Milesecond to date *@return:Convert time from Milesecond to date
*@desc: *@desc:
*/ */
@ -202,7 +203,8 @@ class _PatientsScreenState extends State<PatientsScreen> {
return newDate.toString(); return newDate.toString();
} }
convertDateFormat2(String str) {
convertDateFormat2(String str) {
String timeConvert; String timeConvert;
const start = "/Date("; const start = "/Date(";
const end = "+0300)"; const end = "+0300)";
@ -220,6 +222,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
return newDate.toString(); return newDate.toString();
} }
filterBooking(String str) { filterBooking(String str) {
this.responseModelList = this.responseModelList2; this.responseModelList = this.responseModelList2;
@ -273,29 +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: patientsProv.isLoading ? DrAppCircularProgressIndeicator()
? DrAppCircularProgressIndeicator() : _isError
: patientsProv.isError ? DrAppEmbeddedError(error: error)
? DrAppEmbeddedError(error: patientsProv.error) : litems == null
: litems == null? ? DrAppEmbeddedError(error: 'You don\'t have any patient')
// ? DrAppEmbeddedError( : Container(
// error: 'You don\'t have any ' + child: ListView(
// patientTypetitle + scrollDirection: Axis.vertical,
// " patiant") children: <Widget>[
DrAppCircularProgressIndeicator() Container(
: Container(
child:
ListView(scrollDirection: Axis.vertical, children: <
Widget>[
Container(
child: litems == null child: litems == null
? Column( ? Column(
children: <Widget>[ children: <Widget>[
@ -333,7 +330,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
this.searchData(str); this.searchData(str);
}, },
decoration: buildInputDecoration( decoration: buildInputDecoration(
context, 'Search patiant'), context, 'Search Patient'),
), ),
), ),
Container( Container(
@ -368,11 +365,13 @@ class _PatientsScreenState extends State<PatientsScreen> {
patientType)] == patientType)] ==
"List_MyOutPatient" "List_MyOutPatient"
? AppText( ? AppText(
convertDateFormat2(item convertDateFormat2(item
.appointmentDate .appointmentDate
.toString())+" "+"-"+" "+item.startTime .toString()) +
, " " +
"-" +
" " +
item.startTime,
fontSize: 2.5 * fontSize: 2.5 *
SizeConfig SizeConfig
.textMultiplier) .textMultiplier)
@ -397,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),
@ -421,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(),
)); ),
);
} }
} }

@ -25,6 +25,21 @@ class TranslationBase {
String get lanArabic => localizedValues['lanArabic'][locale.languageCode]; String get lanArabic => localizedValues['lanArabic'][locale.languageCode];
String get doctorReply => localizedValues['doctorReply'][locale.languageCode];
String get time => localizedValues['time'][locale.languageCode];
String get fileNo => localizedValues['fileNo'][locale.languageCode];
String get mobileNo => localizedValues['mobileNo'][locale.languageCode];
String get messagesScreenToolbarTitle => localizedValues['messagesScreenToolbarTitle'][locale.languageCode];
String get mySchedule => localizedValues['mySchedule'][locale.languageCode];
String get errorNoSchedule => localizedValues['errorNoSchedule'][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -0,0 +1,146 @@
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class Button extends StatefulWidget {
Button({
Key key,
this.title: "",
this.icon,
this.onTap,
this.loading: false,
}) : super(key: key);
final String title;
final Widget icon;
final VoidCallback onTap;
final bool loading;
@override
_ButtonState createState() => _ButtonState();
}
class _ButtonState extends State<Button> with TickerProviderStateMixin {
double _buttonSize = 1.0;
AnimationController _animationController;
Animation _animation;
@override
void initState() {
_animationController = AnimationController(
vsync: this,
lowerBound: 0.7,
upperBound: 1.0,
duration: Duration(milliseconds: 120));
_animation = CurvedAnimation(
parent: _animationController,
curve: Curves.easeOutQuad,
reverseCurve: Curves.easeOutQuad);
_animation.addListener(() {
setState(() {
_buttonSize = _animation.value;
});
});
super.initState();
}
@override
void dispose() {
_animationController.dispose();
super.dispose();
}
Widget _buildIcon() {
if (widget.icon != null && (widget.title != null && widget.title != "")) {
return Container(
margin: EdgeInsets.only(right: 12.0),
height: 24.0,
child: widget.icon);
} else if (widget.icon != null) {
return Container(
height: 18.0,
width: 18.0,
child: widget.icon,
);
} else {
return Container();
}
}
@override
Widget build(BuildContext context) {
return IgnorePointer(
ignoring: widget.loading,
child: GestureDetector(
onTapDown: (TapDownDetails tap) {
_animationController.reverse(from: 1.0);
},
onTapUp: (TapUpDetails tap) {
_animationController.forward();
},
onTapCancel: () {
_animationController.forward();
},
onTap: Feedback.wrapForTap(widget.onTap, context),
behavior: HitTestBehavior.opaque,
child: Transform.scale(
scale: _buttonSize,
child: AnimatedContainer(
duration: Duration(milliseconds: 150),
margin:
EdgeInsets.only(bottom: widget.title.isNotEmpty ? 14.0 : 0.0),
padding: EdgeInsets.symmetric(
vertical: widget.title != null && widget.title.isNotEmpty
? 12.0
: 15.0,
horizontal: widget.title != null && widget.title.isNotEmpty
? 22.0
: 19),
decoration: BoxDecoration(
color: Hexcolor('#58434F'),
borderRadius: BorderRadius.all(Radius.circular(100.0)),
boxShadow: [
BoxShadow(
color: Color.fromRGBO(70, 70, 70, 0.28),
spreadRadius:
_buttonSize < 1.0 ? -(1 - _buttonSize) * 50 : 0.0,
offset: Offset(0, 7.0),
blurRadius: 24.0)
],
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
_buildIcon(),
widget.loading
? Padding(
padding: const EdgeInsets.all(2.7),
child: SizedBox(
height: 19.0,
width: 19.0,
child: CircularProgressIndicator(
backgroundColor: Colors.white,
valueColor: AlwaysStoppedAnimation<Color>(
Hexcolor('#FFDDD9'),
),
),
),
)
: Padding(
padding: EdgeInsets.only(bottom: 3.0),
child: Text(widget.title,
style: TextStyle(
color: Colors.white,
fontSize: 17.0,
fontWeight: FontWeight.w700,
fontFamily: "WorkSans")),
)
],
),
),
),
),
);
}
}

@ -1,7 +1,9 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/providers/project_provider.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
/* /*
*@author: Mohammad Aljammal *@author: Mohammad Aljammal
@ -18,6 +20,7 @@ class CardWithBgWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectProvider projectProvider = Provider.of(context);
return Container( return Container(
margin: EdgeInsets.symmetric(vertical: 10.0), margin: EdgeInsets.symmetric(vertical: 10.0),
width: double.infinity, width: double.infinity,
@ -31,15 +34,26 @@ class CardWithBgWidget extends StatelessWidget {
borderRadius: BorderRadius.all(Radius.circular(10.0)), borderRadius: BorderRadius.all(Radius.circular(10.0)),
child: Stack( child: Stack(
children: [ children: [
Positioned( if (projectProvider.isArabic)
child: Container( Positioned(
width: 10, child: Container(
color: Hexcolor('#58434F'), width: 10,
color: Hexcolor('#58434F'),
),
bottom: 0,
top: 0,
right: 0,
)
else
Positioned(
child: Container(
width: 10,
color: Hexcolor('#58434F'),
),
bottom: 0,
top: 0,
left: 0,
), ),
bottom: 0,
top: 0,
left: 0,
),
Container( Container(
padding: EdgeInsets.all(15.0), padding: EdgeInsets.all(15.0),
margin: EdgeInsets.only(left: 10), margin: EdgeInsets.only(left: 10),

@ -21,21 +21,28 @@ packages:
name: archive name: archive
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.11" version: "2.0.13"
args: args:
dependency: transitive dependency: transitive
description: description:
name: args name: args
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.5.2" version: "1.6.0"
async: async:
dependency: transitive dependency: transitive
description: description:
name: async name: async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.4.0" version: "2.4.1"
barcode_scan:
dependency: "direct main"
description:
name: barcode_scan
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
bazel_worker: bazel_worker:
dependency: transitive dependency: transitive
description: description:
@ -49,7 +56,7 @@ packages:
name: boolean_selector name: boolean_selector
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.5" version: "2.0.0"
build: build:
dependency: transitive dependency: transitive
description: description:
@ -126,7 +133,21 @@ packages:
name: charcode name: charcode
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.2" version: "1.1.3"
charts_common:
dependency: transitive
description:
name: charts_common
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.0"
charts_flutter:
dependency: "direct main"
description:
name: charts_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "0.9.0"
checked_yaml: checked_yaml:
dependency: transitive dependency: transitive
description: description:
@ -147,7 +168,7 @@ packages:
name: collection name: collection
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.14.11" version: "1.14.12"
connectivity: connectivity:
dependency: "direct main" dependency: "direct main"
description: description:
@ -182,7 +203,7 @@ packages:
name: crypto name: crypto
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.3" version: "2.1.4"
csslib: csslib:
dependency: transitive dependency: transitive
description: description:
@ -308,6 +329,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.1.4" version: "3.1.4"
image:
dependency: transitive
description:
name: image
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.12"
imei_plugin: imei_plugin:
dependency: "direct main" dependency: "direct main"
description: description:
@ -434,6 +462,20 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.1+1" version: "2.1.1+1"
permission_handler:
dependency: "direct main"
description:
name: permission_handler
url: "https://pub.dartlang.org"
source: hosted
version: "5.0.0+hotfix.5"
permission_handler_platform_interface:
dependency: transitive
description:
name: permission_handler_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
petitparser: petitparser:
dependency: transitive dependency: transitive
description: description:
@ -503,7 +545,7 @@ packages:
name: quiver name: quiver
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.5" version: "2.1.3"
scratch_space: scratch_space:
dependency: transitive dependency: transitive
description: description:
@ -571,7 +613,7 @@ packages:
name: source_span name: source_span
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.5.5" version: "1.7.0"
stack_trace: stack_trace:
dependency: transitive dependency: transitive
description: description:
@ -613,7 +655,7 @@ packages:
name: test_api name: test_api
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.2.11" version: "0.2.15"
timing: timing:
dependency: transitive dependency: transitive
description: description:
@ -683,7 +725,7 @@ packages:
name: xml name: xml
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.5.0" version: "3.6.1"
yaml: yaml:
dependency: transitive dependency: transitive
description: description:

@ -37,6 +37,12 @@ dependencies:
url_launcher: ^5.4.5 url_launcher: ^5.4.5
charts_flutter: ^0.9.0 charts_flutter: ^0.9.0
# Qr code Scanner
barcode_scan: ^3.0.1
# permissions
permission_handler: ^5.0.0+hotfix.3
# The following adds the Cupertino Icons font to your application. # The following adds the Cupertino Icons font to your application.
@ -86,6 +92,8 @@ flutter:
- assets/images/lab.png - assets/images/lab.png
- assets/images/note.png - assets/images/note.png
- assets/images/radiology-1.png - assets/images/radiology-1.png
- assets/images/qr_code.png
- assets/images/qr_code_white.png
# - images/a_dot_ham.jpeg # - images/a_dot_ham.jpeg

Loading…
Cancel
Save