Merge branch 'development_new_design_2.0' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into sultan_new_design

merge-requests/431/head
Sultan Khan 4 years ago
commit 549ddfdbb9

@ -1492,5 +1492,7 @@ const Map localizedValues = {
"rateAppointment": {"en": "Rate Appointment", "ar": "سعر التعيين"}, "rateAppointment": {"en": "Rate Appointment", "ar": "سعر التعيين"},
"noInsuranceCardAttached": {"en": "Please attach your insurance card image to continue", "ar": "يرجى إرفاق صورة بطاقة التأمين الخاصة بك للمتابعة"}, "noInsuranceCardAttached": {"en": "Please attach your insurance card image to continue", "ar": "يرجى إرفاق صورة بطاقة التأمين الخاصة بك للمتابعة"},
"bodyMassIndex": {"en": "Body Mass Index is: ", "ar": "مؤشر كتلة الجسم هو:"}, "bodyMassIndex": {"en": "Body Mass Index is: ", "ar": "مؤشر كتلة الجسم هو:"},
"noSlotsError": {"en": "No appointments available for selected date", "ar": "لا توجد مواعيد متاحة للتاريخ المحدد"},
"selectSlot": {"en": "Please select Time Slot to continue", "ar": "الرجاء تحديد فترة زمنية للمتابعة"},
"years": {"en": "Years", "ar": "سنوات"}, "years": {"en": "Years", "ar": "سنوات"},
}; };

@ -21,6 +21,7 @@ const THEME_VALUE = 'is_vibration';
const MAIN_USER = 'main-user'; const MAIN_USER = 'main-user';
const PHARMACY_LAST_VISITED_PRODUCTS = 'last-visited'; const PHARMACY_LAST_VISITED_PRODUCTS = 'last-visited';
const PHARMACY_CUSTOMER_ID = 'costumer-id'; const PHARMACY_CUSTOMER_ID = 'costumer-id';
const PHARMACY_CUSTOMER_OBJECT = 'pharmacy-customer-object';
const IS_ROBOT_VISIBLE = 'robot-visible'; const IS_ROBOT_VISIBLE = 'robot-visible';
const IS_ROBOT_INIT = 'robot-init'; const IS_ROBOT_INIT = 'robot-init';
const HMG_GEOFENCES = 'hmg-geo-fences'; const HMG_GEOFENCES = 'hmg-geo-fences';
@ -34,3 +35,4 @@ const H2O_REMINDER = 'H2O_REMINDER';
const LIVECARE_CLINIC_DATA = 'LIVECARE_CLINIC_DATA'; const LIVECARE_CLINIC_DATA = 'LIVECARE_CLINIC_DATA';
const DOCTOR_SCHEDULE_DATE_SEL = 'DOCTOR_SCHEDULE_DATE_SEL'; const DOCTOR_SCHEDULE_DATE_SEL = 'DOCTOR_SCHEDULE_DATE_SEL';
const APPOINTMENT_HISTORY_MEDICAL = 'APPOINTMENT_HISTORY_MEDICAL'; const APPOINTMENT_HISTORY_MEDICAL = 'APPOINTMENT_HISTORY_MEDICAL';
const CLINICS_LIST = 'CLINICS_LIST';

@ -1,16 +1,14 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import '../../../locator.dart';
import '../base_service.dart'; import '../base_service.dart';
class CustomerAddressesService extends BaseService { class CustomerAddressesService extends BaseService {
List<AddressInfo> addressesList = List(); List<AddressInfo> addressesList = List();
CustomerInfo customerInfo; CustomerInfo customerInfo = new CustomerInfo();
Future addAddressInfo({AddNewAddressRequestModel addNewAddressRequestModel}) async { Future addAddressInfo({AddNewAddressRequestModel addNewAddressRequestModel}) async {
addNewAddressRequestModel.customer.email = customerInfo.email; addNewAddressRequestModel.customer.email = customerInfo.email;
@ -40,7 +38,8 @@ class CustomerAddressesService extends BaseService {
Future getCustomerAddresses() async { Future getCustomerAddresses() async {
Map<String, String> queryParams = {'fields': 'addresses'}; Map<String, String> queryParams = {'fields': 'addresses'};
hasError = false; hasError = false;
await baseAppClient.getPharmacy("$BASE_PHARMACY_URL$GET_CUSTOMER_ADDRESSES${customerInfo.customerId}", onSuccess: (dynamic response, int statusCode) { var customerID = await sharedPref.getObject(PHARMACY_CUSTOMER_ID);
await baseAppClient.getPharmacy("$BASE_PHARMACY_URL$GET_CUSTOMER_ADDRESSES$customerID", onSuccess: (dynamic response, int statusCode) {
addressesList.clear(); addressesList.clear();
response["customers"][0]["addresses"].forEach((data) { response["customers"][0]["addresses"].forEach((data) {
addressesList.add(AddressInfo.fromJson(data)); addressesList.add(AddressInfo.fromJson(data));

@ -124,7 +124,7 @@ class BaseAppClient {
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode); onFailure('Error While Fetching data', statusCode);
} else { } else {
// var parsed = json.decode(response.body.toString()); var decoded = utf8.decode(response.bodyBytes);
var parsed = json.decode(utf8.decode(response.bodyBytes)); var parsed = json.decode(utf8.decode(response.bodyBytes));
if (parsed['Response_Message'] != null) { if (parsed['Response_Message'] != null) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);

@ -57,6 +57,7 @@ class PharmacyModuleService extends BaseService {
} else { } else {
customerInfo = CustomerInfo.fromJson(response); customerInfo = CustomerInfo.fromJson(response);
await sharedPref.setObject(PHARMACY_CUSTOMER_ID, customerInfo.customerId);
} }
// await generatePharmacyToken(); // await generatePharmacyToken();
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {

@ -122,16 +122,13 @@ class CMCViewModel extends BaseViewModel {
Future getCustomerInfo() async { Future getCustomerInfo() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _pharmacyModuleService.generatePharmacyToken(); await _pharmacyModuleService.generatePharmacyToken();
// await _pharmacyModuleService.createUser();
if (_customerAddressesService.hasError) { if (_customerAddressesService.hasError) {
error = _customerAddressesService.error; error = _customerAddressesService.error;
await _pharmacyModuleService.createUser(); await _pharmacyModuleService.createUser();
// await _customerAddressesService.getCustomerInfo();
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else { } else {
await _pharmacyModuleService.createUser(); await _pharmacyModuleService.createUser();
// await _customerAddressesService.getCustomerInfo();
await getCustomerAddresses(); await getCustomerAddresses();
} }
} }

@ -105,16 +105,13 @@ class HomeHealthCareViewModel extends BaseViewModel {
Future getCustomerInfo() async { Future getCustomerInfo() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _pharmacyModuleService.generatePharmacyToken(); await _pharmacyModuleService.generatePharmacyToken();
// await _pharmacyModuleService.createUser();
if (_customerAddressesService.hasError) { if (_customerAddressesService.hasError) {
error = _customerAddressesService.error; error = _customerAddressesService.error;
await _pharmacyModuleService.createUser(); await _pharmacyModuleService.createUser();
// await _customerAddressesService.getCustomerInfo();
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else { } else {
await _pharmacyModuleService.createUser(); await _pharmacyModuleService.createUser();
// await _customerAddressesService.getCustomerInfo();
await getCustomerAddresses(); await getCustomerAddresses();
} }
} }

@ -152,14 +152,27 @@ class RRTViewModel extends BaseViewModel {
Future getCustomerInfo() async { Future getCustomerInfo() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _pharmacy_service.generatePharmacyToken(); await _pharmacy_service.generatePharmacyToken();
if (_customerAddressesService.hasError) { if (_customerAddressesService.hasError) {
error = _customerAddressesService.error; error = _customerAddressesService.error;
await _pharmacy_service.createUser(); await _pharmacy_service.createUser();
await getCustomerAddresses();
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else { } else {
await _customerAddressesService.getCustomerInfo(); await _pharmacy_service.createUser();
await getCustomerAddresses(); await getCustomerAddresses();
} }
// setState(ViewState.Busy);
// await _pharmacy_service.generatePharmacyToken();
// if (_customerAddressesService.hasError) {
// error = _customerAddressesService.error;
// await _pharmacy_service.createUser();
// await getCustomerAddresses();
// setState(ViewState.ErrorLocal);
// } else {
// await _customerAddressesService.getCustomerInfo();
// await getCustomerAddresses();
// }
} }
} }

@ -295,12 +295,12 @@ class GetAllSharedRecordsByStatusList {
int iD; int iD;
int patientID; int patientID;
int responseID; int responseID;
Null relationshipID; dynamic relationshipID;
Null relationship; dynamic relationship;
Null relationshipN; dynamic relationshipN;
int regionID; int regionID;
int status; int status;
Null isActive; dynamic isActive;
String editedOn; String editedOn;
String createdOn; String createdOn;
int age; int age;

@ -500,7 +500,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
dialog.showAlertDialog(context); dialog.showAlertDialog(context);
} }
} else } else
AppToast.showErrorToast(message: "Please select Time Slot to continue"); AppToast.showErrorToast(message: TranslationBase.of(context).selectSlot);
} }
navigateToLogin() { navigateToLogin() {

@ -7,11 +7,13 @@ import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:table_calendar/table_calendar.dart';
import 'package:syncfusion_flutter_calendar/calendar.dart';
import '../../../uitl/date_uitl.dart'; import '../../../uitl/date_uitl.dart';
@ -24,6 +26,7 @@ class DocAvailableAppointments extends StatefulWidget {
static String selectedTime; static String selectedTime;
bool isLiveCareAppointment; bool isLiveCareAppointment;
final dynamic doctorSchedule; final dynamic doctorSchedule;
DocAvailableAppointments({@required this.doctor, this.doctorSchedule, @required this.isLiveCareAppointment}); DocAvailableAppointments({@required this.doctor, this.doctorSchedule, @required this.isLiveCareAppointment});
@override @override
@ -55,8 +58,8 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
@override @override
void didUpdateWidget(covariant DocAvailableAppointments oldWidget) { void didUpdateWidget(covariant DocAvailableAppointments oldWidget) {
if (oldWidget.doctorSchedule != widget.doctorSchedule) { if (oldWidget.doctorSchedule != widget.doctorSchedule) {
_calendarController.setSelectedDay(DateUtil.convertStringToDate(widget.doctorSchedule['Date']), isProgrammatic: true); _onDaySelected(DateUtil.convertStringToDate(widget.doctorSchedule['Date']));
_onDaySelected(DateUtil.convertStringToDate(widget.doctorSchedule['Date']), List()); _calendarController.selectedDate = DateUtil.convertStringToDate(widget.doctorSchedule['Date']);
} }
super.didUpdateWidget(oldWidget); super.didUpdateWidget(oldWidget);
} }
@ -99,28 +102,17 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
super.dispose(); super.dispose();
} }
void _onDaySelected(DateTime day, List events) { void _onDaySelected(DateTime day) {
final DateFormat formatter = DateFormat('yyyy-MM-dd'); final DateFormat formatter = DateFormat('yyyy-MM-dd');
setState(() { setState(() {
this.selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(day, language); this.selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(day, language);
openTimeSlotsPickerForDate(day, docFreeSlots); openTimeSlotsPickerForDate(day, docFreeSlots);
DocAvailableAppointments.selectedDate = formatter.format(day); DocAvailableAppointments.selectedDate = formatter.format(day);
print(DocAvailableAppointments.selectedDate); _calendarController.selectedDate = day;
print(_calendarController.selectedDate);
}); });
} }
void _onVisibleDaysChanged(DateTime first, DateTime last, CalendarFormat format) {
print('CALLBACK: _onVisibleDaysChanged');
print(first);
print(last);
}
void _onCalendarCreated(DateTime first, DateTime last, CalendarFormat format) {
print('CALLBACK: _onCalendarCreated');
print(first);
print(last);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SingleChildScrollView( return SingleChildScrollView(
@ -134,7 +126,8 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16), padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16),
child: Text(selectedDate, style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.w600, letterSpacing: -0.64)), child: Text(selectedDate, style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.w600, letterSpacing: -0.64)),
), ),
Container( DocAvailableAppointments.areSlotsAvailable
? Container(
height: 40, height: 40,
child: ListView.builder( child: ListView.builder(
controller: _scrollController, controller: _scrollController,
@ -157,7 +150,12 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
); );
}, },
), ),
), )
: Center(
child: Padding(
padding: const EdgeInsets.only(left: 12.0, right: 12.0),
child: Text(TranslationBase.of(context).noSlotsError, style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: CustomColors.grey)),
)),
], ],
), ),
), ),
@ -171,94 +169,37 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
child: Padding( child: Padding(
padding: const EdgeInsets.only(bottom: 12), padding: const EdgeInsets.only(bottom: 12),
child: TableCalendar(
locale: language == "en" ? 'en_US' : 'ar_SA',
calendarController: _calendarController,
events: _events,
initialCalendarFormat: CalendarFormat.month,
startDay: DateTime.now(),
formatAnimation: FormatAnimation.slide,
startingDayOfWeek: StartingDayOfWeek.sunday,
weekendDays: [DateTime.friday, DateTime.saturday],
availableGestures: AvailableGestures.horizontalSwipe,
availableCalendarFormats: const {
CalendarFormat.month: '',
CalendarFormat.week: '',
},
calendarStyle: CalendarStyle(
outsideDaysVisible: false,
weekendStyle: TextStyle().copyWith(color: Colors.blue[800]),
holidayStyle: TextStyle().copyWith(color: Colors.blue[800]),
),
daysOfWeekStyle: DaysOfWeekStyle(
weekendStyle: TextStyle().copyWith(color: Colors.black, fontSize: 11.0, fontWeight: FontWeight.w600),
weekdayStyle: TextStyle().copyWith(color: Colors.black, fontSize: 11.0, fontWeight: FontWeight.w600),
),
headerStyle: HeaderStyle(centerHeaderTitle: true, formatButtonVisible: false, titleTextStyle: TextStyle(fontSize: 16, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
builders: CalendarBuilders(
selectedDayBuilder: (context, date, _) {
return FadeTransition(
opacity: Tween(begin: 0.0, end: 1.0).animate(_animationController),
child: Container( child: Container(
margin: const EdgeInsets.all(4.0), child: SfCalendar(
padding: const EdgeInsets.only(top: 5.0, left: 5.0), controller: _calendarController,
color: Colors.transparent, minDate: DateTime.now(),
width: 0, showNavigationArrow: true,
height: 0, headerStyle: CalendarHeaderStyle(textAlign: TextAlign.center, textStyle: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, letterSpacing: -0.46)),
child: Text( viewHeaderStyle: ViewHeaderStyle(dayTextStyle: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: CustomColors.black)),
'${date.day}', view: CalendarView.month,
style: TextStyle().copyWith(fontSize: 14.0), todayHighlightColor: CustomColors.green,
), selectionDecoration: containerColorRadiusBorderWidthCircular(Colors.transparent, 4, CustomColors.green, 2.5),
), cellBorderColor: Colors.white,
); dataSource: MeetingDataSource(_getDataSource()),
monthViewSettings: const MonthViewSettings(appointmentDisplayMode: MonthAppointmentDisplayMode.indicator, showTrailingAndLeadingDates: false, appointmentDisplayCount: 1),
onTap: (CalendarTapDetails details) {
_calendarController.selectedDate = details.date;
_onDaySelected(details.date);
}, },
todayDayBuilder: (context, date, _) {
return Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
color: _calendarController.isSelected(date)
? Colors.green[400]
: _calendarController.isToday(date)
? Colors.transparent
: Color(0xff76cfb7),
),
width: 40.0,
height: 40.0,
child: Center(
child: Text(
'${date.day}',
style: TextStyle().copyWith(
color: Colors.white,
fontSize: 14.0,
), ),
), ),
), ));
);
},
markersBuilder: (context, date, events, _) {
final children = <Widget>[];
if (events.isNotEmpty) {
children.add(
Positioned(
right: 4,
bottom: 4,
child: _buildEventsMarker(date, events),
),
);
} }
return children; List<Meeting> _getDataSource() {
}, final List<Meeting> meetings = <Meeting>[];
),
onDaySelected: (date, event, _) { _events.forEach((key, value) {
_onDaySelected(date, event); final DateTime startTime = DateTime(key.year, key.month, key.day, 9, 0, 0);
_animationController.forward(from: 0.0); final DateTime endTime = startTime.add(const Duration(hours: 2));
}, meetings.add(Meeting("", startTime, endTime, CustomColors.green, false));
onVisibleDaysChanged: _onVisibleDaysChanged, });
onCalendarCreated: _onCalendarCreated, return meetings;
),
),
);
} }
openTimeSlotsPickerForDate(DateTime dateStart, List<TimeSlot> freeSlots) { openTimeSlotsPickerForDate(DateTime dateStart, List<TimeSlot> freeSlots) {
@ -270,14 +211,12 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
}); });
setState(() { setState(() {
if (dayEvents.length != 0) if (dayEvents.length != 0) {
DocAvailableAppointments.areSlotsAvailable = true; DocAvailableAppointments.areSlotsAvailable = true;
else
DocAvailableAppointments.areSlotsAvailable = false;
selectedButtonIndex = 0; selectedButtonIndex = 0;
DocAvailableAppointments.selectedTime = dayEvents[selectedButtonIndex].isoTime; DocAvailableAppointments.selectedTime = dayEvents[selectedButtonIndex].isoTime;
} else
DocAvailableAppointments.areSlotsAvailable = false;
}); });
} }
@ -299,7 +238,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
selectedDateJSON = freeSlotsResponse[0]; selectedDateJSON = freeSlotsResponse[0];
}); });
openTimeSlotsPickerForDate(DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots); openTimeSlotsPickerForDate(DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots);
_calendarController.setFocusedDay(DateUtil.convertStringToDate(selectedDateJSON)); _calendarController.selectedDate = DateUtil.convertStringToDate(selectedDateJSON);
return _eventsParsed; return _eventsParsed;
} }
@ -321,7 +260,8 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
Widget getSelectedButton(int index) { Widget getSelectedButton(int index) {
return RaisedButton( return RaisedButton(
color: CustomColors.green, //Color of the border color: CustomColors.green,
//Color of the border
textColor: Colors.white, textColor: Colors.white,
elevation: 0, elevation: 0,
onPressed: () { onPressed: () {
@ -352,10 +292,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
_events.clear(), _events.clear(),
_events = value, _events = value,
if (widget.doctorSchedule != null) if (widget.doctorSchedule != null)
{ {_onDaySelected(DateUtil.convertStringToDate(widget.doctorSchedule['Date'])), _calendarController.selectedDate = DateUtil.convertStringToDate(widget.doctorSchedule['Date'])}
_calendarController.setSelectedDay(DateUtil.convertStringToDate(widget.doctorSchedule['Date']), isProgrammatic: true),
_onDaySelected(DateUtil.convertStringToDate(widget.doctorSchedule['Date']), List())
}
}); });
}); });
} else { } else {
@ -403,29 +340,49 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
this.language = languageID; this.language = languageID;
}); });
} }
}
class MeetingDataSource extends CalendarDataSource {
MeetingDataSource(List<Meeting> source) {
appointments = source;
}
Widget _buildEventsMarker(DateTime date, List events) { @override
return Container( DateTime getStartTime(int index) {
decoration: containerColorRadiusBorderWidth( return _getMeetingData(index).from;
_calendarController.isSelected(date) }
? CustomColors.green @override
: _calendarController.isToday(date) DateTime getEndTime(int index) {
? CustomColors.green.withOpacity(0.5) return _getMeetingData(index).to;
: Colors.white, }
200, @override
_calendarController.isSelected(date) ? CustomColors.green : Colors.black, String getSubject(int index) {
2), return _getMeetingData(index).eventName;
width: 40.0, }
height: 40.0, @override
child: Center( Color getColor(int index) {
child: Text( return _getMeetingData(index).background;
'${date.day}',
style: TextStyle().copyWith(
color: _calendarController.isSelected(date) ? Colors.white : Colors.black,
fontSize: 14.0,
),
),
),
);
} }
@override
bool isAllDay(int index) {
return _getMeetingData(index).isAllDay;
}
Meeting _getMeetingData(int index) {
final dynamic meeting = appointments[index];
Meeting meetingData;
if (meeting is Meeting) {
meetingData = meeting;
}
return meetingData;
}
}
class Meeting {
Meeting(this.eventName, this.from, this.to, this.background, this.isAllDay);
String eventName;
DateTime from;
DateTime to;
Color background;
bool isAllDay;
} }

@ -1,5 +1,6 @@
import "dart:collection"; import "dart:collection";
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
@ -429,8 +430,19 @@ class _SearchByClinicState extends State<SearchByClinic> {
return false; return false;
} }
getClinicsList() { getClinicsList() async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
if (await sharedPref.getObject(CLINICS_LIST) != null) {
dynamic res = await sharedPref.getObject(CLINICS_LIST);
setState(() {
isMobileAppDentalAllow = res['ISMobileAppDentalAllow'];
res['ListClinicCentralized'].forEach((v) {
clinicsList.add(new ListClinicCentralized.fromJson(v));
});
});
getProjectsList();
GifLoaderDialogUtils.hideDialog(context);
} else {
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getClinicsList(context).then((res) { service.getClinicsList(context).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
@ -448,6 +460,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}); });
} }
}
getProjectsList() { getProjectsList() {
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();

@ -21,10 +21,11 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:table_calendar/table_calendar.dart'; // import 'package:table_calendar/table_calendar.dart';
import 'package:syncfusion_flutter_calendar/calendar.dart';
class CovidTimeSlots extends StatefulWidget { class CovidTimeSlots extends StatefulWidget {
int projectID; int projectID;
@ -100,24 +101,17 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
super.dispose(); super.dispose();
} }
void _onDaySelected(DateTime day, List events, ProjectViewModel projectViewModel) { void _onDaySelected(DateTime day, ProjectViewModel projectViewModel) {
final DateFormat formatter = DateFormat('yyyy-MM-dd'); final DateFormat formatter = DateFormat('yyyy-MM-dd');
setState(() { setState(() {
this.selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(day, projectViewModel.isArabic ? "ar" : "en"); this.selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(day, projectViewModel.isArabic ? "ar" : "en");
openTimeSlotsPickerForDate(day, docFreeSlots); openTimeSlotsPickerForDate(day, docFreeSlots);
CovidTimeSlots.selectedDate = formatter.format(day); CovidTimeSlots.selectedDate = formatter.format(day);
_calendarController.selectedDate = day;
print(CovidTimeSlots.selectedDate); print(CovidTimeSlots.selectedDate);
}); });
} }
void _onVisibleDaysChanged(DateTime first, DateTime last, CalendarFormat format) {
print('CALLBACK: _onVisibleDaysChanged');
}
void _onCalendarCreated(DateTime first, DateTime last, CalendarFormat format) {
print('CALLBACK: _onCalendarCreated');
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
@ -151,6 +145,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
mHeight(12),
Card( Card(
shape: cardRadius(12), shape: cardRadius(12),
child: _buildTableCalendarWithBuilders(projectViewModel), child: _buildTableCalendarWithBuilders(projectViewModel),
@ -165,7 +160,8 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
), ),
), ),
mHeight(8), mHeight(8),
Container( CovidTimeSlots.areSlotsAvailable
? Container(
height: 40, height: 40,
child: ListView.builder( child: ListView.builder(
controller: _scrollController, controller: _scrollController,
@ -188,7 +184,12 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
); );
}, },
), ),
), )
: Center(
child: Padding(
padding: const EdgeInsets.only(left: 12.0, right: 12.0),
child: Text(TranslationBase.of(context).noSlotsError, style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: CustomColors.grey)),
)),
], ],
), ),
), ),
@ -239,93 +240,33 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
} }
Widget _buildTableCalendarWithBuilders(ProjectViewModel projectViewModel) { Widget _buildTableCalendarWithBuilders(ProjectViewModel projectViewModel) {
return TableCalendar( return SfCalendar(
locale: projectViewModel.isArabic ? 'ar_SA' : 'en_US', controller: _calendarController,
calendarController: _calendarController, minDate: DateTime.now(),
events: _events, showNavigationArrow: true,
initialCalendarFormat: CalendarFormat.month, headerStyle: CalendarHeaderStyle(textAlign: TextAlign.center, textStyle: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, letterSpacing: -0.46)),
startDay: DateTime.now(), viewHeaderStyle: ViewHeaderStyle(dayTextStyle: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: CustomColors.black)),
formatAnimation: FormatAnimation.slide, view: CalendarView.month,
startingDayOfWeek: StartingDayOfWeek.sunday, todayHighlightColor: CustomColors.green,
weekendDays: [DateTime.friday, DateTime.saturday], selectionDecoration: containerColorRadiusBorderWidthCircular(Colors.transparent, 4, CustomColors.green, 2.5),
availableGestures: AvailableGestures.horizontalSwipe, cellBorderColor: Colors.white,
availableCalendarFormats: const { dataSource: MeetingDataSource(_getDataSource()),
CalendarFormat.month: '', monthViewSettings: const MonthViewSettings(appointmentDisplayMode: MonthAppointmentDisplayMode.indicator, showTrailingAndLeadingDates: false, appointmentDisplayCount: 1),
CalendarFormat.week: '', onTap: (CalendarTapDetails details) {
}, _calendarController.selectedDate = details.date;
calendarStyle: CalendarStyle( _onDaySelected(details.date, projectViewModel);
outsideDaysVisible: false,
weekendStyle: TextStyle().copyWith(color: Colors.blue[800]),
holidayStyle: TextStyle().copyWith(color: Colors.blue[800]),
),
daysOfWeekStyle: DaysOfWeekStyle(
weekendStyle: TextStyle().copyWith(color: Colors.black, fontSize: 11.0, fontWeight: FontWeight.w600),
weekdayStyle: TextStyle().copyWith(color: Colors.black, fontSize: 11.0, fontWeight: FontWeight.w600),
),
headerStyle: HeaderStyle(centerHeaderTitle: true, formatButtonVisible: false, titleTextStyle: TextStyle(fontSize: 16, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
builders: CalendarBuilders(
selectedDayBuilder: (context, date, _) {
return FadeTransition(
opacity: Tween(begin: 0.0, end: 1.0).animate(_animationController),
child: Container(
margin: const EdgeInsets.all(4.0),
padding: const EdgeInsets.only(top: 5.0, left: 6.0),
color: Colors.transparent,
width: 0,
height: 0,
child: Text(
'${date.day}',
style: TextStyle().copyWith(fontSize: 14.0),
),
),
);
},
todayDayBuilder: (context, date, _) {
return Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
color: _calendarController.isSelected(date)
? Colors.green[400]
: _calendarController.isToday(date)
? Colors.transparent
: Color(0xff76cfb7),
),
width: 40.0,
height: 40.0,
child: Center(
child: Text(
'${date.day}',
style: TextStyle().copyWith(
color: Colors.white,
fontSize: 14.0,
),
),
),
);
}, },
markersBuilder: (context, date, events, holidays) {
final children = <Widget>[];
if (events.isNotEmpty) {
children.add(
Positioned(
right: 4,
bottom: 4,
child: _buildEventsMarker(date, events),
),
); );
} }
return children; List<Meeting> _getDataSource() {
}, final List<Meeting> meetings = <Meeting>[];
), _events.forEach((key, value) {
onDaySelected: (date, event, _) { final DateTime startTime = DateTime(key.year, key.month, key.day, 9, 0, 0);
_onDaySelected(date, event, projectViewModel); final DateTime endTime = startTime.add(const Duration(hours: 2));
_animationController.forward(from: 0.0); meetings.add(Meeting("", startTime, endTime, CustomColors.green, false));
}, });
onVisibleDaysChanged: _onVisibleDaysChanged, return meetings;
onCalendarCreated: _onCalendarCreated,
);
} }
openTimeSlotsPickerForDate(DateTime dateStart, List<TimeSlot> freeSlots) { openTimeSlotsPickerForDate(DateTime dateStart, List<TimeSlot> freeSlots) {
@ -337,14 +278,12 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
}); });
setState(() { setState(() {
if (dayEvents.length != 0) if (dayEvents.length != 0) {
CovidTimeSlots.areSlotsAvailable = true; CovidTimeSlots.areSlotsAvailable = true;
else
CovidTimeSlots.areSlotsAvailable = false;
selectedButtonIndex = 0; selectedButtonIndex = 0;
CovidTimeSlots.selectedTime = dayEvents[selectedButtonIndex].isoTime; CovidTimeSlots.selectedTime = dayEvents[selectedButtonIndex].isoTime;
} else
CovidTimeSlots.areSlotsAvailable = false;
}); });
} }
@ -366,43 +305,43 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
selectedDateJSON = freeSlotsResponse[0]['FreeTimeSlots']; selectedDateJSON = freeSlotsResponse[0]['FreeTimeSlots'];
}); });
openTimeSlotsPickerForDate(DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots); openTimeSlotsPickerForDate(DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots);
_calendarController.setFocusedDay(DateUtil.convertStringToDate(selectedDateJSON)); _calendarController.selectedDate = DateUtil.convertStringToDate(selectedDateJSON);
return _eventsParsed; return _eventsParsed;
} }
Widget _buildEventsMarker(DateTime date, List events) { // Widget _buildEventsMarker(DateTime date, List events) {
return Container( // return Container(
// decoration: BoxDecoration( // // decoration: BoxDecoration(
// shape: BoxShape.circle, // // shape: BoxShape.circle,
// color: _calendarController.isSelected(date) // // color: _calendarController.isSelected(date)
// ? Colors.green[400] // // ? Colors.green[400]
// // : _calendarController.isToday(date)
// // ? Colors.brown[300]
// // : Colors.blue[400],
// // ),
//
// decoration: containerColorRadiusBorderWidth(
// _calendarController.isSelected(date)
// ? CustomColors.green
// : _calendarController.isToday(date) // : _calendarController.isToday(date)
// ? Colors.brown[300] // ? CustomColors.green.withOpacity(0.5)
// : Colors.blue[400], // : Colors.white,
// 200,
// _calendarController.isSelected(date) ? CustomColors.green : Colors.black,
// 2),
// width: 40.0,
// height: 40.0,
// child: Center(
// child: Text(
// '${date.day}',
// style: TextStyle().copyWith(
// color: _calendarController.isSelected(date) ? Colors.white : Colors.black,
// fontSize: 13.0,
// ), // ),
// ),
decoration: containerColorRadiusBorderWidth( // ),
_calendarController.isSelected(date) // );
? CustomColors.green // }
: _calendarController.isToday(date)
? CustomColors.green.withOpacity(0.5)
: Colors.white,
200,
_calendarController.isSelected(date) ? CustomColors.green : Colors.black,
2),
width: 40.0,
height: 40.0,
child: Center(
child: Text(
'${date.day}',
style: TextStyle().copyWith(
color: _calendarController.isSelected(date) ? Colors.white : Colors.black,
fontSize: 13.0,
),
),
),
);
}
Widget getNormalButton(int index) { Widget getNormalButton(int index) {
return RaisedButton( return RaisedButton(
@ -436,12 +375,16 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
} }
bookCovidTestAppointment() { bookCovidTestAppointment() {
if(CovidTimeSlots.areSlotsAvailable) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorList docObject = new DoctorList(); DoctorList docObject = new DoctorList();
docObject.doctorID = widget.selectedDoctorID; docObject.doctorID = widget.selectedDoctorID;
docObject.clinicID = widget.selectedClinicID; docObject.clinicID = widget.selectedClinicID;
docObject.projectID = widget.projectID; docObject.projectID = widget.projectID;
insertAppointmentCovidTest(context, docObject); insertAppointmentCovidTest(context, docObject);
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).selectSlot);
}
} }
insertAppointmentCovidTest(context, DoctorList docObject) { insertAppointmentCovidTest(context, DoctorList docObject) {
@ -560,3 +503,53 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
}); });
} }
} }
class MeetingDataSource extends CalendarDataSource {
MeetingDataSource(List<Meeting> source) {
appointments = source;
}
@override
DateTime getStartTime(int index) {
return _getMeetingData(index).from;
}
@override
DateTime getEndTime(int index) {
return _getMeetingData(index).to;
}
@override
String getSubject(int index) {
return _getMeetingData(index).eventName;
}
@override
Color getColor(int index) {
return _getMeetingData(index).background;
}
@override
bool isAllDay(int index) {
return _getMeetingData(index).isAllDay;
}
Meeting _getMeetingData(int index) {
final dynamic meeting = appointments[index];
Meeting meetingData;
if (meeting is Meeting) {
meetingData = meeting;
}
return meetingData;
}
}
class Meeting {
Meeting(this.eventName, this.from, this.to, this.background, this.isAllDay);
String eventName;
DateTime from;
DateTime to;
Color background;
bool isAllDay;
}

@ -145,7 +145,6 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
itemBuilder: (ctx, idx) { itemBuilder: (ctx, idx) {
var obj = qa[idx]; var obj = qa[idx];
var qtext = isArabic ? obj["questionAR"] : obj["questionEN"]; var qtext = isArabic ? obj["questionAR"] : obj["questionEN"];
print("dddddddddddddd " + obj["ans"].toString());
return Padding( return Padding(
padding: const EdgeInsets.symmetric(vertical: 10), padding: const EdgeInsets.symmetric(vertical: 10),

@ -12,7 +12,8 @@ import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart' as list; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'
as list;
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart'; import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart';
@ -51,12 +52,15 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
var userID; var userID;
TabController _tabController; TabController _tabController;
int _tabIndex = 0; int _tabIndex = 0;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject =
AppointmentRateViewModel appointmentRateViewModel = locator<AppointmentRateViewModel>(); locator<AuthenticatedUserObject>();
AppointmentRateViewModel appointmentRateViewModel =
locator<AppointmentRateViewModel>();
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
AuthenticatedUser user; AuthenticatedUser user;
VitalSignService _vitalSignService = locator<VitalSignService>(); VitalSignService _vitalSignService = locator<VitalSignService>();
PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>(); PharmacyModuleViewModel pharmacyModuleViewModel =
locator<PharmacyModuleViewModel>();
ToDoCountProviderModel toDoProvider; ToDoCountProviderModel toDoProvider;
var isVaiable = false; var isVaiable = false;
bool isSwitchUser = false; bool isSwitchUser = false;
@ -73,12 +77,18 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
Widget build(BuildContext context) { Widget build(BuildContext context) {
imagesInfo.add( imagesInfo.add(
ImagesInfo( ImagesInfo(
imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/0.png'), imageEn:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/0.png'),
); );
imagesInfo.add( imagesInfo.add(
ImagesInfo( ImagesInfo(
imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/1.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/1.png'), imageEn:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/1.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/1.png'),
); );
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
toDoProvider = Provider.of<ToDoCountProviderModel>(context); toDoProvider = Provider.of<ToDoCountProviderModel>(context);
@ -90,65 +100,16 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
showNewAppBarTitle: true, showNewAppBarTitle: true,
icon: "assets/images/new/bottom_nav/family_files.svg", icon: "assets/images/new/bottom_nav/family_files.svg",
description: TranslationBase.of(context).familyInfo, description: TranslationBase.of(context).familyInfo,
body: Scaffold( body: Column(
extendBodyBehindAppBar: true, children: [
appBar: PreferredSize(
preferredSize: Size.fromHeight(65.0),
child: Stack(
children: <Widget>[
// Positioned(
// bottom: 1,
// left: 0,
// right: 0,
// child: BackdropFilter(
// filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
// child: Container(
// color: Theme.of(context).scaffoldBackgroundColor.withOpacity(0.8),
// height: 70.0,
// ),
// ),
// ),
// Center(
// child: Container(
// height: 60.0,
// // margin: EdgeInsets.only(top: 10.0),
// width: MediaQuery.of(context).size.width * 0.92, // 0.9,
// decoration: BoxDecoration(
// border: Border(
// bottom: BorderSide(color: Theme.of(context).dividerColor, width: 0.9), //width: 0.7
// ),
// color: Colors.white),
Center(
child:
// TabBar(
// isScrollable: true,
// controller: _tabController,
// indicatorWeight: 5.0,
// indicatorSize: TabBarIndicatorSize.tab,
// labelPadding: EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0),
// unselectedLabelColor: Colors.grey[800],
// tabs: [
// Container(
// width: MediaQuery.of(context).size.width * 0.30,
// child: Center(
// child: AppText(TranslationBase.of(context).family),
// ),
// ),
// Container(
// width: MediaQuery.of(context).size.width * 0.30,
// child: Center(
// child: AppText(TranslationBase.of(context).request),
// ),
// ),
// ],
// ),
TabBar( TabBar(
controller: _tabController, controller: _tabController,
indicatorWeight: 3.0, indicatorWeight: 3.0,
indicatorSize: TabBarIndicatorSize.tab, indicatorSize: TabBarIndicatorSize.tab,
labelColor: Color(0xff2B353E), labelColor: Color(0xff2B353E),
unselectedLabelColor: Color(0xff575757), unselectedLabelColor: Color(0xff575757),
labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), labelPadding:
EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
labelStyle: TextStyle( labelStyle: TextStyle(
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
fontSize: 16, fontSize: 16,
@ -161,25 +122,23 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.48, letterSpacing: -0.48,
), ),
tabs: [Text(TranslationBase.of(context).family), Text(TranslationBase.of(context).request)], tabs: [
), Text(TranslationBase.of(context).family),
), Text(TranslationBase.of(context).request)
// ),
// ),
], ],
), ),
),
body: Column(
children: <Widget>[
Expanded( Expanded(
child: (user != null && projectViewModel.isLogin) child: (user != null && projectViewModel.isLogin)
? TabBarView( ? TabBarView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
controller: _tabController, controller: _tabController,
children: [myFamilyDetails(context), myFamilyRequest(context)], children: [
myFamilyDetails(context),
myFamilyRequest(context)
],
) )
: Container(child: AppText('Loading..')), : Container(child: AppText('Loading..')),
) ),
], ],
), ),
bottomSheet: Container( bottomSheet: Container(
@ -193,70 +152,107 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
}, },
), ),
), ),
),
); );
} }
Widget myFamilyDetails(context) { Widget myFamilyDetails(context) {
return Container( return Container(
height: MediaQuery.of(context).size.height, margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 0.0),
margin: EdgeInsets.fromLTRB(20.0, 25.0, 20.0, 0.0),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 4, flex: 4,
child: FutureBuilder( child: FutureBuilder(
future: getFamilyFiles(), // async work future: getFamilyFiles(), // async work
builder: (BuildContext context, AsyncSnapshot<GetAllSharedRecordsByStatusResponse> snapshot) { builder: (BuildContext context,
AsyncSnapshot<GetAllSharedRecordsByStatusResponse>
snapshot) {
switch (snapshot.connectionState) { switch (snapshot.connectionState) {
case ConnectionState.waiting: case ConnectionState.waiting:
return Padding(padding: EdgeInsets.only(top: 50), child: Text('Loading....')); return Padding(
padding: EdgeInsets.only(top: 50),
child: Text('Loading....'));
default: default:
if (snapshot.hasError) if (snapshot.hasError)
return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable));
else
return Padding( return Padding(
padding: EdgeInsets.only(top: 50), padding: EdgeInsets.all(10),
child: Column(children: <Widget>[ child: Text(
// Row( TranslationBase.of(context).noDataAvailable));
// mainAxisAlignment: MainAxisAlignment.spaceBetween, else
// children: <Widget>[ return ListView.separated(
// Expanded( itemBuilder: (context, index) {
// flex: 3, if (snapshot
// child: Texts( .data
// TranslationBase.of(context).request, .getAllSharedRecordsByStatusList[index]
// textAlign: TextAlign.center, .status ==
// )), 3)
// Expanded(flex: 2, child: Texts(TranslationBase.of(context).switchUser, textAlign: TextAlign.center)), return Card(
// Expanded(flex: 1, child: Texts(TranslationBase.of(context).deleteView, textAlign: TextAlign.center)),
// ],
// ),
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: snapshot.data.getAllSharedRecordsByStatusList.map<Widget>((result) {
return result.status == 3
? Card(
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
shape: cardRadius(15), shape: cardRadius(15),
color: result.gender == 1 ? Color(0xff6EA8FF) : Color(0xffFDA4B0), color: snapshot
.data
.getAllSharedRecordsByStatusList[
index]
.gender ==
1
? Color(0xff6EA8FF)
: Color(0xffFDA4B0),
elevation: 3, elevation: 3,
child: Container( child: Container(
// height: 130, // height: 130,
width: MediaQuery.of(context).size.width, width:
MediaQuery.of(context).size.width,
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Texts( Texts(
result.patientName.toLowerCase().capitalizeFirstofEach, snapshot
.data
.getAllSharedRecordsByStatusList[
index]
.patientName
.toLowerCase()
.capitalizeFirstofEach,
fontSize: 22, fontSize: 22,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.white, color: Colors.white,
), ),
Texts(TranslationBase.of(context).fileNumber + ': ' + result.responseID.toString(), fontSize: 12, color: Colors.white), Texts(
Texts(result.age.toString() + ' ' + TranslationBase.of(context).years + ', ' + result.genderDescription, fontSize: 12, color: Colors.white), TranslationBase.of(context)
.fileNumber +
': ' +
snapshot
.data
.getAllSharedRecordsByStatusList[
index]
.responseID
.toString(),
fontSize: 12,
color: Colors.white),
Texts(
snapshot
.data
.getAllSharedRecordsByStatusList[
index]
.age
.toString() +
' ' +
TranslationBase.of(context)
.years +
', ' +
snapshot
.data
.getAllSharedRecordsByStatusList[
index]
.genderDescription,
fontSize: 12,
color: Colors.white),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [ children: [
Row( Row(
children: [ children: [
@ -266,11 +262,19 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
setState(() { setState(() {
isSwitchUser = value; isSwitchUser = value;
}); });
if (isSwitchUser == true) switchUser(result, context); if (isSwitchUser ==
true)
switchUser(
snapshot.data
.getAllSharedRecordsByStatusList[
index],
context);
}, },
), ),
Texts( Texts(
TranslationBase.of(context).switchUser, TranslationBase.of(
context)
.switchUser,
color: Colors.white, color: Colors.white,
fontSize: 12, fontSize: 12,
) )
@ -278,12 +282,18 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
deleteFamily(result, context); deleteFamily(
snapshot.data
.getAllSharedRecordsByStatusList[
index],
context);
}, },
child: Row( child: Row(
children: [ children: [
Texts( Texts(
TranslationBase.of(context).delete, TranslationBase.of(
context)
.delete,
color: Colors.white, color: Colors.white,
fontSize: 12, fontSize: 12,
), ),
@ -295,54 +305,20 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
)) ))
], ],
) )
// Expanded(
// flex: 2,
// child: IconButton(
// icon: Icon(Icons.group),
// color: Colors.black,
// onPressed: () {
// switchUser(result, context);
// },
// )),
// Expanded(
// flex: 1,
// child: IconButton(
// icon: Icon(
// Icons.delete,
// color: Colors.black,
// ),
// onPressed: () {
// deleteFamily(result, context);
// },
// )),
], ],
))) )));
: SizedBox(); else
}).toList()) return SizedBox.shrink();
])); },
separatorBuilder: (context, index) =>
SizedBox(height: 0),
itemCount: snapshot
.data.getAllSharedRecordsByStatusList.length);
} }
}, },
), ),
), ),
// Expanded( SizedBox(height: 80.0)
// flex: 1,
// child: Column(
// mainAxisAlignment: MainAxisAlignment.end,
// children: <Widget>[
// Row(
// children: <Widget>[
// Expanded(
// child: DefaultButton(
// TranslationBase.of(context).addFamilyMember,
// () => {Navigator.of(context).pushNamed(ADD_FAMILY_MEMBER_TYPE)},
// color: Colors.grey[900],
// textColor: Colors.white,
// ))
// ],
// ),
// ],
// ),
// )
], ],
)); ));
} }
@ -354,25 +330,34 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
SingleChildScrollView( SingleChildScrollView(
child: Container( child: Container(
height: MediaQuery.of(context).size.height, height: MediaQuery.of(context).size.height,
margin: EdgeInsets.only(top: 65), margin: EdgeInsets.only(top: 10),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
RoundedContainer( RoundedContainer(
child: ExpansionTile( child: ExpansionTile(
title: Text( title: Text(
TranslationBase.of(context).userViewRequest, TranslationBase.of(context).userViewRequest,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, color: Colors.black), style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.bold,
color: Colors.black),
), ),
children: <Widget>[ children: <Widget>[
FutureBuilder( FutureBuilder(
future: getUserViewRequest(), // async work future: getUserViewRequest(), // async work
builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) { builder: (BuildContext context,
AsyncSnapshot<dynamic> snapshot) {
switch (snapshot.connectionState) { switch (snapshot.connectionState) {
case ConnectionState.waiting: case ConnectionState.waiting:
return Padding(padding: EdgeInsets.only(top: 50), child: Text('Loading....')); return Padding(
padding: EdgeInsets.only(top: 50),
child: Text('Loading....'));
default: default:
if (snapshot.hasError) if (snapshot.hasError)
return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable)); return Padding(
padding: EdgeInsets.all(10),
child: Text(TranslationBase.of(context)
.noDataAvailable));
else else
return Container( return Container(
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
@ -385,27 +370,60 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
Padding( Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row(children: [ child: Row(children: [
Expanded(flex: 3, child: AppText(TranslationBase.of(context).name, fontWeight: FontWeight.w600)), Expanded(
Expanded(flex: 1, child: AppText(TranslationBase.of(context).allow, fontWeight: FontWeight.w600)), flex: 3,
Expanded(flex: 1, child: AppText(TranslationBase.of(context).reject, fontWeight: FontWeight.w600)), child: AppText(
TranslationBase.of(
context)
.name,
fontWeight:
FontWeight.w600)),
Expanded(
flex: 1,
child: AppText(
TranslationBase.of(
context)
.allow,
fontWeight:
FontWeight.w600)),
Expanded(
flex: 1,
child: AppText(
TranslationBase.of(
context)
.reject,
fontWeight:
FontWeight.w600)),
])), ])),
Divider(color: Colors.black, height: 1), Divider(
color: Colors.black, height: 1),
Column( Column(
children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map<Widget>((result) { children: familyFileProvider
.allSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList
.map<Widget>((result) {
return Container( return Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Expanded(flex: 3, child: Text(result.patientName)), Expanded(
flex: 3,
child: Text(result
.patientName)),
Expanded( Expanded(
flex: 1, flex: 1,
child: IconButton( child: IconButton(
icon: Icon( icon: Icon(
Icons.check_circle, Icons
color: Colors.black, .check_circle,
color:
Colors.black,
), ),
onPressed: () { onPressed: () {
acceptRemoveRequest(result.iD, 3, context); acceptRemoveRequest(
result.iD,
3,
context);
}, },
)), )),
Expanded( Expanded(
@ -413,10 +431,14 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
child: IconButton( child: IconButton(
icon: Icon( icon: Icon(
Icons.delete, Icons.delete,
color: Colors.black, color:
Colors.black,
), ),
onPressed: () { onPressed: () {
acceptRemoveRequest(result.iD, 4, context); acceptRemoveRequest(
result.iD,
4,
context);
}, },
)) ))
], ],
@ -434,18 +456,28 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
child: ExpansionTile( child: ExpansionTile(
title: Text( title: Text(
TranslationBase.of(context).sentRequest, TranslationBase.of(context).sentRequest,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, color: Colors.black), style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.bold,
color: Colors.black),
), ),
children: <Widget>[ children: <Widget>[
FutureBuilder( FutureBuilder(
future: getSentRequest(), // async work future: getSentRequest(), // async work
builder: (BuildContext context, AsyncSnapshot<GetAllSharedRecordsByStatusResponse> snapshot) { builder: (BuildContext context,
AsyncSnapshot<GetAllSharedRecordsByStatusResponse>
snapshot) {
switch (snapshot.connectionState) { switch (snapshot.connectionState) {
case ConnectionState.waiting: case ConnectionState.waiting:
return Padding(padding: EdgeInsets.only(top: 50), child: Text('Loading....')); return Padding(
padding: EdgeInsets.only(top: 50),
child: Text('Loading....'));
default: default:
if (snapshot.hasError) if (snapshot.hasError)
return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable)); return Padding(
padding: EdgeInsets.all(10),
child: Text(TranslationBase.of(context)
.noDataAvailable));
else else
return Container( return Container(
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
@ -459,22 +491,45 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
Padding( Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row(children: [ child: Row(children: [
Expanded(flex: 3, child: AppText(TranslationBase.of(context).theName, fontWeight: FontWeight.w600)), Expanded(
Expanded(flex: 2, child: AppText(TranslationBase.of(context).status, fontWeight: FontWeight.w600)) flex: 3,
child: AppText(
TranslationBase.of(
context)
.theName,
fontWeight:
FontWeight.w600)),
Expanded(
flex: 2,
child: AppText(
TranslationBase.of(
context)
.status,
fontWeight:
FontWeight.w600))
])), ])),
Divider(color: Colors.black, height: 1), Divider(color: Colors.black, height: 1),
Column( Column(
children: snapshot.data.getAllSharedRecordsByStatusList.map<Widget>((result) { children: snapshot.data
.getAllSharedRecordsByStatusList
.map<Widget>((result) {
return Padding( return Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Expanded(flex: 3, child: Text(result.patientName)), Expanded(
flex: 3,
child: Text(result
.patientName)),
Expanded( Expanded(
flex: 2, flex: 2,
child: AppText( child: AppText(
result.statusDescription, result
color: result.status == 3 ? Colors.green : Colors.red, .statusDescription,
color:
result.status == 3
? Colors.green
: Colors.red,
)), )),
], ],
)); ));
@ -490,18 +545,27 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
child: ExpansionTile( child: ExpansionTile(
title: Text( title: Text(
TranslationBase.of(context).userView, TranslationBase.of(context).userView,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, color: Colors.black), style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.bold,
color: Colors.black),
), ),
children: <Widget>[ children: <Widget>[
FutureBuilder( FutureBuilder(
future: getUserViewRequest(), // async work future: getUserViewRequest(), // async work
builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) { builder: (BuildContext context,
AsyncSnapshot<dynamic> snapshot) {
switch (snapshot.connectionState) { switch (snapshot.connectionState) {
case ConnectionState.waiting: case ConnectionState.waiting:
return Padding(padding: EdgeInsets.only(top: 50), child: Text('Loading....')); return Padding(
padding: EdgeInsets.only(top: 50),
child: Text('Loading....'));
default: default:
if (snapshot.hasError) if (snapshot.hasError)
return Padding(padding: EdgeInsets.all(10), child: Text(TranslationBase.of(context).noDataAvailable)); return Padding(
padding: EdgeInsets.all(10),
child: Text(TranslationBase.of(context)
.noDataAvailable));
else else
return Container( return Container(
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
@ -514,17 +578,33 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
Padding( Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row(children: [ child: Row(children: [
Expanded(flex: 3, child: AppText(TranslationBase.of(context).name)), Expanded(
Expanded(flex: 1, child: AppText(TranslationBase.of(context).delete)), flex: 3,
child: AppText(
TranslationBase.of(
context)
.name)),
Expanded(
flex: 1,
child: AppText(
TranslationBase.of(
context)
.delete)),
])), ])),
Divider(color: Colors.black), Divider(color: Colors.black),
Column( Column(
children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.map<Widget>((result) { children: familyFileProvider
.allSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList
.map<Widget>((result) {
return Padding( return Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Expanded(flex: 3, child: AppText(result.patientName)), Expanded(
flex: 3,
child: AppText(result
.patientName)),
Expanded( Expanded(
flex: 1, flex: 1,
child: IconButton( child: IconButton(
@ -533,7 +613,10 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
color: Colors.black, color: Colors.black,
), ),
onPressed: () { onPressed: () {
deactivateRequest(result.iD, 5, context); deactivateRequest(
result.iD,
5,
context);
}, },
)), )),
], ],
@ -562,13 +645,11 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
} }
Future<GetAllSharedRecordsByStatusResponse> getFamilyFiles() async { Future<GetAllSharedRecordsByStatusResponse> getFamilyFiles() async {
if (user != null) {
if (await sharedPref.getObject(FAMILY_FILE) != null) { if (await sharedPref.getObject(FAMILY_FILE) != null) {
// print(await sharedPref.getObject(FAMILY_FILE)); return Future.value(GetAllSharedRecordsByStatusResponse.fromJson(
return Future.value(GetAllSharedRecordsByStatusResponse.fromJson(await sharedPref.getObject(FAMILY_FILE))); await sharedPref.getObject(FAMILY_FILE)));
} else { } else {
return familyFileProvider.getSharedRecordByStatus(); return familyFileProvider.getSharedRecordByStatus().then((value) {});
}
} }
} }
@ -588,7 +669,10 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
confirmMessage: TranslationBase.of(context).removeFamilyMember, confirmMessage: TranslationBase.of(context).removeFamilyMember,
okText: TranslationBase.of(context).confirm, okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps, cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {ConfirmDialog.closeAlertDialog(context), removeFamily(family, context)}, okFunction: () => {
ConfirmDialog.closeAlertDialog(context),
removeFamily(family, context)
},
cancelFunction: () => {}); cancelFunction: () => {});
dialog.showAlertDialog(context); dialog.showAlertDialog(context);
} }
@ -599,7 +683,10 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
request['ID'] = this.userID; request['ID'] = this.userID;
request['IsActive'] = false; request['IsActive'] = false;
this.familyFileProvider.deativateActivateMemberFile(request).then((value) => refreshFamily(context)); this
.familyFileProvider
.deativateActivateMemberFile(request)
.then((value) => refreshFamily(context));
} }
refreshFamily(context) { refreshFamily(context) {
@ -617,7 +704,12 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
// .then((value) => loginAfter(value, context)); // .then((value) => loginAfter(value, context));
// Utils.showProgressDialog(context); // Utils.showProgressDialog(context);
this.familyFileProvider.silentLoggin(user is AuthenticatedUser ? null : user, mainUser: user is AuthenticatedUser).then((value) => loginAfter(value, context)).catchError((err) { this
.familyFileProvider
.silentLoggin(user is AuthenticatedUser ? null : user,
mainUser: user is AuthenticatedUser)
.then((value) => loginAfter(value, context))
.catchError((err) {
print(err); print(err);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
Navigator.of(context).pop(); Navigator.of(context).pop();
@ -626,7 +718,8 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
loginAfter(result, context) async { loginAfter(result, context) async {
var currentLang = await sharedPref.getString(APP_LANGUAGE); var currentLang = await sharedPref.getString(APP_LANGUAGE);
Provider.of<ProjectViewModel>(context, listen: false).setPrivilege(privilegeList: result, isLoginChild: true); Provider.of<ProjectViewModel>(context, listen: false)
.setPrivilege(privilegeList: result, isLoginChild: true);
result = list.CheckActivationCode.fromJson(result); result = list.CheckActivationCode.fromJson(result);
var familyFile = await sharedPref.getObject(FAMILY_FILE); var familyFile = await sharedPref.getObject(FAMILY_FILE);
@ -647,12 +740,10 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
this.sharedPref.setString(TOKEN, result.authenticationTokenID); this.sharedPref.setString(TOKEN, result.authenticationTokenID);
await authenticatedUserObject.getUser(getUser: true); await authenticatedUserObject.getUser(getUser: true);
Provider.of<ProjectViewModel>(context, listen: false).user = authenticatedUserObject.user; Provider.of<ProjectViewModel>(context, listen: false).user =
Provider.of<ProjectViewModel>(context, listen: false).setUser(authenticatedUserObject.user); authenticatedUserObject.user;
Provider.of<ProjectViewModel>(context, listen: false)
// await pharmacyModuleViewModel.generatePharmacyToken().then((value) async { .setUser(authenticatedUserObject.user);
// if (pharmacyModuleViewModel.error.isNotEmpty) await pharmacyModuleViewModel.createUser();
// });
appointmentRateViewModel appointmentRateViewModel
.getIsLastAppointmentRatedList() .getIsLastAppointmentRatedList()
@ -690,7 +781,8 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
request["ID"] = ID; request["ID"] = ID;
request["Status"] = status; request["Status"] = status;
this.familyFileProvider.deactivateFamily(request).then((value) => {GifLoaderDialogUtils.hideDialog(context), refreshFamily(context)}); this.familyFileProvider.deactivateFamily(request).then((value) =>
{GifLoaderDialogUtils.hideDialog(context), refreshFamily(context)});
} }
acceptRemoveRequest(ID, status, context) { acceptRemoveRequest(ID, status, context) {
@ -698,15 +790,17 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
request["ID"] = ID; request["ID"] = ID;
request["Status"] = status; request["Status"] = status;
this.familyFileProvider.acceptRejectFamily(request).then((value) => {GifLoaderDialogUtils.hideDialog(context), refreshFamily(context)}); this.familyFileProvider.acceptRejectFamily(request).then((value) =>
{GifLoaderDialogUtils.hideDialog(context), refreshFamily(context)});
} }
checkUserData() async { checkUserData() async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
var data2 = AuthenticatedUser.fromJson(await this.sharedPref.getObject(MAIN_USER)); var data2 = AuthenticatedUser.fromJson(
print(data2); await this.sharedPref.getObject(MAIN_USER));
setState(() { setState(() {
this.user = data; this.user = data;
}); });
@ -719,7 +813,8 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
print(res['AppointmentActiveNumber']); print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1 && res['AppointmentActiveNumber'] != null) { if (res['MessageStatus'] == 1 && res['AppointmentActiveNumber'] != null) {
toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); toDoProvider.setState(res['AppointmentActiveNumber'], true,
toDoProvider.notificationsCount);
} else {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);

@ -116,9 +116,7 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
} }
void loadAddresses() async { void loadAddresses() async {
// GifLoaderDialogUtils.showMyDialog(context);
await viewModel.getCustomerInfo(); await viewModel.getCustomerInfo();
// GifLoaderDialogUtils.hideDialog(context);
if (viewModel.addressesList.isNotEmpty) setState(() {}); if (viewModel.addressesList.isNotEmpty) setState(() {});
} }

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-ord
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart'; import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/reports/user_agreement_page.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/user_agreement_page.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -190,7 +191,7 @@ class RRTRequestPageState extends State<RRTRequestPage> {
else else
AppToast.showErrorToast(message: TranslationBase.of(context).pleaseAcceptTerms); AppToast.showErrorToast(message: TranslationBase.of(context).pleaseAcceptTerms);
}, },
color: acceptTerms ? Colors.red[600] : Colors.grey, color: acceptTerms ? CustomColors.accentColor : Colors.grey,
), ),
), ),
], ],

@ -52,7 +52,7 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
style: TextStyle(fontSize: 14.0, letterSpacing: -0.56, fontWeight: FontWeight.bold)), style: TextStyle(fontSize: 14.0, letterSpacing: -0.56, fontWeight: FontWeight.bold)),
Container( Container(
margin: EdgeInsets.only(top: 5.0), margin: EdgeInsets.only(top: 5.0),
child: Text(model.cOCItemList[index].formType, child: Text(model.cOCItemList[index].formType.toString(),
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,

@ -40,6 +40,7 @@ class ClinicListService extends BaseService {
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
}, body: request); }, body: request);
sharedPref.setObject(CLINICS_LIST, localRes);
return Future.value(localRes); return Future.value(localRes);
} }

@ -37,12 +37,14 @@ class FamilyFilesProvider with ChangeNotifier {
GetAllSharedRecordsByStatusResponse allSharedRecordsByStatusResponse; GetAllSharedRecordsByStatusResponse allSharedRecordsByStatusResponse;
Future<GetAllSharedRecordsByStatusResponse> getSharedRecordByStatus() async { Future<GetAllSharedRecordsByStatusResponse> getSharedRecordByStatus() async {
try {
dynamic localRes; dynamic localRes;
try {
var request = GetAllSharedRecordsByStatusReq(); var request = GetAllSharedRecordsByStatusReq();
var result = await sharedPref.getObject(MAIN_USER); var result = await sharedPref.getObject(MAIN_USER);
request.status = 0; request.status = 0;
request.patientID = result["PatientID"]; request.patientID = result["PatientID"];
await new BaseAppClient().post(GET_SHARED_RECORD_BY_STATUS, onSuccess: (dynamic response, int statusCode) { await new BaseAppClient().post(GET_SHARED_RECORD_BY_STATUS, onSuccess: (dynamic response, int statusCode) {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
@ -236,7 +238,7 @@ class FamilyFilesProvider with ChangeNotifier {
request['MobileNo'] = currentUser.mobileNumber[0].toString() == "0" ? currentUser.mobileNumber.toString() : '0' + currentUser.mobileNumber.toString(); request['MobileNo'] = currentUser.mobileNumber[0].toString() == "0" ? currentUser.mobileNumber.toString() : '0' + currentUser.mobileNumber.toString();
request['PatientMobileNumber'] = currentUser.mobileNumber; //['MobileNumber']; request['PatientMobileNumber'] = currentUser.mobileNumber; //['MobileNumber'];
request['SearchType'] = 2; request['SearchType'] = 2;
request['SuperUser'] = currentUser.patientID; //currentUser.PatientID; // request['SuperUser'] = currentUser.patientID; //currentUser.PatientID;
request['PatientIdentificationID'] = ''; request['PatientIdentificationID'] = '';
request['IsSilentLogin'] = true; request['IsSilentLogin'] = true;
request['DeviceToken'] = await sharedPref.getString(PUSH_TOKEN); request['DeviceToken'] = await sharedPref.getString(PUSH_TOKEN);

@ -2357,6 +2357,9 @@ class TranslationBase {
String get respirationBPM => localizedValues["respirationBPM"][locale.languageCode]; String get respirationBPM => localizedValues["respirationBPM"][locale.languageCode];
String get noSlotsError => localizedValues["noSlotsError"][locale.languageCode];
String get selectSlot => localizedValues["selectSlot"][locale.languageCode];
} }

@ -310,6 +310,18 @@ Decoration containerColorRadiusBorderWidth(Color background, double radius, Colo
); );
} }
Decoration containerColorRadiusBorderWidthCircular(Color background, double radius, Color color, double w) {
return BoxDecoration(
color: background,
border: Border.all(
width: w, //
color: color // <--- border width here
),
// borderRadius: BorderRadius.circular(radius),
shape: BoxShape.circle,
);
}
Decoration containerColorRadiusRight(Color background, double radius) { Decoration containerColorRadiusRight(Color background, double radius) {
return BoxDecoration( return BoxDecoration(
color: background, color: background,

@ -357,7 +357,7 @@ class _AppDrawerState extends State<AppDrawer> {
), ),
onTap: () { onTap: () {
//NotificationsPage //NotificationsPage
Navigator.of(context).pop(); // Navigator.of(context).pop();
Navigator.push(context, FadePage(page: NotificationsPage())); Navigator.push(context, FadePage(page: NotificationsPage()));
}, },
), ),

@ -102,7 +102,8 @@ dependencies:
rating_bar: ^0.2.0 rating_bar: ^0.2.0
# Calendar # Calendar
table_calendar: ^2.3.0 # table_calendar: ^2.3.0
syncfusion_flutter_calendar: ^18.4.49
# SVG Images # SVG Images
flutter_svg: ^0.18.0 flutter_svg: ^0.18.0

Loading…
Cancel
Save