updates & fixes

merge-requests/400/head
haroon amjad 5 years ago
parent 32462ff5ba
commit 0fe4a21388

@ -1101,7 +1101,7 @@ const Map localizedValues = {
"en": "\nThis service Displays nearest branch\n among all the branches of All Habib \n medical Group based on your current Location", "en": "\nThis service Displays nearest branch\n among all the branches of All Habib \n medical Group based on your current Location",
"ar": "\nتعرض هذه الخدمة أقرب فرع\n من بين جميع فروع مجموعة \nالحبيب الطبية بناءً على موقعك الحالي." "ar": "\nتعرض هذه الخدمة أقرب فرع\n من بين جميع فروع مجموعة \nالحبيب الطبية بناءً على موقعك الحالي."
}, },
"NearestEr": {"en": "Nearest ER", "ar": "أقرب ER"}, "NearestEr": {"en": "Nearest ER", "ar":"اقرب طوارئ"},
"infoCMC": { "infoCMC": {
"en": "Through this service, you can request a set of tests that help you and your doctor to understand the current health condition and then identify potential risks.", "en": "Through this service, you can request a set of tests that help you and your doctor to understand the current health condition and then identify potential risks.",
"ar": "من خلال هذه الخدمة يمكنك طلب مجموعة من الفحوصات التي تساعدك وتساعد طبيبك في فهم حالتك الصحية الحالية ومن ثم تحديد المخاطر المحتملة" "ar": "من خلال هذه الخدمة يمكنك طلب مجموعة من الفحوصات التي تساعدك وتساعد طبيبك في فهم حالتك الصحية الحالية ومن ثم تحديد المخاطر المحتملة"
@ -1481,5 +1481,6 @@ const Map localizedValues = {
"firstTri": { "en": "First Trimester Ends (12 weeks):", "ar": "تاريخ انتهاء الثلث الأول 12 اسبوع: " }, "firstTri": { "en": "First Trimester Ends (12 weeks):", "ar": "تاريخ انتهاء الثلث الأول 12 اسبوع: " },
"secondTri": { "en": "Second Trimester Ends (27 weeks):", "ar": "تاريخ انتهاء الثلث الثاني 27 اسبوع: " }, "secondTri": { "en": "Second Trimester Ends (27 weeks):", "ar": "تاريخ انتهاء الثلث الثاني 27 اسبوع: " },
"thirdTri": { "en": "Third Trimester, Estimated Due Date (40 weeks):", "ar": "تاريخ احتمال الولادة 40 اسبوع:" }, "thirdTri": { "en": "Third Trimester, Estimated Due Date (40 weeks):", "ar": "تاريخ احتمال الولادة 40 اسبوع:" },
"seeDoctorsList": { "en": "See List Of Doctors", "ar": "اعرض قائمة الأطباء" } "seeDoctorsList": { "en": "See List Of Doctors", "ar": "اعرض قائمة الأطباء" },
"covidQuestionnaire": { "en": "Please answer below questionnaire:", "ar": "الرجاء الإجابة على الاستبيان أدناه:" },
}; };

@ -378,8 +378,6 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
if (res['PatientER_DoctorFreeSlots'].length != 0) { if (res['PatientER_DoctorFreeSlots'].length != 0) {
DocAvailableAppointments.areAppointmentsAvailable = true; DocAvailableAppointments.areAppointmentsAvailable = true;
freeSlotsResponse = res['PatientER_DoctorFreeSlots']; freeSlotsResponse = res['PatientER_DoctorFreeSlots'];
print("res['PatientER_DoctorFreeSlots']");
print(res['PatientER_DoctorFreeSlots'].length);
_getJSONSlots().then((value) => { _getJSONSlots().then((value) => {
setState(() => {_events.clear(), _events = value}) setState(() => {_events.clear(), _events = value})
}); });
@ -405,14 +403,6 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
Widget _buildEventsMarker(DateTime date, List events) { Widget _buildEventsMarker(DateTime date, List events) {
return Container( return Container(
// decoration: BoxDecoration(
// shape: BoxShape.circle,
// color: _calendarController.isSelected(date)
// ? Color(0xffB8382C)
// : _calendarController.isToday(date)
// ? Colors.brown[300]
// : Color(0xff359846),
// ),
decoration: containerColorRadiusBorderWidth( decoration: containerColorRadiusBorderWidth(
_calendarController.isSelected(date) _calendarController.isSelected(date)
? CustomColors.green ? CustomColors.green

@ -1,28 +1,35 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/livechat_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/livechat_page.dart';
import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart';
import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/advance_payment_page.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/my_balance_page.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/Weight/WeightHomePage.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/Weight/WeightHomePage.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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:provider/provider.dart';
import '../../../Constants.dart';
class CardCommonContact extends StatelessWidget { class CardCommonContact extends StatelessWidget {
final image; final image;
final text; final text;
final subText; final subText;
final type; final type;
const CardCommonContact({@required this.image, @required this.text, @required this.subText, @required this.type}); final width;
final height;
final ProjectViewModel projectViewModel;
final ToDoCountProviderModel model;
const CardCommonContact({@required this.image, @required this.text, @required this.subText, @required this.type, this.width, this.height, this.projectViewModel, this.model});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); // ProjectViewModel projectViewModel = Provider.of(context);
// ToDoCountProviderModel model = Provider.of<ToDoCountProviderModel>(context);
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
navigateToSearch(context, this.type); navigateToSearch(context, this.type);
@ -43,9 +50,8 @@ class CardCommonContact extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Image.asset( Image.asset(
this.image, this.image,
width: 42.0, width: width != null ? width : 42.0,
height: 42.0, height: height != null ? height : 42.0,
color: Color(0xff2E303A),
), ),
Text( Text(
text + "${subText.isEmpty ? "" : "\n$subText"}", text + "${subText.isEmpty ? "" : "\n$subText"}",
@ -63,17 +69,31 @@ class CardCommonContact extends StatelessWidget {
} else if (type == 1) { } else if (type == 1) {
Navigator.push(context, FadePage(page: FeedbackHomePage())); Navigator.push(context, FadePage(page: FeedbackHomePage()));
} else if (type == 2) { } else if (type == 2) {
//LiveChatPage
Navigator.push(context, FadePage(page: LiveChatPage())); Navigator.push(context, FadePage(page: LiveChatPage()));
} else if (type == 3) { } else if (type == 3) {
//LiveChatPage
Navigator.push(context, FadePage(page: BloodSugarHomePage())); Navigator.push(context, FadePage(page: BloodSugarHomePage()));
} else if (type == 4) { } else if (type == 4) {
//LiveChatPage
Navigator.push(context, FadePage(page: BloodPressureHomePage())); Navigator.push(context, FadePage(page: BloodPressureHomePage()));
} else if (type == 5) { } else if (type == 5) {
//LiveChatPage
Navigator.push(context, FadePage(page: WeightHomePage())); Navigator.push(context, FadePage(page: WeightHomePage()));
} else if (type == 6) {
Navigator.push(context, FadePage(page: AdvancePaymentPage()));
} else if (type == 7) {
navigateToToDoPage(context);
} else if (type == 8) {
Navigator.push(context, FadePage(page: MyBalancePage()));
}
}
navigateToToDoPage(BuildContext context) {
if (projectViewModel.isLogin) {
if (model.count != 0) {
Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true)));
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).upcomingEmpty);
}
} else {
Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true)));
} }
} }
} }

@ -8,11 +8,14 @@ import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresRe
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-alert.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-alert.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart'; import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart';
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/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.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';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; 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';
@ -43,8 +46,7 @@ class CovidTimeSlots extends StatefulWidget {
_CovidTimeSlotsState createState() => _CovidTimeSlotsState(); _CovidTimeSlotsState createState() => _CovidTimeSlotsState();
} }
class _CovidTimeSlotsState extends State<CovidTimeSlots> class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStateMixin {
with TickerProviderStateMixin {
Map<DateTime, List> _events; Map<DateTime, List> _events;
AnimationController _animationController; AnimationController _animationController;
CalendarController _calendarController; CalendarController _calendarController;
@ -64,6 +66,8 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
ScrollController _scrollController; ScrollController _scrollController;
ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
final _selectedDay = DateTime.now(); final _selectedDay = DateTime.now();
@ -76,8 +80,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
_selectedDay: ['Event A0'] _selectedDay: ['Event A0']
}; };
WidgetsBinding.instance.addPostFrameCallback( WidgetsBinding.instance.addPostFrameCallback((_) => getCovidFreeSlots(context, widget.projectID));
(_) => getCovidFreeSlots(context, widget.projectID));
_calendarController = CalendarController(); _calendarController = CalendarController();
_animationController = AnimationController( _animationController = AnimationController(
@ -96,34 +99,32 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
super.dispose(); super.dispose();
} }
void _onDaySelected( void _onDaySelected(DateTime day, List events, ProjectViewModel projectViewModel) {
DateTime day, List events, ProjectViewModel projectViewModel) {
final DateFormat formatter = DateFormat('yyyy-MM-dd'); final DateFormat formatter = DateFormat('yyyy-MM-dd');
setState(() { setState(() {
this.selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted( this.selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(day, projectViewModel.isArabic ? "ar" : "en");
day, projectViewModel.isArabic ? "ar" : "en");
openTimeSlotsPickerForDate(day, docFreeSlots); openTimeSlotsPickerForDate(day, docFreeSlots);
CovidTimeSlots.selectedDate = formatter.format(day); CovidTimeSlots.selectedDate = formatter.format(day);
print(CovidTimeSlots.selectedDate); print(CovidTimeSlots.selectedDate);
}); });
} }
void _onVisibleDaysChanged( void _onVisibleDaysChanged(DateTime first, DateTime last, CalendarFormat format) {
DateTime first, DateTime last, CalendarFormat format) {
print('CALLBACK: _onVisibleDaysChanged'); print('CALLBACK: _onVisibleDaysChanged');
} }
void _onCalendarCreated( void _onCalendarCreated(DateTime first, DateTime last, CalendarFormat format) {
DateTime first, DateTime last, CalendarFormat format) {
print('CALLBACK: _onCalendarCreated'); print('CALLBACK: _onCalendarCreated');
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest, appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0), margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0),
@ -134,8 +135,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
height: 150.0, height: 150.0,
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: AssetImage( image: AssetImage("assets/images/new-design/covid-19-big-banner-bg.png"),
"assets/images/new-design/covid-19-big-banner-bg.png"),
fit: BoxFit.fill, fit: BoxFit.fill,
), ),
color: Colors.white.withOpacity(0.3), color: Colors.white.withOpacity(0.3),
@ -144,31 +144,19 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Container(
margin: margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 30.0),
EdgeInsets.only(left: 15.0, right: 15.0, top: 30.0), child: SvgPicture.asset('assets/images/new-design/covid-19-car.svg', width: 90.0, height: 90.0),
child: SvgPicture.asset(
'assets/images/new-design/covid-19-car.svg',
width: 90.0,
height: 90.0),
), ),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 20.0),
left: 20.0, right: 20.0, top: 20.0), child: Text(TranslationBase.of(context).covidTest, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 24.0)),
child: Text(TranslationBase.of(context).covidTest,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 24.0)),
), ),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 10.0),
left: 20.0, right: 20.0, top: 10.0), child: Text(TranslationBase.of(context).driveThru, style: TextStyle(color: Colors.white, fontSize: 24.0)),
child: Text(TranslationBase.of(context).driveThru,
style: TextStyle(
color: Colors.white, fontSize: 24.0)),
), ),
], ],
), ),
@ -176,202 +164,164 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
), ),
), ),
Container( Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.0),
color: Colors.white),
margin: EdgeInsets.fromLTRB(0.0, 20.0, 0.0, 5.0),
padding: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 20.0),
width: MediaQuery.of(context).size.width,
// height: MediaQuery.of(context).size.height * 0.65,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
Container( _buildTableCalendarWithBuilders(projectViewModel),
margin: EdgeInsets.all(10.0), Padding(
child: Text(TranslationBase.of(context).selectAppo, padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16),
style: child: Text(selectedDate, style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.w600, letterSpacing: -0.64)),
TextStyle(color: Colors.black, fontSize: 16.0)),
),
Container(
margin: EdgeInsets.only(top: 10.0),
alignment: Alignment.center,
child: Text(selectedDate,
style: TextStyle(
fontSize: 18.0, fontWeight: FontWeight.bold)),
), ),
Container( Container(
height: 50, height: 40,
margin: EdgeInsets.all(20.0),
child: ListView.builder( child: ListView.builder(
controller: _scrollController, controller: _scrollController,
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
itemCount: dayEvents.length, itemCount: dayEvents.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Container( return Container(
margin: EdgeInsets.only(right: 10.0), margin: EdgeInsets.only(right: (index == dayEvents.length - 1) ? 16 : 5.0, left: index == 0 ? 16 : 5),
child: ButtonTheme( child: ButtonTheme(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0), borderRadius: BorderRadius.circular(5.0),
side: BorderSide( side: BorderSide(
color: Colors.blue[400], color: index == selectedButtonIndex ? CustomColors.green : Colors.black, //Color of the border
//Color of the border style: BorderStyle.solid, //Style of the border
style: BorderStyle.solid,
//Style of the border
width: 1.5, //width of the border width: 1.5, //width of the border
), ),
), ),
minWidth: minWidth: MediaQuery.of(context).size.width * 0.18,
MediaQuery.of(context).size.width * 0.2, child: index == selectedButtonIndex ? getSelectedButton(index) : getNormalButton(index)),
child: index == selectedButtonIndex
? getSelectedButton(index)
: getNormalButton(index)),
); );
}, },
), ),
), ),
_buildTableCalendarWithBuilders(projectViewModel),
], ],
), ),
), ),
SizedBox( SizedBox(
height: 100.0, height: 10.0,
), ),
], if (CovidTimeSlots.areSlotsAvailable)
), Container(
), color: Colors.grey[100],
), margin: EdgeInsets.all(10.0),
bottomSheet: Container( child: DefaultButton(
margin: EdgeInsets.all(10.0), TranslationBase.of(context).bookNow,
child: Flex( () {
direction: Axis.horizontal,
children: <Widget>[
Expanded(
flex: 1,
child: Container(
margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: Colors.grey[500],
onPressed: () {
bookCovidTestAppointment(); bookCovidTestAppointment();
}, },
child: Text(TranslationBase.of(context).bookNow,
style: TextStyle(fontSize: 18.0)),
), ),
), ),
), ],
), ),
],
), ),
), ),
); );
} }
Widget _buildTableCalendarWithBuilders(ProjectViewModel projectViewModel) { Widget _buildTableCalendarWithBuilders(ProjectViewModel projectViewModel) {
return TableCalendar( return Card(
locale: projectViewModel.isArabic ? 'ar_SA' : 'en_US', shape: cardRadius(12),
calendarController: _calendarController, margin: EdgeInsets.all(16),
events: _events, clipBehavior: Clip.antiAlias,
initialCalendarFormat: CalendarFormat.month, child: Padding(
startDay: DateTime.now(), padding: const EdgeInsets.only(bottom: 12),
formatAnimation: FormatAnimation.slide, child: TableCalendar(
startingDayOfWeek: StartingDayOfWeek.sunday, locale: projectViewModel.isArabic ? 'ar_SA' : 'en_US',
weekendDays: [DateTime.friday, DateTime.saturday], calendarController: _calendarController,
availableGestures: AvailableGestures.horizontalSwipe, events: _events,
availableCalendarFormats: const { initialCalendarFormat: CalendarFormat.month,
CalendarFormat.month: '', startDay: DateTime.now(),
CalendarFormat.week: '', formatAnimation: FormatAnimation.slide,
}, startingDayOfWeek: StartingDayOfWeek.sunday,
calendarStyle: CalendarStyle( weekendDays: [DateTime.friday, DateTime.saturday],
outsideDaysVisible: false, availableGestures: AvailableGestures.horizontalSwipe,
weekendStyle: TextStyle().copyWith(color: Colors.blue[800]), availableCalendarFormats: const {
holidayStyle: TextStyle().copyWith(color: Colors.blue[800]), CalendarFormat.month: '',
), CalendarFormat.week: '',
daysOfWeekStyle: DaysOfWeekStyle( },
weekendStyle: TextStyle().copyWith(color: Colors.blue[600]), calendarStyle: CalendarStyle(
), outsideDaysVisible: false,
headerStyle: HeaderStyle( weekendStyle: TextStyle().copyWith(color: Colors.blue[800]),
centerHeaderTitle: true, holidayStyle: TextStyle().copyWith(color: Colors.blue[800]),
formatButtonVisible: false, ),
), daysOfWeekStyle: DaysOfWeekStyle(
builders: CalendarBuilders( weekendStyle: TextStyle().copyWith(color: Colors.black, fontSize: 11.0, fontWeight: FontWeight.w600),
selectedDayBuilder: (context, date, _) { weekdayStyle: TextStyle().copyWith(color: Colors.black, fontSize: 11.0, fontWeight: FontWeight.w600),
return FadeTransition( ),
opacity: Tween(begin: 0.0, end: 1.0).animate(_animationController), headerStyle: HeaderStyle(centerHeaderTitle: true, formatButtonVisible: false, titleTextStyle: TextStyle(fontSize: 16, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
child: Container( builders: CalendarBuilders(
margin: const EdgeInsets.all(4.0), selectedDayBuilder: (context, date, _) {
padding: const EdgeInsets.only(top: 5.0, left: 6.0), return FadeTransition(
color: Colors.transparent, opacity: Tween(begin: 0.0, end: 1.0).animate(_animationController),
width: 0, child: Container(
height: 0, margin: const EdgeInsets.all(4.0),
child: Text( padding: const EdgeInsets.only(top: 5.0, left: 5.0),
'${date.day}', color: Colors.transparent,
style: TextStyle().copyWith(fontSize: 16.0), 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.brown[300]
: Colors.blue[400],
),
width: 40.0,
height: 40.0,
child: Center(
child: Text(
'${date.day}',
style: TextStyle().copyWith(
color: Colors.white,
fontSize: 14.0,
), ),
), );
), },
); todayDayBuilder: (context, date, _) {
}, return Container(
markersBuilder: (context, date, events, holidays) { decoration: BoxDecoration(
final children = <Widget>[]; shape: BoxShape.circle,
color: _calendarController.isSelected(date)
if (events.isNotEmpty) { ? Colors.green[400]
children.add( : _calendarController.isToday(date)
Positioned( ? Colors.transparent
right: 4, : Color(0xff76cfb7),
bottom: 4, ),
child: _buildEventsMarker(date, events), 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; return children;
}, },
),
onDaySelected: (date, event, _) {
_onDaySelected(date, event, projectViewModel);
_animationController.forward(from: 0.0);
},
onVisibleDaysChanged: _onVisibleDaysChanged,
onCalendarCreated: _onCalendarCreated,
),
), ),
onDaySelected: (date, event, _) {
_onDaySelected(date, event, projectViewModel);
_animationController.forward(from: 0.0);
},
onVisibleDaysChanged: _onVisibleDaysChanged,
onCalendarCreated: _onCalendarCreated,
); );
} }
openTimeSlotsPickerForDate(DateTime dateStart, List<TimeSlot> freeSlots) { openTimeSlotsPickerForDate(DateTime dateStart, List<TimeSlot> freeSlots) {
dayEvents.clear(); dayEvents.clear();
DateTime dateStartObj = new DateTime( DateTime dateStartObj = new DateTime(dateStart.year, dateStart.month, dateStart.day, 0, 0, 0, 0, 0);
dateStart.year, dateStart.month, dateStart.day, 0, 0, 0, 0, 0);
freeSlots.forEach((v) { freeSlots.forEach((v) {
if (v.start == dateStartObj) dayEvents.add(v); if (v.start == dateStartObj) dayEvents.add(v);
@ -396,47 +346,39 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
final DateFormat formatter = DateFormat('HH:mm'); final DateFormat formatter = DateFormat('HH:mm');
final DateFormat dateFormatter = DateFormat('yyyy-MM-dd'); final DateFormat dateFormatter = DateFormat('yyyy-MM-dd');
for (var i = 0; i < freeSlotsResponse.length; i++) { for (var i = 0; i < freeSlotsResponse.length; i++) {
date = date = DateUtil.convertStringToDate(freeSlotsResponse[i]['FreeTimeSlots']);
DateUtil.convertStringToDate(freeSlotsResponse[i]['FreeTimeSlots']);
slotsList.add(FreeSlot(date, ['slot'])); slotsList.add(FreeSlot(date, ['slot']));
docFreeSlots.add(TimeSlot( docFreeSlots.add(TimeSlot(isoTime: formatter.format(date), start: new DateTime(date.year, date.month, date.day, 0, 0, 0, 0), end: date));
isoTime: formatter.format(date),
start: new DateTime(date.year, date.month, date.day, 0, 0, 0, 0),
end: date));
} }
_eventsParsed = _eventsParsed = Map.fromIterable(slotsList, key: (e) => e.slot, value: (e) => e.event);
Map.fromIterable(slotsList, key: (e) => e.slot, value: (e) => e.event);
setState(() { setState(() {
CovidTimeSlots.selectedDate = dateFormatter.format( CovidTimeSlots.selectedDate = dateFormatter.format(DateUtil.convertStringToDate(freeSlotsResponse[0]['FreeTimeSlots']));
DateUtil.convertStringToDate(freeSlotsResponse[0]['FreeTimeSlots'])); selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(DateUtil.convertStringToDate(freeSlotsResponse[0]['FreeTimeSlots']), projectViewModel.isArabic ? "ar" : "en");
selectedDate = DateUtil.getMonthDayYearDateFormatted(
DateUtil.convertStringToDate(freeSlotsResponse[0]['FreeTimeSlots']));
selectedDateJSON = freeSlotsResponse[0]['FreeTimeSlots']; selectedDateJSON = freeSlotsResponse[0]['FreeTimeSlots'];
}); });
openTimeSlotsPickerForDate( openTimeSlotsPickerForDate(DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots);
DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots); _calendarController.setFocusedDay(DateUtil.convertStringToDate(selectedDateJSON));
_calendarController
.setFocusedDay(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: containerColorRadiusBorderWidth(
shape: BoxShape.circle, _calendarController.isSelected(date)
color: _calendarController.isSelected(date) ? CustomColors.green
? Colors.green[400] : _calendarController.isToday(date)
: _calendarController.isToday(date) ? CustomColors.green.withOpacity(0.5)
? Colors.brown[300] : Colors.white,
: Colors.blue[400], 200,
), _calendarController.isSelected(date) ? CustomColors.green : Colors.black,
2),
width: 40.0, width: 40.0,
height: 40.0, height: 40.0,
child: Center( child: Center(
child: Text( child: Text(
'${date.day}', '${date.day}',
style: TextStyle().copyWith( style: TextStyle().copyWith(
color: Colors.white, color: _calendarController.isSelected(date) ? Colors.white : Colors.black,
fontSize: 14.0, fontSize: 14.0,
), ),
), ),
@ -447,32 +389,31 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
Widget getNormalButton(int index) { Widget getNormalButton(int index) {
return RaisedButton( return RaisedButton(
color: Colors.white, color: Colors.white,
elevation: 0,
textColor: new Color(0xFF60686b), textColor: new Color(0xFF60686b),
onPressed: () { onPressed: () {
setState(() { setState(() {
selectedButtonIndex = index; selectedButtonIndex = index;
CovidTimeSlots.selectedTime = dayEvents[index].isoTime; CovidTimeSlots.selectedTime = dayEvents[index].isoTime;
print(CovidTimeSlots.selectedTime);
}); });
}, },
child: Text(dayEvents[index].isoTime, child: Text(dayEvents[index].isoTime, style: TextStyle(fontSize: 12.0)),
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)),
); );
} }
Widget getSelectedButton(int index) { Widget getSelectedButton(int index) {
return RaisedButton( return RaisedButton(
color: Colors.blue[400], color: CustomColors.green,
//Color of the border
textColor: Colors.white, textColor: Colors.white,
elevation: 0,
onPressed: () { onPressed: () {
setState(() { setState(() {
selectedButtonIndex = index; selectedButtonIndex = index;
CovidTimeSlots.selectedTime = dayEvents[index].isoTime; CovidTimeSlots.selectedTime = dayEvents[index].isoTime;
print(CovidTimeSlots.selectedTime);
}); });
}, },
child: Text(dayEvents[index].isoTime, child: Text(dayEvents[index].isoTime, style: TextStyle(fontSize: 12.0)),
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)),
); );
} }
@ -489,19 +430,11 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
service service
.insertAppointment( .insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, CovidTimeSlots.selectedTime, CovidTimeSlots.selectedDate, context, widget.selectedProcedure.procedureID)
docObject.doctorID,
docObject.clinicID,
docObject.projectID,
CovidTimeSlots.selectedTime,
CovidTimeSlots.selectedDate,
context,
widget.selectedProcedure.procedureID)
.then((res) { .then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: "Appointment Booked Successfully"); AppToast.showSuccessToast(message: "Appointment Booked Successfully");
getPatientShare(context, res['AppointmentNo'], docObject.clinicID, getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject);
docObject.projectID, docObject);
} else { } else {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
appo = new AppoitmentAllHistoryResultList(); appo = new AppoitmentAllHistoryResultList();
@ -532,16 +465,13 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
}); });
} }
cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context) {
BuildContext context) {
ConfirmDialog.closeAlertDialog(context); ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.cancelAppointment(appo, context).then((res) { service.cancelAppointment(appo, context).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
// Future.delayed(new Duration(milliseconds: 1500), () {
insertAppointmentCovidTest(context, docObject); insertAppointmentCovidTest(context, docObject);
// });
} else { } else {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
@ -551,12 +481,9 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
}); });
} }
getPatientShare(context, String appointmentNo, int clinicID, int projectID, getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) {
DoctorList docObject) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service.getPatientShare(appointmentNo, clinicID, projectID, context).then((res) {
.getPatientShare(appointmentNo, clinicID, projectID, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res); print(res);
widget.patientShareResponse = new PatientShareResponse.fromJson(res); widget.patientShareResponse = new PatientShareResponse.fromJson(res);
@ -571,31 +498,27 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: CovidPaymentAlert( page: CovidPaymentAlert(patientShareResponse: widget.patientShareResponse),
patientShareResponse: widget.patientShareResponse),
), ),
); );
} }
getCovidFreeSlots(BuildContext context, int projectID) { getCovidFreeSlots(BuildContext context, int projectID) {
CovidTimeSlots.areSlotsAvailable = false;
CovidDriveThruService service = new CovidDriveThruService(); CovidDriveThruService service = new CovidDriveThruService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getCovidFreeSlots(context, projectID).then((res) { service.getCovidFreeSlots(context, projectID).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
if (res['COVID19_FreeTimeSlots'].length != 0) { if (res['COVID19_FreeTimeSlots'].length != 0) {
CovidTimeSlots.areSlotsAvailable = true;
freeSlotsResponse = res['COVID19_FreeTimeSlots']; freeSlotsResponse = res['COVID19_FreeTimeSlots'];
_getJSONSlots().then((value) => { _getJSONSlots().then((value) => {
setState(() => { setState(() => {widget.selectedClinicID = freeSlotsResponse[0]['ClinicID'], widget.selectedDoctorID = freeSlotsResponse[0]['DoctorID'], _events.clear(), _events = value})
widget.selectedClinicID =
freeSlotsResponse[0]['ClinicID'],
widget.selectedDoctorID =
freeSlotsResponse[0]['DoctorID'],
_events.clear(),
_events = value
})
}); });
} else {} } else {
CovidTimeSlots.areSlotsAvailable = false;
}
} else { } else {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);

@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.da
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';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.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/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -42,12 +43,14 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest, appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
body: Column( body: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.all(20), padding: const EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
child: Text(localize.covidSelectProcedure, style: TextStyle(fontSize: 17, letterSpacing: 1, fontWeight: FontWeight.bold)), child: Text(localize.covidQuestionnaire, style: TextStyle(fontSize: 17, letterSpacing: 1, fontWeight: FontWeight.bold)),
), ),
Expanded( Expanded(
child: ListView.separated( child: ListView.separated(
@ -56,7 +59,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"];
return Padding( return Padding(
padding: const EdgeInsets.symmetric(vertical: 10), padding: const EdgeInsets.symmetric(vertical: 10),
child: Column( child: Column(
@ -99,16 +101,9 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 1, widthFactor: 1,
child: MaterialButton( child: DefaultButton(localize.next, () {
height: 50, next();
color: Theme.of(context).appBarTheme.color, }),
disabledColor: Theme.of(context).appBarTheme.color.withOpacity(0.25),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
child: Text(
localize.next,
style: TextStyle(color: Colors.white, fontSize: 13, letterSpacing: 1),
),
onPressed: next),
), ),
), ),
], ],
@ -132,7 +127,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
openPassportUpdatePage() { openPassportUpdatePage() {
Navigator.push(context, FadePage(page: PassportUpdatePage())).then((value) { Navigator.push(context, FadePage(page: PassportUpdatePage())).then((value) {
print(value); print(value);
if(value != null && value == true) { if (value != null && value == true) {
getPaymentInfo(context, widget.projectId); getPaymentInfo(context, widget.projectId);
} }
}); });

@ -58,27 +58,28 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest, appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
description: TranslationBase.of(context).covidInfo, description: TranslationBase.of(context).covidInfo,
isShowDecPage: true, isShowDecPage: true,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0), margin: EdgeInsets.fromLTRB(15.0, 10.0, 15.0, 0.0),
child: Column( child: Column(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
Container( Container(
alignment: projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft, alignment: projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft,
child: Text(TranslationBase.of(context).resultHeader, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 22.0, color: Colors.black)), child: Text(TranslationBase.of(context).resultHeader, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20.0, color: Colors.black, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins')),
), ),
Container( Container(
margin: EdgeInsets.only(top: 10.0), child: Text(TranslationBase.of(context).covidInfo, style: TextStyle(fontSize: 14.0, color: Colors.black)),
child: Text(TranslationBase.of(context).covidInfo, style: TextStyle(fontSize: 16.0, color: Colors.black)),
), ),
Container( Container(
margin: EdgeInsets.only(top: 20.0), margin: EdgeInsets.only(top: 5.0),
alignment: projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft, alignment: projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft,
child: Text(TranslationBase.of(context).selectLocation, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18.0, letterSpacing: 0.8, color: Colors.grey[700])), child: Text(TranslationBase.of(context).selectLocation, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16.0, letterSpacing: 0.8, color: Colors.grey[700], fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins')),
), ),
Container( Container(
height: 60.0, height: 60.0,
@ -92,7 +93,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
), ),
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
margin: EdgeInsets.only(top: 15.0), margin: EdgeInsets.only(top: 5.0),
child: DropdownButtonHideUnderline( child: DropdownButtonHideUnderline(
child: DropdownButton<DriveThroughTestingCenterModel>( child: DropdownButton<DriveThroughTestingCenterModel>(
hint: new Text(TranslationBase.of(context).selectAddress), hint: new Text(TranslationBase.of(context).selectAddress),
@ -111,16 +112,16 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
}, },
), ),
)), )),
// isLocationSelected
// ? Container(
// margin: EdgeInsets.only(top: 15.0),
// alignment: projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft,
// child: Text(TranslationBase.of(context).selectLocation, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18.0, letterSpacing: 0.8, color: Colors.black)),
// )
// : Container(),
isLocationSelected isLocationSelected
? Container( ? Container(
margin: EdgeInsets.only(top: 15.0), margin: EdgeInsets.only(top: 10.0),
alignment: projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft,
child: Text(TranslationBase.of(context).selectLocation, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18.0, letterSpacing: 0.8, color: Colors.black)),
)
: Container(),
isLocationSelected
? Container(
margin: EdgeInsets.only(top: 5.0),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all(color: Colors.grey[400], width: 1.0), border: Border.all(color: Colors.grey[400], width: 1.0),
), ),

@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.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';
@ -29,12 +30,14 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest, appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Container(
height: 200.0, height: 180.0,
color: new Color(0xFFc5272d), color: new Color(0xFFc5272d),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
@ -76,7 +79,7 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
), ),
), ),
Container( Container(
margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 30.0), margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 15.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
@ -91,7 +94,7 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
), ),
Container( Container(
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.only(top: 15.0), margin: EdgeInsets.only(top: 5.0),
child: Text( child: Text(
TranslationBase.of(context).covidAlertInfo, TranslationBase.of(context).covidAlertInfo,
textAlign: TextAlign.center, textAlign: TextAlign.center,
@ -102,7 +105,7 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
), ),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
top: 40.0, bottom: 10.0, left: 0.0, right: 20.0), top: 20.0, bottom: 10.0, left: 0.0, right: 20.0),
child: Text(TranslationBase.of(context).appoInfo, child: Text(TranslationBase.of(context).appoInfo,
style: TextStyle( style: TextStyle(
fontSize: 18.0, fontSize: 18.0,
@ -244,40 +247,49 @@ class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
], ],
), ),
), ),
], Container(
), margin: EdgeInsets.all(20.0),
), child: DefaultButton(
bottomSheet: Container( TranslationBase.of(context).next,
margin: EdgeInsets.all(10.0), () {
child: Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
flex: 1,
child: Container(
margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: Colors.grey[500],
onPressed: () {
startPaymentProcess(); startPaymentProcess();
}, },
child: Text(TranslationBase.of(context).next, style: TextStyle(fontSize: 18.0)),
),
),
), ),
), ),
], ],
), ),
), ),
// bottomSheet: Container(
// margin: EdgeInsets.all(10.0),
// child: Flex(
// direction: Axis.horizontal,
// children: <Widget>[
// Expanded(
// flex: 1,
// child: Container(
// margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0),
// child: ButtonTheme(
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(10.0),
// ),
// minWidth: MediaQuery.of(context).size.width * 0.7,
// height: 45.0,
// child: RaisedButton(
// color: new Color(0xFF60686b),
// textColor: Colors.white,
// disabledTextColor: Colors.white,
// disabledColor: Colors.grey[500],
// onPressed: () {
// startPaymentProcess();
// },
// child: Text(TranslationBase.of(context).next, style: TextStyle(fontSize: 18.0)),
// ),
// ),
// ),
// ),
// ],
// ),
// ),
); );
} }

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/pages/Covid-DriveThru/Covid-TimeSlots.dart'
import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart'; import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.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';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.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';
@ -16,10 +17,7 @@ class CovidPaymentDetails extends StatefulWidget {
List<CovidTestProceduresResponse> proceduresList; List<CovidTestProceduresResponse> proceduresList;
CovidTestProceduresResponse selectedProcedure; CovidTestProceduresResponse selectedProcedure;
CovidPaymentDetails( CovidPaymentDetails({@required this.covidPaymentInfoResponse, @required this.projectID, @required this.proceduresList});
{@required this.covidPaymentInfoResponse,
@required this.projectID,
@required this.proceduresList});
@override @override
_CovidPaymentDetailsState createState() => _CovidPaymentDetailsState(); _CovidPaymentDetailsState createState() => _CovidPaymentDetailsState();
@ -39,6 +37,8 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest, appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 100.0), margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 100.0),
@ -49,8 +49,7 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
height: 150.0, height: 150.0,
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: AssetImage( image: AssetImage("assets/images/new-design/covid-19-big-banner-bg.png"),
"assets/images/new-design/covid-19-big-banner-bg.png"),
fit: BoxFit.fill, fit: BoxFit.fill,
), ),
color: Colors.white.withOpacity(0.3), color: Colors.white.withOpacity(0.3),
@ -59,31 +58,19 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Container(
margin: margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 30.0),
EdgeInsets.only(left: 15.0, right: 15.0, top: 30.0), child: SvgPicture.asset('assets/images/new-design/covid-19-car.svg', width: 90.0, height: 90.0),
child: SvgPicture.asset(
'assets/images/new-design/covid-19-car.svg',
width: 90.0,
height: 90.0),
), ),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 20.0),
left: 20.0, right: 20.0, top: 20.0), child: Text(TranslationBase.of(context).covidTest, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 24.0)),
child: Text(TranslationBase.of(context).covidTest,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 24.0)),
), ),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 10.0),
left: 20.0, right: 20.0, top: 10.0), child: Text(TranslationBase.of(context).driveThru, style: TextStyle(color: Colors.white, fontSize: 24.0)),
child: Text(TranslationBase.of(context).driveThru,
style: TextStyle(
color: Colors.white, fontSize: 24.0)),
), ),
], ],
), ),
@ -91,23 +78,15 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
), ),
), ),
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(10.0), color: Colors.white),
borderRadius: BorderRadius.circular(10.0), margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 5.0),
color: Colors.white),
margin: EdgeInsets.fromLTRB(0.0, 30.0, 0.0, 5.0),
padding: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 20.0), padding: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 20.0),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Container( Container(
alignment: Alignment.center, alignment: Alignment.center,
margin: margin: EdgeInsets.only(left: 0.0, right: 20.0, top: 10.0),
EdgeInsets.only(left: 0.0, right: 20.0, top: 10.0), child: Text(TranslationBase.of(context).covidSelectProcedure, style: TextStyle(color: Colors.black, fontSize: 20.0, fontWeight: FontWeight.bold)),
child: Text(
TranslationBase.of(context).covidSelectProcedure,
style: TextStyle(
color: Colors.black,
fontSize: 20.0,
fontWeight: FontWeight.bold)),
), ),
...List.generate( ...List.generate(
widget.proceduresList.length, widget.proceduresList.length,
@ -124,15 +103,11 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
child: InkWell( child: InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
widget.selectedProcedure = widget.selectedProcedure = widget.proceduresList[index];
widget.proceduresList[index];
}); });
}, },
child: ListTile( child: ListTile(
title: Text( title: Text(widget.proceduresList[index].procedureName, style: TextStyle(fontSize: 14.0)),
widget.proceduresList[index]
.procedureName,
style: TextStyle(fontSize: 14.0)),
leading: Radio( leading: Radio(
value: widget.proceduresList[index], value: widget.proceduresList[index],
groupValue: widget.selectedProcedure, groupValue: widget.selectedProcedure,
@ -141,13 +116,8 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
widget.selectedProcedure = value; widget.selectedProcedure = value;
print(widget print(widget.selectedProcedure.procedureName);
.selectedProcedure.procedureName); getPaymentInfo(context, widget.projectID.toString(), widget.selectedProcedure.procedureID);
getPaymentInfo(
context,
widget.projectID.toString(),
widget.selectedProcedure
.procedureID);
}); });
}, },
), ),
@ -162,44 +132,22 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
Divider(), Divider(),
Container( Container(
alignment: Alignment.center, alignment: Alignment.center,
margin: margin: EdgeInsets.only(left: 0.0, right: 20.0, top: 0.0),
EdgeInsets.only(left: 0.0, right: 20.0, top: 10.0), child: Text(TranslationBase.of(context).testFee, style: TextStyle(color: Colors.black, fontSize: 22.0, fontWeight: FontWeight.bold)),
child: Text(TranslationBase.of(context).testFee,
style: TextStyle(
color: Colors.black,
fontSize: 22.0,
fontWeight: FontWeight.bold)),
), ),
Table( Table(
children: [ children: [
TableRow(children: [ TableRow(children: [
TableCell( TableCell(child: _getNormalText(TranslationBase.of(context).patientShareToDo)),
child: _getNormalText(TranslationBase.of(context) TableCell(child: _getNormalText(widget.covidPaymentInfoResponse.patientShareField.toString())),
.patientShareToDo)),
TableCell(
child: _getNormalText(widget
.covidPaymentInfoResponse.patientShareField
.toString())),
]), ]),
TableRow(children: [ TableRow(children: [
TableCell( TableCell(child: _getNormalText(TranslationBase.of(context).patientTaxToDo)),
child: _getNormalText( TableCell(child: _getNormalText(widget.covidPaymentInfoResponse.patientTaxAmountField.toString())),
TranslationBase.of(context).patientTaxToDo)),
TableCell(
child: _getNormalText(widget
.covidPaymentInfoResponse
.patientTaxAmountField
.toString())),
]), ]),
TableRow(children: [ TableRow(children: [
TableCell( TableCell(child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo)),
child: _getNormalText(TranslationBase.of(context) TableCell(child: _getNormalText(widget.covidPaymentInfoResponse.patientShareWithTaxField.toString())),
.patientShareTotalToDo)),
TableCell(
child: _getNormalText(widget
.covidPaymentInfoResponse
.patientShareWithTaxField
.toString())),
]), ]),
], ],
), ),
@ -221,8 +169,7 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
}, },
activeColor: Color(0xffB8382C), activeColor: Color(0xffB8382C),
), ),
Texts(TranslationBase.of(context) Texts(TranslationBase.of(context).iAgreeToTheTermsAndConditions),
.iAgreeToTheTermsAndConditions),
], ],
), ),
), ),
@ -232,26 +179,20 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
Container( Container(
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.fromLTRB(20.0, 15.0, 20.0, 5.0), margin: EdgeInsets.fromLTRB(20.0, 15.0, 20.0, 5.0),
child: Text(TranslationBase.of(context).payOptions, child: Text(TranslationBase.of(context).payOptions, textAlign: TextAlign.center, style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, fontFamily: "Open-Sans")),
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.bold,
fontFamily: "Open-Sans")),
), ),
Container( Container(
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 5.0), margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 5.0),
child: Image.asset( child: Image.asset("assets/images/new-design/payment_options_invoice_confirmation.png", width: 300),
"assets/images/new-design/payment_options_invoice_confirmation.png",
width: 300),
), ),
], ],
), ),
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 20.0), color: Colors.grey[100],
padding: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 10.0),
child: Flex( child: Flex(
direction: Axis.horizontal, direction: Axis.horizontal,
children: <Widget>[ children: <Widget>[
@ -265,17 +206,9 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
), ),
minWidth: MediaQuery.of(context).size.width * 0.7, minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0, height: 45.0,
child: RaisedButton( child: DefaultButton(TranslationBase.of(context).cancel, () {
color: new Color(0xFF60686b), cancel();
textColor: Colors.white, }, color: Color(0xffEAEAEA), textColor: Color(0xff000000)),
disabledTextColor: Colors.white,
disabledColor: Colors.grey[500],
onPressed: () {
cancel();
},
child: Text(TranslationBase.of(context).cancel,
style: TextStyle(fontSize: 18.0)),
),
), ),
), ),
), ),
@ -289,14 +222,14 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
), ),
minWidth: MediaQuery.of(context).size.width * 0.7, minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0, height: 45.0,
child: RaisedButton( child: DefaultButton(
color: new Color(0xFF60686b), TranslationBase.of(context).next,
textColor: Colors.white, isAgree
disabledTextColor: Colors.white, ? () {
disabledColor: Colors.grey[500], next();
onPressed: isAgree ? next : null, }
child: Text(TranslationBase.of(context).next, : null,
style: TextStyle(fontSize: 18.0)), disabledColor: Color(0x8ac5272d),
), ),
), ),
), ),
@ -321,19 +254,14 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
Navigator.pop(context); Navigator.pop(context);
} }
getPaymentInfo( getPaymentInfo(BuildContext context, String projectID, String selectedProcedureID) {
BuildContext context, String projectID, String selectedProcedureID) {
CovidDriveThruService service = new CovidDriveThruService(); CovidDriveThruService service = new CovidDriveThruService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service service.getCovidPaymentInformation(context, int.parse(projectID), selectedProcedureID).then((res) {
.getCovidPaymentInformation(
context, int.parse(projectID), selectedProcedureID)
.then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
widget.covidPaymentInfoResponse = widget.covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']);
CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']);
}); });
} else {} } else {}
}).catchError((err) { }).catchError((err) {
@ -344,13 +272,7 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
_getNormalText(text) { _getNormalText(text) {
return Container( return Container(
margin: EdgeInsets.only(top: 20.0, right: 10.0), margin: EdgeInsets.only(top: 20.0, right: 10.0),
child: Text(text, child: Text(text, textAlign: TextAlign.end, style: TextStyle(fontSize: 15, fontFamily: 'Open-Sans', letterSpacing: 0.5, color: Colors.grey[700])),
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 15,
fontFamily: 'Open-Sans',
letterSpacing: 0.5,
color: Colors.grey[700])),
); );
} }
} }

@ -10,6 +10,7 @@ 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';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
@ -41,6 +42,8 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest, appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true, isShowAppBar: true,
showNewAppBarTitle: true,
showNewAppBar: true,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
child: Container( child: Container(
@ -121,14 +124,11 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.1, color: Colors.grey[100],
width: double.infinity,
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
child: SecondaryButton( child: DefaultButton(
textColor: Colors.white, TranslationBase.of(context).confirm.toUpperCase(),
color: Theme.of(context).primaryColor, () {
label: TranslationBase.of(context).confirm.toUpperCase(),
onTap: () {
startPaymentProcess(projectViewModel.user); startPaymentProcess(projectViewModel.user);
}, },
), ),

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/model/er/projectavgerwaitingtime.dart'; import 'package:diplomaticquarterapp/core/model/er/projectavgerwaitingtime.dart';
import 'package:diplomaticquarterapp/core/service/er/er_service.dart'; import 'package:diplomaticquarterapp/core/service/er/er_service.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/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -24,6 +25,8 @@ class NearestEr extends StatefulWidget {
class _NearestErState extends State<NearestEr> { class _NearestErState extends State<NearestEr> {
List<ProjectAvgERWaitingTime> projectAvgERWaitingTimeModelList = List(); List<ProjectAvgERWaitingTime> projectAvgERWaitingTimeModelList = List();
bool isDataLoaded = false;
@override @override
void initState() { void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) => getERList()); WidgetsBinding.instance.addPostFrameCallback((_) => getERList());
@ -39,12 +42,14 @@ class _NearestErState extends State<NearestEr> {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).NearestEr, appBarTitle: TranslationBase.of(context).NearestEr,
body: projectAvgERWaitingTimeModelList.length > 0 body: isDataLoaded
? Container( ? Container(
child: ListView( child: ListView(
children: <Widget>[ children: <Widget>[
Text("${TranslationBase.of(context).NearestErDesc}", Text(TranslationBase.of(context).NearestErDesc,
textAlign: TextAlign.center, style: TextStyle(fontSize: 18.0, letterSpacing: 1.0, fontWeight: FontWeight.w900, color: new Color(0xFF60686b))), textAlign: TextAlign.center, style: TextStyle(fontSize: 18.0, letterSpacing: 1.0, fontWeight: FontWeight.w900, color: new Color(0xFF60686b))),
Container( Container(
margin: EdgeInsets.fromLTRB(2.0, 10.0, 0.0, 10.0), margin: EdgeInsets.fromLTRB(2.0, 10.0, 0.0, 10.0),
@ -56,13 +61,13 @@ class _NearestErState extends State<NearestEr> {
controller: new ScrollController(keepScrollOffset: false), controller: new ScrollController(keepScrollOffset: false),
shrinkWrap: true, shrinkWrap: true,
padding: const EdgeInsets.all(4.0), padding: const EdgeInsets.all(4.0),
children: List.generate(7, (index) { children: List.generate(projectAvgERWaitingTimeModelList.length, (index) {
return Container( return Container(
child: CardPosition( child: CardPosition(
waitingTime: projectAvgERWaitingTimeModelList[index].avgTimeInHHMM.toString(), waitingTime: projectAvgERWaitingTimeModelList[index].avgTimeInHHMM.toString(),
text: projectAvgERWaitingTimeModelList[index].projectName.toString(), text: projectAvgERWaitingTimeModelList[index].projectName.toString(),
image: 'assets/images/new-design/find_us_icon.png', image: 'assets/images/new-design/find_us_icon.png',
subText: '${projectAvgERWaitingTimeModelList[index].distanceInKilometers ?? 0.0} ${TranslationBase.of(context).km_}', subText: projectAvgERWaitingTimeModelList[index].distanceInKilometers.toString() + " " + TranslationBase.of(context).km,
type: projectAvgERWaitingTimeModelList[index].iD.toString(), type: projectAvgERWaitingTimeModelList[index].iD.toString(),
telephone: projectAvgERWaitingTimeModelList[index].phoneNumber.toString(), telephone: projectAvgERWaitingTimeModelList[index].phoneNumber.toString(),
networkImage: projectAvgERWaitingTimeModelList[index].projectImageURL.toString(), networkImage: projectAvgERWaitingTimeModelList[index].projectImageURL.toString(),
@ -94,11 +99,15 @@ class _NearestErState extends State<NearestEr> {
response['List_ProjectAvgERWaitingTime'].forEach((vital) { response['List_ProjectAvgERWaitingTime'].forEach((vital) {
projectAvgERWaitingTimeModelList.add(ProjectAvgERWaitingTime.fromJson(vital)); projectAvgERWaitingTimeModelList.add(ProjectAvgERWaitingTime.fromJson(vital));
}); });
isDataLoaded = true;
}); });
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
} else {} } else {
isDataLoaded = false;
}
}).catchError((err) { }).catchError((err) {
print(err); print(err);
AppToast.showErrorToast(message: err);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}); });
} }

@ -15,6 +15,8 @@ class FeedbackDetails extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
appBarTitle: TranslationBase.of(context).feedbackTitle, appBarTitle: TranslationBase.of(context).feedbackTitle,
body: Container( body: Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),

@ -28,7 +28,9 @@ class ServicesView extends StatelessWidget {
return InkWell( return InkWell(
onTap: () { onTap: () {
if (index == 0) { if (index == 0) {
Navigator.push(context, FadePage(page: LiveCareHome())); Navigator.push(context, FadePage(page: LiveCareHome())).then((value) {
LiveCareHome.isLiveCareTypeSelected = false;
});
} else if (index == 1) { } else if (index == 1) {
Navigator.push(context, FadePage(page: CovidDrivethruLocation())); Navigator.push(context, FadePage(page: CovidDrivethruLocation()));
} else if (index == 2) { } else if (index == 2) {

@ -14,6 +14,7 @@ import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
class LiveCareHome extends StatefulWidget { class LiveCareHome extends StatefulWidget {
static bool showFooterButton = true; static bool showFooterButton = true;
static bool isLiveCareTypeSelected = false;
@override @override
_LiveCareHomeState createState() => _LiveCareHomeState(); _LiveCareHomeState createState() => _LiveCareHomeState();
@ -52,11 +53,12 @@ class _LiveCareHomeState extends State<LiveCareHome> with SingleTickerProviderSt
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).livecare, appBarTitle: TranslationBase.of(context).livecare,
isShowAppBar: true, isShowAppBar: true,
showNewAppBarTitle: true,
showNewAppBar: true,
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
description: TranslationBase.of(context).erConsultation, description: TranslationBase.of(context).erConsultation,
body: Container( body: Container(
child: Column(children: [ child: Column(children: [
/// this is will not colored with theme data
TabBar( TabBar(
labelColor: Colors.black, labelColor: Colors.black,
tabs: [ tabs: [
@ -65,10 +67,6 @@ class _LiveCareHomeState extends State<LiveCareHome> with SingleTickerProviderSt
], ],
controller: _tabController, controller: _tabController,
), ),
Divider(
color: Colors.grey[600],
thickness: 0.5,
),
Expanded( Expanded(
child: TabBarView( child: TabBarView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
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:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
@ -21,20 +22,25 @@ class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return AppScaffold(
appBar: AppBar( isShowDecPage: true,
leading: InkWell( isShowAppBar: true,
onTap: () { showNewAppBarTitle: true,
Navigator.pop(context, null); showNewAppBar: true,
}, appBarTitle: TranslationBase.of(context).livecare.toUpperCase(),
child: Icon( // appBar: AppBar(
Icons.close, // leading: InkWell(
color: Colors.white, // onTap: () {
), // Navigator.pop(context, null);
), // },
title: Text(TranslationBase.of(context).bookAppo, // child: Icon(
style: TextStyle(color: Colors.white)), // Icons.close,
), // color: Colors.white,
// ),
// ),
// title: Text(TranslationBase.of(context).bookAppo,
// style: TextStyle(color: Colors.white)),
// ),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
margin: EdgeInsets.only(left: 20.0, right: 20.0), margin: EdgeInsets.only(left: 20.0, right: 20.0),
@ -55,19 +61,19 @@ class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 20.0))), fontWeight: FontWeight.bold, fontSize: 20.0))),
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 0.0),
alignment: Alignment.center, alignment: Alignment.center,
child: Text( child: Text(
TranslationBase.of(context).livecareServiceDesc, TranslationBase.of(context).livecareServiceDesc,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(fontSize: 18.0))), style: TextStyle(fontSize: 18.0))),
Container( Container(
margin: EdgeInsets.only(top: 15.0), margin: EdgeInsets.only(top: 5.0),
child: Text(TranslationBase.of(context).whyLivecare, child: Text(TranslationBase.of(context).whyLivecare,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 20.0))), fontWeight: FontWeight.bold, fontSize: 20.0))),
Container( Container(
margin: EdgeInsets.only(top: 20.0, left: 20.0), margin: EdgeInsets.only(top: 0.0, left: 20.0),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
SvgPicture.asset("assets/images/new-design/check_icon.svg", SvgPicture.asset("assets/images/new-design/check_icon.svg",
@ -116,10 +122,10 @@ class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
), ),
), ),
Container( Container(
margin: EdgeInsets.only(top: 20.0), margin: EdgeInsets.only(top: 10.0),
child: Text( child: Text(
TranslationBase.of(context).livecareSummary, TranslationBase.of(context).livecareSummary,
style: TextStyle(fontSize: 16.0))), style: TextStyle(fontSize: 12.0))),
InkWell( InkWell(
onTap: (){ onTap: (){
Navigator.pop(context, "immediate"); Navigator.pop(context, "immediate");
@ -128,7 +134,7 @@ class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.red[900], color: Colors.red[900],
borderRadius: BorderRadius.all(Radius.circular(10.0))), borderRadius: BorderRadius.all(Radius.circular(10.0))),
height: 120.0, height: 100.0,
margin: EdgeInsets.only(top: 20.0), margin: EdgeInsets.only(top: 20.0),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
@ -140,8 +146,9 @@ class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.56, width: MediaQuery.of(context).size.width * 0.56,
margin: EdgeInsets.fromLTRB(30.0, 20.0, 0.0, 0.0), margin: EdgeInsets.fromLTRB(30.0, 10.0, 0.0, 0.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text(TranslationBase.of(context).livecareOption1, Text(TranslationBase.of(context).livecareOption1,
overflow: TextOverflow.clip, overflow: TextOverflow.clip,
@ -150,8 +157,8 @@ class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
fontSize: 18.0, fontSize: 18.0,
color: Colors.white)), color: Colors.white)),
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 0.0),
child: Text(TranslationBase.of(context).livecareOption2, child: Text(TranslationBase.of(context).livecareOption2, textAlign: TextAlign.start,
style: TextStyle( style: TextStyle(
fontSize: 18.0, color: Colors.white)), fontSize: 18.0, color: Colors.white)),
) )
@ -169,7 +176,7 @@ class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.grey[700], color: Colors.grey[700],
borderRadius: BorderRadius.all(Radius.circular(10.0))), borderRadius: BorderRadius.all(Radius.circular(10.0))),
height: 120.0, height: 100.0,
margin: EdgeInsets.only(top: 20.0), margin: EdgeInsets.only(top: 20.0),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
@ -177,11 +184,11 @@ class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
margin: EdgeInsets.only(left: 10.0, right: 10.0), margin: EdgeInsets.only(left: 10.0, right: 10.0),
child: Image.asset( child: Image.asset(
"assets/images/new-design/calendar.png", "assets/images/new-design/calendar.png",
width: 70), width: 60),
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.58, width: MediaQuery.of(context).size.width * 0.53,
margin: EdgeInsets.fromLTRB(30.0, 20.0, 0.0, 0.0), margin: EdgeInsets.fromLTRB(30.0, 10.0, 0.0, 0.0),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Container( Container(

@ -36,7 +36,7 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
shape: shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)), RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)),
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 0.691, height: 600.0,
margin: EdgeInsets.all(20.0), margin: EdgeInsets.all(20.0),
width: 450.0, width: 450.0,
child: SingleChildScrollView( child: SingleChildScrollView(

@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/models/LiveCare/LiveCareClinicsListResponse
import 'package:diplomaticquarterapp/models/LiveCare/LiveCareScheduleClinicsListResponse.dart'; import 'package:diplomaticquarterapp/models/LiveCare/LiveCareScheduleClinicsListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_scheduling/schedule_clinic_card.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_scheduling/schedule_clinic_card.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_type_select.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_type_select.dart';
import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCareInfoDialog.dart'; import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCareInfoDialog.dart';
@ -20,6 +21,7 @@ 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';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -58,8 +60,6 @@ class _clinic_listState extends State<ClinicList> {
MyInAppBrowser browser; MyInAppBrowser browser;
bool isLiveCareTypeSelected = false;
String liveCareClinicIDs; String liveCareClinicIDs;
@override @override
@ -72,8 +72,13 @@ class _clinic_listState extends State<ClinicList> {
liveCareScheduleClinicsListResponse = new LiveCareScheduleClinicsListResponse(); liveCareScheduleClinicsListResponse = new LiveCareScheduleClinicsListResponse();
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
if (!isLiveCareTypeSelected) { if (LiveCareHome.isLiveCareTypeSelected != true) {
openLiveCareSelectionDialog(); openLiveCareSelectionDialog();
} else {
print("LiveCare Type Selected");
setState(() {
currentSelectedLiveCareType = "immediate";
});
} }
}); });
@ -404,15 +409,16 @@ class _clinic_listState extends State<ClinicList> {
Navigator.pop(context); Navigator.pop(context);
} else { } else {
print(value); print(value);
isLiveCareTypeSelected = true;
if (value == "immediate") { if (value == "immediate") {
setState(() { setState(() {
LiveCareHome.isLiveCareTypeSelected = true;
currentSelectedLiveCareType = "immediate"; currentSelectedLiveCareType = "immediate";
}); });
getLiveCareClinicsList(); getLiveCareClinicsList();
} }
if (value == "schedule") { if (value == "schedule") {
setState(() { setState(() {
LiveCareHome.isLiveCareTypeSelected = true;
currentSelectedLiveCareType = "schedule"; currentSelectedLiveCareType = "schedule";
}); });
getLiveCareScheduleClinicsList(); getLiveCareScheduleClinicsList();
@ -463,7 +469,7 @@ class _clinic_listState extends State<ClinicList> {
child: Container( child: Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
height: 50.0, height: 50.0,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 0.0),
child: ButtonTheme( child: ButtonTheme(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
@ -491,7 +497,7 @@ class _clinic_listState extends State<ClinicList> {
children: <Widget>[ children: <Widget>[
isDataLoaded isDataLoaded
? Container( ? Container(
height: MediaQuery.of(context).size.height * 0.7, height: MediaQuery.of(context).size.height * 0.8,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -529,27 +535,17 @@ class _clinic_listState extends State<ClinicList> {
shrinkWrap: true, shrinkWrap: true,
physics: ScrollPhysics(), physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0), padding: EdgeInsets.all(0.0),
// itemCount: liveCareClinicsListResponse.patientERGetClinicsList.length,
itemCount: liveCareOfflineClinicsListResponse.length, itemCount: liveCareOfflineClinicsListResponse.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return InkWell( return ClinicCard(
onTap: () { isSelected: selectedClinicID == liveCareOfflineClinicsListResponse[index].serviceID ? true : false,
// if (liveCareClinicsListResponse.patientERGetClinicsList[index].isOnline == 1) { patientERGetClinicsList: liveCareOfflineClinicsListResponse[index],
// updateSelectedIndex(liveCareOnlineClinicsListResponse[index]); languageID: languageID,
// } else {
// AppToast.showErrorToast(message: "Clinic is offline");
// }
},
child: ClinicCard(
isSelected: selectedClinicID == liveCareOfflineClinicsListResponse[index].serviceID ? true : false,
patientERGetClinicsList: liveCareOfflineClinicsListResponse[index],
languageID: languageID,
),
); );
}, },
), ),
Container( Container(
height: 10.0, height: 50.0,
), ),
], ],
)), )),
@ -559,23 +555,16 @@ class _clinic_listState extends State<ClinicList> {
? Align( ? Align(
alignment: FractionalOffset.bottomCenter, alignment: FractionalOffset.bottomCenter,
child: Container( child: Container(
color: Colors.grey[100],
transform: Matrix4.translationValues(0.0, -40.0, 0.0),
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
height: 50.0, height: 50.0,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 20.0), margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 20.0),
child: ButtonTheme( child: Container(
shape: RoundedRectangleBorder( margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0),
borderRadius: BorderRadius.circular(10.0), child: DefaultButton(TranslationBase.of(context).start, () {
), startLiveCare();
minWidth: MediaQuery.of(context).size.width * 0.7, }),
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: startLiveCare,
child: Text(TranslationBase.of(context).start, style: TextStyle(fontSize: 18.0)),
),
), ),
), ),
) )

@ -1,16 +1,13 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/pages/ContactUs/widgets/card_common_contat.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/advance_payment_page.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/my_balance_page.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.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/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class PaymentService extends StatelessWidget { class PaymentService extends StatelessWidget {
@ -21,151 +18,31 @@ class PaymentService extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
model = Provider.of<ToDoCountProviderModel>(context); model = Provider.of<ToDoCountProviderModel>(context);
List<Widget> paymentServiceList = getPaymentServiceList(context);
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).paymentService, appBarTitle: TranslationBase.of(context).paymentService,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
margin: EdgeInsets.all(12), margin: EdgeInsets.all(20.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Padding(
children: [ padding: EdgeInsets.only(left: 12, right: 12),
Expanded( child: GridView.builder(
child: InkWell( shrinkWrap: true,
onTap: () => Navigator.push( primary: false,
context, FadePage(page: AdvancePaymentPage())), physics: NeverScrollableScrollPhysics(),
child: Container( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9),
margin: EdgeInsets.all(5.0), padding: EdgeInsets.zero,
padding: EdgeInsets.all(9), itemCount: paymentServiceList.length,
decoration: BoxDecoration( itemBuilder: (BuildContext context, int index) {
color: Colors.white, return paymentServiceList[index];
borderRadius: BorderRadius.circular(8.0), },
shape: BoxShape.rectangle), ),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).payment,
color: HexColor('#B61422'),
bold: true,
),
Texts(
TranslationBase.of(context).paymentOnline,
fontSize: 14,
fontWeight: FontWeight.normal,
),
SizedBox(
height: 12,
),
Container(
margin: EdgeInsets.only(left: 10, right: 10),
child: Image.asset(
'assets/images/online_payment_icon.png',
fit: BoxFit.fill,
height: 55,
width: double.infinity,
),
),
],
),
),
),
),
//if(!projectViewModel.havePrivilege(33))
Expanded(
child: InkWell(
onTap: () => navigateToToDoPage(context),
child: Container(
margin: EdgeInsets.all(5.0),
padding: EdgeInsets.all(9),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8.0),
shape: BoxShape.rectangle),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).onlineCheckIn,
color: HexColor('#B61422'),
bold: true,
),
Texts(
TranslationBase.of(context).appointment,
fontSize: 14,
fontWeight: FontWeight.normal,
),
SizedBox(
height: 12,
),
Align(
alignment: !projectViewModel.isArabic
? Alignment.centerRight
: Alignment.centerLeft,
child: Image.asset(
'assets/images/device_icon.png',
height: 55,
),
),
],
),
),
),
)
],
),
//if(!projectViewModel.havePrivilege(33))
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: InkWell(
onTap: () => Navigator.push(
context, FadePage(page: MyBalancePage())),
child: Container(
margin: EdgeInsets.all(5.0),
padding: EdgeInsets.all(9),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8.0),
shape: BoxShape.rectangle),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).hmg,
color: HexColor('#B61422'),
bold: true,
),
Texts(
TranslationBase.of(context).wallet,
fontSize: 14,
fontWeight: FontWeight.normal,
),
SizedBox(
height: 12,
),
Align(
alignment: !projectViewModel.isArabic
? Alignment.centerRight
: Alignment.centerLeft,
child: Image.asset(
'assets/images/new-design/check-in.png',
height: 55,
),
),
],
),
),
),
),
Expanded(
child: Container(),
)
],
), ),
], ],
), ),
@ -174,13 +51,57 @@ class PaymentService extends StatelessWidget {
); );
} }
List<Widget> getPaymentServiceList(BuildContext context) {
List<Widget> medical = List();
medical.add(
CardCommonContact(
image: 'assets/images/online_payment_icon.png',
text: TranslationBase.of(context).payment,
subText: TranslationBase.of(context).paymentOnline,
type: 6,
width: double.infinity,
height: 55.0,
projectViewModel: projectViewModel,
model: model,
),
);
medical.add(
CardCommonContact(
image: 'assets/images/device_icon.png',
text: TranslationBase.of(context).onlineCheckIn,
subText: TranslationBase.of(context).appointment,
type: 7,
width: 70.0,
height: 60.0,
projectViewModel: projectViewModel,
model: model,
),
);
medical.add(
CardCommonContact(
image: 'assets/images/check-in.png',
text: TranslationBase.of(context).hmg,
subText: TranslationBase.of(context).wallet,
type: 8,
width: 60.0,
height: 55.0,
projectViewModel: projectViewModel,
model: model,
),
);
return medical;
}
navigateToToDoPage(BuildContext context) { navigateToToDoPage(BuildContext context) {
if (projectViewModel.isLogin) { if (projectViewModel.isLogin) {
if (model.count != 0) { if (model.count != 0) {
Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true))); Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true)));
} else { } else {
AppToast.showErrorToast( AppToast.showErrorToast(message: TranslationBase.of(context).upcomingEmpty);
message: TranslationBase.of(context).upcomingEmpty);
} }
} else { } else {
Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true))); Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true)));

@ -33,17 +33,21 @@ class LocationUtils {
} else { } else {
Geolocator.isLocationServiceEnabled().then((value) { Geolocator.isLocationServiceEnabled().then((value) {
if (value) { if (value) {
Geolocator.checkPermission().then((permission) { Geolocator.checkPermission().then((permission) async {
if (permission == LocationPermission.always || permission == LocationPermission.whileInUse) { if (permission == LocationPermission.always || permission == LocationPermission.whileInUse) {
Geolocator.getLastKnownPosition().then((value) { Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.medium, timeLimit: Duration(seconds: 10)).then((value) {
setLocation(value); setLocation(value);
if (callBack != null) callBack(LatLng(value.latitude, value.longitude)); if (callBack != null) callBack(LatLng(value.latitude, value.longitude));
}); });
} }
if (permission == LocationPermission.denied || permission == LocationPermission.deniedForever) { if (permission == LocationPermission.denied || permission == LocationPermission.deniedForever) {
setZeroLocation(); if(await Permission.location.request().isGranted) {
if (isShowConfirmDialog) showErrorLocationDialog(false); getCurrentLocation();
} else {
setZeroLocation();
if (isShowConfirmDialog) showErrorLocationDialog(false);
}
} }
}).catchError((err) { }).catchError((err) {
print(err); print(err);

@ -2244,6 +2244,8 @@ class TranslationBase {
String get seeDoctorsList => localizedValues["seeDoctorsList"][locale.languageCode]; String get seeDoctorsList => localizedValues["seeDoctorsList"][locale.languageCode];
String get covidQuestionnaire => localizedValues["covidQuestionnaire"][locale.languageCode];
} }

Loading…
Cancel
Save