Merge branch 'development' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into fatima-new

# Conflicts:
#	lib/uitl/translations_delegate_base.dart
merge-requests/379/head
Fatimah Alshammari 3 years ago
commit f09cdd944d

File diff suppressed because it is too large Load Diff

@ -32,3 +32,4 @@ const PHARMACY_AUTORZIE_TOKEN = 'PHARMACY_AUTORZIE_TOKEN';
const H2O_UNIT = 'H2O_UNIT'; const H2O_UNIT = 'H2O_UNIT';
const H2O_REMINDER = 'H2O_REMINDER'; 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';

@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/models/DoctorScheduleR
class MedicalService extends BaseService { class MedicalService extends BaseService {
List<AppoitmentAllHistoryResultList> appoitmentAllHistoryResultList = List(); List<AppoitmentAllHistoryResultList> appoitmentAllHistoryResultList = List();
List<DoctorScheduleResponse> doctorScheduleResponse = List(); List<DoctorScheduleResponse> doctorScheduleResponse = List();
List<String> freeSlots = [];
getAppointmentHistory({bool isActiveAppointment = false}) async { getAppointmentHistory({bool isActiveAppointment = false}) async {
hasError = false; hasError = false;
super.error = ""; super.error = "";
@ -46,7 +47,7 @@ class MedicalService extends BaseService {
}, body: body); }, body: body);
} }
Future<Map> getSchedule(DoctorList doctorRequest) async { getSchedule(DoctorList doctorRequest) async {
Map<String, dynamic> request; Map<String, dynamic> request;
request = { request = {
'DoctorID': doctorRequest.doctorID, 'DoctorID': doctorRequest.doctorID,
@ -61,8 +62,29 @@ class MedicalService extends BaseService {
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
}, body: request); }, body: request);
doctorScheduleResponse.clear();
localRes['List_DoctorWorkingHoursTable'].forEach((item) => localRes['List_DoctorWorkingHoursTable'].forEach((item) =>
{doctorScheduleResponse.add(DoctorScheduleResponse.fromJson(item))}); {doctorScheduleResponse.add(DoctorScheduleResponse.fromJson(item))});
} }
getFreeSlot(DoctorList doctorRequest) async {
Map<String, dynamic> request;
request = {
'DoctorID': doctorRequest.doctorID,
'ProjectID': doctorRequest.projectID,
'ClinicID': doctorRequest.clinicID,
'DoctorWorkingHoursDays': 7
};
dynamic localRes;
await baseAppClient.post(GET_DOCTOR_FREE_SLOTS,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
freeSlots.clear();
localRes['FreeTimeSlots'].forEach((item) => freeSlots.add(item));
// localRes['List_DoctorWorkingHoursTable'].forEach((item) =>
// {doctorScheduleResponse.add(DoctorScheduleResponse.fromJson(item))});
}
} }

@ -14,7 +14,7 @@ class MedicalViewModel extends BaseViewModel {
_medicalService.appoitmentAllHistoryResultList; _medicalService.appoitmentAllHistoryResultList;
List<DoctorScheduleResponse> get getDoctorScheduleList => List<DoctorScheduleResponse> get getDoctorScheduleList =>
_medicalService.doctorScheduleResponse; _medicalService.doctorScheduleResponse;
List<String> get freeSlots => _medicalService.freeSlots;
getAppointmentHistory() async { getAppointmentHistory() async {
if (authenticatedUserObject.isLogin) { if (authenticatedUserObject.isLogin) {
setState(ViewState.Busy); setState(ViewState.Busy);
@ -38,4 +38,16 @@ class MedicalViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
getFreeSlots(DoctorList doctorRequest) async {
if (authenticatedUserObject.isLogin) {
setState(ViewState.Busy);
await _medicalService.getFreeSlot(doctorRequest);
if (_medicalService.hasError) {
error = _medicalService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
}
} }

@ -33,11 +33,15 @@ class CMCLocationPage extends StatefulWidget {
class _CMCLocationPageState extends State<CMCLocationPage> { class _CMCLocationPageState extends State<CMCLocationPage> {
double latitude = 0; double latitude = 0;
double longitude = 0; double longitude = 0;
bool showCurrentLocation = false;
@override @override
void initState() { void initState() {
latitude = widget.latitude; latitude = widget.latitude;
longitude = widget.longitude; longitude = widget.longitude;
if(latitude == 0.0 && longitude == 0.0) {
showCurrentLocation = true;
}
super.initState(); super.initState();
} }
@ -149,7 +153,7 @@ class _CMCLocationPageState extends State<CMCLocationPage> {
); );
}, },
initialPosition: LatLng(latitude, longitude), initialPosition: LatLng(latitude, longitude),
useCurrentLocation: false, useCurrentLocation: showCurrentLocation,
), ),
)); ));
} }

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/Comprehens
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/select_location_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/select_location_dialog.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -44,6 +45,7 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
double latitude = 0; double latitude = 0;
double longitude = 0; double longitude = 0;
AddressInfo _selectedAddress; AddressInfo _selectedAddress;
bool showCurrentLocation = false;
@override @override
void initState() { void initState() {
@ -56,14 +58,26 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
super.initState(); super.initState();
} }
setLatitudeAndLongitude({bool isSetState = false, String latLong}) { setLatitudeAndLongitude({bool isSetState = false, String latLong}) async {
if (latLong == null) if (latLong == null){
latLong = widget if(widget.model.addressesList.isEmpty) {
.model.addressesList[widget.model.addressesList.length - 1].latLong;
List latLongArr = latLong.split(',');
latitude = double.parse(latLongArr[0]); setState(() {
longitude = double.parse(latLongArr[1]); showCurrentLocation = true;
});
} else {
latLong = widget
.model.addressesList[widget.model.addressesList.length - 1].latLong;
}
}
if(!showCurrentLocation) {
List latLongArr = latLong.split(',');
latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]);
}
} }
@override @override
@ -144,9 +158,11 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
); );
}, },
initialPosition: LatLng(latitude, longitude), initialPosition: LatLng(latitude, longitude),
useCurrentLocation: false, useCurrentLocation: showCurrentLocation,
), ),
Container( if(widget.model.addressesList.isNotEmpty)
Container(
child: InkWell( child: InkWell(
onTap: () => onTap: () =>
confirmSelectLocationDialog(widget.model.addressesList), confirmSelectLocationDialog(widget.model.addressesList),

@ -33,12 +33,16 @@ class _LocationPageState
extends State<LocationPage> { extends State<LocationPage> {
double latitude = 0; double latitude = 0;
double longitude = 0; double longitude = 0;
bool showCurrentLocation = false;
@override @override
void initState() { void initState() {
latitude = widget.latitude; latitude = widget.latitude;
longitude = widget.longitude; longitude = widget.longitude;
if(latitude == 0.0 && longitude == 0.0) {
showCurrentLocation = true;
}
super.initState(); super.initState();
} }
@ -141,7 +145,7 @@ class _LocationPageState
); );
}, },
initialPosition: LatLng(latitude, longitude), initialPosition: LatLng(latitude, longitude),
useCurrentLocation: false, useCurrentLocation: showCurrentLocation,
), ),
)); ));
} }

@ -46,6 +46,8 @@ class _NewHomeHealthCareStepTowPageState
double latitude = 0; double latitude = 0;
double longitude = 0; double longitude = 0;
AddressInfo _selectedAddress; AddressInfo _selectedAddress;
bool showCurrentLocation = false;
@override @override
void initState() { void initState() {
@ -60,13 +62,25 @@ class _NewHomeHealthCareStepTowPageState
} }
setLatitudeAndLongitude({bool isSetState = false, String latLong}) { setLatitudeAndLongitude({bool isSetState = false, String latLong}) {
if (latLong == null) if (latLong == null){
latLong = widget.model.addressesList[widget.model.addressesList if(widget.model.addressesList.isEmpty) {
.length - 1].latLong; setState(() {
List latLongArr = latLong.split(','); showCurrentLocation = true;
});
} else {
latLong = widget.model.addressesList[widget.model.addressesList
.length - 1].latLong;
}
}
if(!showCurrentLocation) {
List latLongArr = latLong.split(',');
latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]);
}
latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]);
} }
@override @override
@ -147,8 +161,9 @@ class _NewHomeHealthCareStepTowPageState
); );
}, },
initialPosition: LatLng(latitude, longitude), initialPosition: LatLng(latitude, longitude),
useCurrentLocation: false, useCurrentLocation: showCurrentLocation,
), ),
if(widget.model.addressesList.isNotEmpty)
Container( Container(
child: InkWell( child: InkWell(
onTap: () => onTap: () =>

@ -64,6 +64,7 @@ class _BloodCholesterolState extends State<BloodCholesterol> {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).bloodCholesterol, appBarTitle: TranslationBase.of(context).bloodCholesterol,
isShowDecPage: false,
body: Padding( body: Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
child: SingleChildScrollView( child: SingleChildScrollView(

@ -66,6 +66,7 @@ class _TriglyceridesState extends State<Triglycerides> {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).triglycerides, appBarTitle: TranslationBase.of(context).triglycerides,
isShowDecPage: false,
body: Padding( body: Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
child: SingleChildScrollView( child: SingleChildScrollView(

@ -8,7 +8,8 @@ class MyWebView extends StatelessWidget {
final String title; final String title;
final String selectedUrl; final String selectedUrl;
final Completer<WebViewController> _controller = Completer<WebViewController>(); final Completer<WebViewController> _controller =
Completer<WebViewController>();
MyWebView({ MyWebView({
@required this.title, @required this.title,
@ -20,6 +21,7 @@ class MyWebView extends StatelessWidget {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: title, appBarTitle: title,
isShowDecPage: false,
body: WebView( body: WebView(
initialUrl: selectedUrl, initialUrl: selectedUrl,
javascriptMode: JavascriptMode.unrestricted, javascriptMode: JavascriptMode.unrestricted,

@ -21,9 +21,11 @@ class DocAvailableAppointments extends StatefulWidget {
static String selectedDate; static String selectedDate;
static String selectedTime; static String selectedTime;
bool isLiveCareAppointment; bool isLiveCareAppointment;
final dynamic doctorSchedule;
DocAvailableAppointments( DocAvailableAppointments(
{@required this.doctor, @required this.isLiveCareAppointment}); {@required this.doctor,
this.doctorSchedule,
@required this.isLiveCareAppointment});
@override @override
_DocAvailableAppointmentsState createState() => _DocAvailableAppointmentsState createState() =>
@ -67,6 +69,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
WidgetsBinding.instance.addPostFrameCallback((_) async { WidgetsBinding.instance.addPostFrameCallback((_) async {
getCurrentLanguage(); getCurrentLanguage();
if (widget.isLiveCareAppointment) if (widget.isLiveCareAppointment)
getDoctorScheduledFreeSlots(context, widget.doctor); getDoctorScheduledFreeSlots(context, widget.doctor);
else { else {
@ -107,9 +110,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
} }
void _onCalendarCreated( void _onCalendarCreated(
DateTime first, DateTime last, CalendarFormat format) { DateTime first, DateTime last, CalendarFormat format) {}
print('CALLBACK: _onCalendarCreated');
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -350,9 +351,24 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
freeSlotsResponse = res['FreeTimeSlots']; freeSlotsResponse = res['FreeTimeSlots'];
print("res['FreeTimeSlots']"); print("res['FreeTimeSlots']");
print(res['FreeTimeSlots'].length); print(res['FreeTimeSlots'].length);
_getJSONSlots().then((value) => {
setState(() => {_events.clear(), _events = value}) _getJSONSlots().then((value) {
}); setState(() => {
_events.clear(),
_events = value,
if (widget.doctorSchedule != null)
{
_calendarController.setSelectedDay(
DateUtil.convertStringToDate(
widget.doctorSchedule['Date']),
isProgrammatic: true),
_onDaySelected(
DateUtil.convertStringToDate(
widget.doctorSchedule['Date']),
List())
}
});
});
} else { } else {
DocAvailableAppointments.areAppointmentsAvailable = false; DocAvailableAppointments.areAppointmentsAvailable = false;
} }

@ -15,16 +15,17 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/SchedulePage.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'widgets/AppointmentActions.dart'; import 'widgets/AppointmentActions.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
class AppointmentDetails extends StatefulWidget { class AppointmentDetails extends StatefulWidget {
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
static bool isLoading = false; static bool isLoading = false;
final dynamic doctorSchedule;
static bool showFooterButton = false; static bool showFooterButton = false;
AppointmentDetails({@required this.appo}); AppointmentDetails({@required this.appo, this.doctorSchedule});
@override @override
_AppointmentDetailsState createState() => _AppointmentDetailsState(); _AppointmentDetailsState createState() => _AppointmentDetailsState();
@ -34,13 +35,20 @@ class _AppointmentDetailsState extends State<AppointmentDetails>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
static TabController _tabController; static TabController _tabController;
AppSharedPreferences sharedPref = AppSharedPreferences();
List<DoctorRateDetails> doctorDetailsList = List(); List<DoctorRateDetails> doctorDetailsList = List();
@override @override
void initState() { void initState() {
_tabController = new TabController(length: 2, vsync: this);
AppointmentDetails.showFooterButton = false; AppointmentDetails.showFooterButton = false;
print(widget.appo.clinicID); if (widget.doctorSchedule != null) {
_tabController =
new TabController(length: 2, vsync: this, initialIndex: 1);
widget.appo.appointmentDate = widget.doctorSchedule['Date'];
} else {
_tabController = new TabController(length: 2, vsync: this);
}
setTab();
super.initState(); super.initState();
} }
@ -233,6 +241,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails>
enableFooterButton: enableFooterButton), enableFooterButton: enableFooterButton),
DocAvailableAppointments( DocAvailableAppointments(
doctor: getDoctorObject(), doctor: getDoctorObject(),
doctorSchedule: widget.doctorSchedule,
isLiveCareAppointment: isLiveCareAppointment:
widget.appo.isLiveCareAppointment) widget.appo.isLiveCareAppointment)
], ],
@ -241,7 +250,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails>
), ),
], ],
), ),
_tabController.index == 0 _tabController.index == 1
? Positioned( ? Positioned(
right: 30.0, right: 30.0,
//top: 30.0, //top: 30.0,
@ -607,6 +616,18 @@ class _AppointmentDetailsState extends State<AppointmentDetails>
} }
void openSchedule() { void openSchedule() {
Navigator.push(context, FadePage(page: SchedulePage(getDoctorObject()))); Navigator.push(
context,
FadePage(
page: SchedulePage(
appo: widget.appo,
doctorList: getDoctorObject(),
)));
}
setTab() async {
var scheduleDoctor = await sharedPref.getObject(DOCTOR_SCHEDULE_DATE_SEL);
widget.appo.appointmentDate = scheduleDoctor['Date'];
} }
} }

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/DoctorScheduleResponse.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/DoctorScheduleResponse.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/indicator.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/indicator.dart';
@ -6,16 +7,22 @@ import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsLis
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/medical_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/medical_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
class SchedulePage extends StatefulWidget { class SchedulePage extends StatefulWidget {
final DoctorList doctorList; final DoctorList doctorList;
final AppoitmentAllHistoryResultList appo;
SchedulePage(this.doctorList); SchedulePage({
this.appo,
this.doctorList,
});
@override @override
_SchedulePageState createState() => _SchedulePageState(); _SchedulePageState createState() => _SchedulePageState();
} }
@ -25,139 +32,226 @@ class _SchedulePageState extends State<SchedulePage> {
PageController _pageController = PageController(); PageController _pageController = PageController();
double currentPage = 0; double currentPage = 0;
int selectedindex = 0; int selectedindex = 0;
bool isLoading = true; List weeks = [];
List<DoctorScheduleResponse> doctorScheduleResponse = []; List<DoctorScheduleResponse> doctorScheduleResponse = [];
final List<Widget> introWidgetsList = <Widget>[ int weekMS = 604800 * 1000;
Text('Hello'), DoctorList doctorList;
Text('Hi'), List<String> freeSlots = [];
Text('hey') bool isPageChange = false;
];
AppSharedPreferences sharedPref = AppSharedPreferences();
@override @override
void initState() { void initState() {
//getSchedule(widget.doctorList, context); this.doctorList = widget.doctorList;
// _pageController.addListener(() {
// setState(() {
// currentPage = _pageController.page;
// });
// });
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<MedicalViewModel>( return BaseView<MedicalViewModel>(
onModelReady: (model) => model.getDoctorSchedule(widget.doctorList), onModelReady: (model) => model.getDoctorSchedule(doctorList),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => BaseView<MedicalViewModel>(
appBarTitle: TranslationBase.of(context).schedule, onModelReady: (model2) => model2.getFreeSlots(doctorList),
isShowAppBar: true, builder: (_, model2, widget2) {
baseViewModel: model, if (model.freeSlots.length > 0 && isPageChange == false) {
body: SizedBox( this.freeSlots = model.freeSlots;
height: MediaQuery.of(context).size.height, this.doctorScheduleResponse = model.getDoctorScheduleList;
child: Stack(
children: [ this.generateWeeksSchedules();
Container( }
child: PageView.builder( return AppScaffold(
controller: _pageController, appBarTitle: TranslationBase.of(context).schedule,
itemCount: 3, isShowAppBar: true,
onPageChanged: (index) { baseViewModel: model2,
setState(() { body: SizedBox(
this.currentPage = index.toDouble(); height: MediaQuery.of(context).size.height,
}); child: Stack(
}, children: [
itemBuilder: (context, index) { Container(
return Container( margin: EdgeInsets.only(top: 40),
child: ListView.builder( child: PageView.builder(
itemCount: model.getDoctorScheduleList.length, controller: _pageController,
itemBuilder: (context, index) => ClipRRect( itemCount: weeks.length,
borderRadius: const BorderRadius.all( onPageChanged: (index) {
Radius.circular(20.0)), setState(() {
child: Container( isPageChange = true;
padding: EdgeInsets.only( this.currentPage = index.toDouble();
left: 10, });
right: 10, },
top: 20, itemBuilder: (context, index) {
bottom: 20), return Container(
margin: EdgeInsets.only( child: ListView.builder(
left: 20, itemCount: weeks[index].length,
right: 20, itemBuilder: (context, index2) =>
top: 7, InkWell(
bottom: 7), onTap: () {
decoration: BoxDecoration( openBookAppointment(
boxShadow: [ weeks[index][index2]);
BoxShadow( },
color: Colors.green, child: Row(
offset: Offset(-10, 0)), children: [
], Expanded(
borderRadius: flex: 1,
const BorderRadius.all( child: Padding(
Radius.circular(10.0)), padding:
color: Colors.white), EdgeInsets.only(
child: Row( left: 20),
children: [ child: Row(
Expanded( children: [
child: Row(children: [ Column(
Column( children: [
children: [ Texts(
Texts( weeks[index][index2]
model [
.getDoctorScheduleList[ 'DayName'],
index] fontSize:
.dayName, 13,
color: ),
HexColor('#0bb690'), Texts(
), getDayMonths(
Texts( DateUtil
DateUtil .convertStringToDate(
.getDayMonthYearDateFormatted( weeks[index][index2]['Date'],
DateUtil ),
.convertStringToDate( ),
model fontWeight:
.getDoctorScheduleList[ FontWeight.bold,
index] fontSize:
.date, 18,
), )
],
)
])),
), ),
color: Expanded(
HexColor('#0bb690'), flex: 3,
) child: ClipRRect(
], borderRadius:
) const BorderRadius
]), .all(
), Radius.circular(
Expanded( 20.0)),
child: Texts( child: Container(
model padding:
.getDoctorScheduleList[ EdgeInsets.only(
index] left:
.workingHours, 10,
color: HexColor('#0bb690'), right:
), 10,
) top: 20,
], bottom:
))))); 20),
}, margin: EdgeInsets.only(
)), left: 20,
PageViewIndicator( right: 20,
isActive: true, top: 7,
currentPage: this.currentPage, bottom: 7),
length: introWidgetsList.length, decoration: BoxDecoration(
) boxShadow: [
], weeks[index][index2]['fullDay'] ==
)))); false
? BoxShadow(
color: Colors.green,
offset: Offset(-5, 0))
: BoxShadow(),
],
borderRadius:
const BorderRadius.all(Radius.circular(
10.0)),
color: Colors
.white),
child: Row(
children: [
Expanded(
child:
Texts(
weeks[index][index2]
[
'WorkingHours'],
fontWeight:
FontWeight.w400,
),
)
],
))),
)
],
))));
},
)),
PageViewIndicator(
isActive: true,
currentPage: this.currentPage,
length: weeks.length,
)
],
)));
}));
}
generateWeeksSchedules() {
this.weeks.clear();
for (var i = 0; i < 8; i++) {
var weekSchedule = generateNewWeekSchedule(i);
this.markWeekFreeDays(weekSchedule);
this.weeks.add(weekSchedule);
}
//print(this.weeks);
}
markWeekFreeDays(schedule) {
for (var workDay in schedule) {
workDay['fullDay'] = !this.hasFreeSlot(workDay['Date']);
}
}
generateNewWeekSchedule(weekIndex) {
var weekMSOffset = weekIndex * weekMS;
var newWeekSchedule = [];
for (var workDay in this.doctorScheduleResponse) {
Map<String, dynamic> newWorkDay = Map();
newWorkDay['Date'] = DateUtil.convertDateMSToJsonDate(
DateUtil.convertStringToDate(workDay.date).millisecondsSinceEpoch +
weekMSOffset);
newWorkDay['DayName'] = workDay.dayName;
newWorkDay['WorkingHours'] = workDay.workingHours;
newWeekSchedule.add(newWorkDay);
}
return newWeekSchedule;
}
hasFreeSlot(String jsonDate) {
var date = DateUtil.convertStringToDate(jsonDate);
var scheduleDay = date;
for (var event in this.freeSlots) {
var date = DateUtil.convertStringToDate(event);
var nDate = DateTime(date.year, date.month, date.day);
if (nDate.millisecondsSinceEpoch == scheduleDay.millisecondsSinceEpoch) {
return true;
}
}
return false;
}
String getDayMonths(DateTime dateTime) {
String dateFormat =
'${dateTime.day} ${DateUtil.getMonth(dateTime.month).toString().substring(0, 3)}';
return dateFormat;
} }
//getSchedule(DoctorList doctor, BuildContext context) { openBookAppointment(selectedDate) {
//GifLoaderDialogUtils.showMyDialog(context); //sharedPref.setObject(DOCTOR_SCHEDULE_DATE_SEL, selectedDate);
//service = new DoctorsListService(); Navigator.push(
// service.getSchedule(doctor).then((value) { context,
// doctorScheduleResponse.clear(); FadePage(
// setState(() { page: AppointmentDetails(
// value['List_DoctorWorkingHoursTable'].forEach((item) => { appo: widget.appo,
// doctorScheduleResponse.add(DoctorScheduleResponse.fromJson(item)) doctorSchedule: selectedDate,
// }); ),
// GifLoaderDialogUtils.hideDialog(context); ),
// }); );
// }); }
// }
} }

@ -17,11 +17,11 @@ class PageViewIndicator extends StatelessWidget {
Widget _indicator(bool isActive) { Widget _indicator(bool isActive) {
return Positioned( return Positioned(
bottom: 10, top: 20,
left: 0, left: 0,
right: 0, right: 0,
child: Container( child: Container(
margin: EdgeInsets.only(bottom: 35), margin: EdgeInsets.only(top: 0),
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -37,7 +37,7 @@ class PageViewIndicator extends StatelessWidget {
Widget circleBar(bool isActive) { Widget circleBar(bool isActive) {
return AnimatedContainer( return AnimatedContainer(
duration: Duration(milliseconds: 150), duration: Duration(milliseconds: 150),
margin: EdgeInsets.symmetric(horizontal: 8), margin: EdgeInsets.symmetric(horizontal: 3),
height: isActive ? 12 : 8, height: isActive ? 12 : 8,
width: isActive ? 12 : 8, width: isActive ? 12 : 8,
decoration: BoxDecoration( decoration: BoxDecoration(

@ -0,0 +1,14 @@
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
class AboutApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).aboutApp,
isShowDecPage: false,
body: Container());
}
}

@ -33,6 +33,14 @@ class _Settings extends State<Settings> with TickerProviderStateMixin {
AppGlobal.context = context; AppGlobal.context = context;
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
actions: [
IconButton(
icon: Icon(Icons.info, color: Colors.white),
onPressed: () {
//openInfoPage()
},
)
],
bottom: TabBar( bottom: TabBar(
// isScrollable: true, // isScrollable: true,
@ -51,8 +59,7 @@ class _Settings extends State<Settings> with TickerProviderStateMixin {
controller: _tabController, controller: _tabController,
), ),
title: Text(TranslationBase.of(context).settings, title: Text(TranslationBase.of(context).settings,
style: style: TextStyle(color: Colors.white)),
TextStyle(color: Theme.of(context).textTheme.bodyText2.color)),
leading: Builder( leading: Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return ArrowBack(); return ArrowBack();

@ -63,6 +63,15 @@ class DateUtil {
return dateFormat; return dateFormat;
} }
static String convertDateMSToJsonDate(utc) {
var dt = new DateTime.fromMicrosecondsSinceEpoch(utc);
return "/Date(" +
(dt.millisecondsSinceEpoch * 1000).toString() +
'+0300' +
")/";
}
/// check Date /// check Date
/// [dateString] String we want to convert /// [dateString] String we want to convert
static String checkDate(DateTime checkedTime) { static String checkDate(DateTime checkedTime) {

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save