diff --git a/lib/config/config.dart b/lib/config/config.dart index d7ffabcd..7840b97d 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -12,8 +12,8 @@ const PACKAGES_PRODUCTS = '/api/products'; const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; -// const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index f4ba71ab..8e61e3f3 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -6,6 +6,8 @@ import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_special_result.dart'; import 'package:diplomaticquarterapp/core/service/medical/labs_service.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; import '../../../locator.dart'; import '../base_view_model.dart'; @@ -15,6 +17,7 @@ class LabsViewModel extends BaseViewModel { LabsService _labsService = locator(); List get labOrdersResultsList => _labsService.labOrdersResultsList; + List timeSeries = []; List _patientLabOrdersListClinic = List(); List _patientLabOrdersListHospital = List(); @@ -121,6 +124,12 @@ class LabsViewModel extends BaseViewModel { // if (isShouldClear) // // _labsService.labOrdersResultsList.clear(); + + _labsService.labOrdersResultsList.forEach((element) { + try { + timeSeries.add(new TimeSeriesSales2(DateUtil.convertStringToDate(element.verifiedOnDateTime), double.parse(element.resultValue))); + } catch (e) {} + }); setState(ViewState.Idle); } } diff --git a/lib/pages/BookAppointment/Search.dart b/lib/pages/BookAppointment/Search.dart index 20efe489..3c89b2f5 100644 --- a/lib/pages/BookAppointment/Search.dart +++ b/lib/pages/BookAppointment/Search.dart @@ -12,8 +12,9 @@ import 'components/SearchByClinic.dart'; class Search extends StatefulWidget { final int type; final List clnicIds; + Function onBackClick; - Search({this.type = 0, this.clnicIds}); + Search({this.type = 0, this.clnicIds,this.onBackClick}); @override _SearchState createState() => _SearchState(); @@ -36,8 +37,11 @@ class _SearchState extends State with TickerProviderStateMixin { return AppScaffold( isShowAppBar: false, isShowDecPage: false, + showNewAppBarTitle: true, + showNewAppBar: true, appBarTitle: TranslationBase.of(context).bookAppo, backgroundColor: Color(0xFFF7F7F7), + onTap: widget.onBackClick, body: Column( children: [ TabBar( diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index 9cd4e8a0..f00243a7 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -38,8 +38,9 @@ import 'package:provider/provider.dart'; class MyFamily extends StatefulWidget { final bool isAppbarVisible; + Function onBackClick; - MyFamily({this.isAppbarVisible = true}); + MyFamily({this.isAppbarVisible = true,this.onBackClick}); @override _MyFamily createState() => _MyFamily(); @@ -98,6 +99,7 @@ class _MyFamily extends State with TickerProviderStateMixin { imagesInfo: imagesInfo, showNewAppBar: true, showNewAppBarTitle: true, + onTap: widget.isAppbarVisible == false ? widget.onBackClick : null, icon: "assets/images/new/bottom_nav/family_files.svg", description: TranslationBase.of(context).familyInfo, body: Column( diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index b7a257aa..a143fa15 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -13,6 +13,7 @@ import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/widgets/paymentDialog.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -37,8 +38,9 @@ class ToDo extends StatefulWidget { MyInAppBrowser browser; bool isShowAppBar = true; + Function onBackClick; - ToDo({@required this.isShowAppBar}); + ToDo({@required this.isShowAppBar,this.onBackClick}); @override _ToDoState createState() => _ToDoState(); @@ -77,8 +79,12 @@ class _ToDoState extends State { imagesInfo: imagesInfo, isShowAppBar: widget.isShowAppBar, isShowDecPage: true, + showNewAppBar: true, + showNewAppBarTitle: true, icon: "assets/images/new/bottom_nav/todo.svg", description: TranslationBase.of(context).infoTodo, + onTap:widget.onBackClick, + backgroundColor: CustomColors.appBackgroudGrey2Color, body: SingleChildScrollView( child: Column( children: [ diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index e5f8e35c..f96cf7f4 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -281,120 +281,103 @@ class _LandingPageState extends State with WidgetsBindingObserver { // // //_firebase Background message handler _firebaseMessaging.configure( - onMessage: (Map message) async { - // showDialog("onMessage: $message"); - print("onMessage: $message"); - print(message); - print(message['name']); - print(message['appointmentdate']); - - if (Platform.isIOS) { - if (message['is_call'] == "true") { - var route = ModalRoute.of(context); - - if (route != null) { - print(route.settings.name); - } + onMessage: (Map message) async { + // showDialog("onMessage: $message"); + print("onMessage: $message"); + print(message); + print(message['name']); + print(message['appointmentdate']); + + if (Platform.isIOS) { + if (message['is_call'] == "true") { + var route = ModalRoute.of(context); + + if (route != null) { + print(route.settings.name); + } - Map myMap = new Map.from(message); - print(myMap); - LandingPage.isOpenCallPage = true; - LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); - if (!isPageNavigated) { - isPageNavigated = true; - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => IncomingCall( - incomingCallData: LandingPage.incomingCallData))) - .then((value) { - isPageNavigated = false; - }); - } - } else { - print("Is Call Not Found iOS"); - } - } else { - print("Is Call Not Found iOS"); + Map myMap = new Map.from(message); + print(myMap); + LandingPage.isOpenCallPage = true; + LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); + if (!isPageNavigated) { + isPageNavigated = true; + Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))).then((value) { + isPageNavigated = false; + }); } + } else { + print("Is Call Not Found iOS"); + } + } else { + print("Is Call Not Found iOS"); + } - if (Platform.isAndroid) { - if (message['data'].containsKey("is_call")) { - var route = ModalRoute.of(context); + if (Platform.isAndroid) { + if (message['data'].containsKey("is_call")) { + var route = ModalRoute.of(context); - if (route != null) { - print(route.settings.name); - } + if (route != null) { + print(route.settings.name); + } - Map myMap = - new Map.from(message['data']); - print(myMap); - LandingPage.isOpenCallPage = true; - LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); - if (!isPageNavigated) { - isPageNavigated = true; - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => IncomingCall( - incomingCallData: LandingPage.incomingCallData))) - .then((value) { - isPageNavigated = false; - }); - } - } else { - print("Is Call Not Found Android"); - LocalNotification.getInstance().showNow(title: message['notification']['title'], subtitle: message['notification']['body']); - } - } else { - print("Is Call Not Found Android"); + Map myMap = new Map.from(message['data']); + print(myMap); + LandingPage.isOpenCallPage = true; + LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); + if (!isPageNavigated) { + isPageNavigated = true; + Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))).then((value) { + isPageNavigated = false; + }); + } + } else { + print("Is Call Not Found Android"); + LocalNotification.getInstance().showNow(title: message['notification']['title'], subtitle: message['notification']['body']); + } + } else { + print("Is Call Not Found Android"); + } + }, + onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler, + onLaunch: (Map message) async { + print("onLaunch: $message"); + // showDialog("onLaunch: $message"); + }, + onResume: (Map message) async { + print("onResume: $message"); + print(message); + print(message['name']); + print(message['appointmentdate']); + + // showDialog("onResume: $message"); + + if (Platform.isIOS) { + if (message['is_call'] == "true") { + var route = ModalRoute.of(context); + + if (route != null) { + print(route.settings.name); } - }, - onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler, - onLaunch: (Map message) async { - print("onLaunch: $message"); - // showDialog("onLaunch: $message"); - }, - onResume: (Map message) async { - print("onResume: $message"); - print(message); - print(message['name']); - print(message['appointmentdate']); - - // showDialog("onResume: $message"); - - if (Platform.isIOS) { - if (message['is_call'] == "true") { - var route = ModalRoute.of(context); - - if (route != null) { - print(route.settings.name); - } - Map myMap = - new Map.from(message); - print(myMap); - LandingPage.isOpenCallPage = true; - LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); - if (!isPageNavigated) { - isPageNavigated = true; - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => IncomingCall( - incomingCallData: LandingPage.incomingCallData))) - .then((value) { - isPageNavigated = false; - }); - } - } else { - print("Is Call Not Found iOS"); - } - } else { - print("Is Call Not Found iOS"); + Map myMap = new Map.from(message); + print(myMap); + LandingPage.isOpenCallPage = true; + LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); + if (!isPageNavigated) { + isPageNavigated = true; + Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))).then((value) { + isPageNavigated = false; + }); } - }, - ); + } else { + print("Is Call Not Found iOS"); + } + } else { + print("Is Call Not Found iOS"); + } + }, + ); } showDialogs(String message) { @@ -627,10 +610,21 @@ class _LandingPageState extends State with WidgetsBindingObserver { changeCurrentTab(1); }, ), - MedicalProfilePageNew(), - Search(), - MyFamily(isAppbarVisible: false), - ToDo(isShowAppBar: false), + MedicalProfilePageNew(onTap: (){ + changeCurrentTab(0); + },), + Search(onBackClick: (){ + changeCurrentTab(0); + },), + MyFamily( + isAppbarVisible: false, + onBackClick: () { + changeCurrentTab(0); + }, + ), + ToDo(isShowAppBar: true,onBackClick: (){ + changeCurrentTab(0); + },), ], // Please do not remove the BookingOptions from this array ), RobotIcon() @@ -645,7 +639,8 @@ class _LandingPageState extends State with WidgetsBindingObserver { elevation: true, onTap: () { changeCurrentTab(2); - }) + }, + ) : null); } diff --git a/lib/pages/medical/medical_profile_page_new.dart b/lib/pages/medical/medical_profile_page_new.dart index 97e1fe70..8f0bb0fc 100644 --- a/lib/pages/medical/medical_profile_page_new.dart +++ b/lib/pages/medical/medical_profile_page_new.dart @@ -1,4 +1,3 @@ - import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/medical_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; @@ -14,6 +13,9 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class MedicalProfilePageNew extends StatefulWidget { + Function onTap; + String a; + MedicalProfilePageNew({this.onTap}); @override _MedicalProfilePageState createState() => _MedicalProfilePageState(); } @@ -30,12 +32,15 @@ class _MedicalProfilePageState extends State { List myMedicalList = Utils.myMedicalList(projectViewModel: projectViewModel, context: context, count: appoCountProvider.count, isLogin: projectViewModel.isLogin); return BaseView( onModelReady: (model) => model.getAppointmentHistory(), - builder: (_, model, widget) => AppScaffold( + builder: (_, model, widget1) => AppScaffold( isShowDecPage: false, isShowAppBar: false, baseViewModel: model, - showNewAppBar: false, + showNewAppBar: true, isHelp: true, + showNewAppBarTitle: true, + appBarTitle: TranslationBase.of(context).medicalFile, + onTap:widget.onTap, body: Container( child: SingleChildScrollView( child: Column( diff --git a/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart b/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart index 1a29856f..b1991f9f 100644 --- a/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart +++ b/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart @@ -1,6 +1,8 @@ import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; +import 'package:diplomaticquarterapp/widgets/charts/show_chart.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -25,7 +27,7 @@ class FlowChartPage extends StatelessWidget { baseViewModel: model, showNewAppBar: true, showNewAppBarTitle: true, - backgroundColor: Color(0xffF8F8F8), + backgroundColor: CustomColors.appBackgroudGrey2Color, body: SingleChildScrollView( child: model.labOrdersResultsList.isNotEmpty ? Column( @@ -51,9 +53,14 @@ class FlowChartPage extends StatelessWidget { ), ], ), - child: LineChartCurved( + // child: LineChartCurved( + // title: filterName, + // labResult: model.labOrdersResultsList, + // ), + child: ShowChart( title: filterName, - labResult: model.labOrdersResultsList, + timeSeries: model.timeSeries, + indexes: model.timeSeries.length ~/ 5.5 ?? 0, ), ), LabResultChartAndDetails( diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index b0316542..5d4e3704 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -55,10 +55,12 @@ class AppScaffold extends StatelessWidget { final int dropdownIndexValue; List dropDownList; final Function(int) dropDownIndexChange; + Function onTap; AuthenticatedUserObject authenticatedUserObject = locator(); AppBarWidget appBar; + AppScaffold({ @required this.body, this.appBarTitle = '', @@ -90,6 +92,7 @@ class AppScaffold extends StatelessWidget { this.dropDownList, this.dropdownIndexValue, this.dropDownIndexChange, + this.onTap, }); AppScaffold setOnAppBarCartClick(VoidCallback onClick) { @@ -114,7 +117,9 @@ class AppScaffold extends StatelessWidget { dropdownIndexValue: dropdownIndexValue, dropDownList: dropDownList ?? [], dropDownIndexChange: dropDownIndexChange, - appBarIcons: appBarIcons) + appBarIcons: appBarIcons, + onTap: onTap, + ) : (isShowAppBar ? appBar = AppBarWidget( appBarTitle: appBarTitle, @@ -167,7 +172,10 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget { List dropDownList; final Function(int) dropDownIndexChange; final List appBarIcons; - NewAppBarWidget({Key key, this.showTitle = false, this.showDropDown = false, this.title = "", this.dropDownList, this.appBarIcons, this.dropdownIndexValue, this.dropDownIndexChange}) + Function onTap; + + NewAppBarWidget( + {Key key, this.showTitle = false, this.showDropDown = false, this.title = "", this.dropDownList, this.appBarIcons, this.dropdownIndexValue, this.dropDownIndexChange, this.onTap}) : super(key: key); @override @@ -180,7 +188,9 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget { automaticallyImplyLeading: false, title: Row( children: [ - ArrowBack(), + ArrowBack( + onTap: onTap, + ), if (showTitle) Expanded( child: Text( @@ -274,6 +284,7 @@ String _badgeText = "0"; class AppBarWidgetState extends State { String badgeText = "0"; + @override Widget build(BuildContext context) { widget.badgeUpdater = badgeUpdateBlock; @@ -435,10 +446,10 @@ class _RobotIcon extends State { bottom: -15); } - // setAnimation() async { - // /// await sharedPref.getBool(IS_ROBOT_VISIBLE) || - // // var animation = - // // IS_TEXT_COMPLETED == ? true : false; +// setAnimation() async { +// /// await sharedPref.getBool(IS_ROBOT_VISIBLE) || +// // var animation = +// // IS_TEXT_COMPLETED == ? true : false; - // } +// } } diff --git a/lib/widgets/others/arrow_back.dart b/lib/widgets/others/arrow_back.dart index ff45083c..ebdd4877 100644 --- a/lib/widgets/others/arrow_back.dart +++ b/lib/widgets/others/arrow_back.dart @@ -5,7 +5,7 @@ import 'package:provider/provider.dart'; class ArrowBack extends StatelessWidget { final Function onTap; - ArrowBack({Key key, this.onTap}) : super(key: key); + ArrowBack({Key key, this.onTap,}) : super(key: key); @override Widget build(BuildContext context) {