Back Button on Landing Page

merge-requests/431/merge
Mirza.Shafique 4 years ago
parent 3a07d39bff
commit d48a4ff4e3

@ -12,8 +12,8 @@ const PACKAGES_PRODUCTS = '/api/products';
const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_CUSTOMER = '/api/customers';
const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders'; const PACKAGES_ORDERS = '/api/orders';
const BASE_URL = 'https://uat.hmgwebservices.com/'; // const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/'; const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
// const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';

@ -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/model/labs/patient_lab_special_result.dart';
import 'package:diplomaticquarterapp/core/service/medical/labs_service.dart'; import 'package:diplomaticquarterapp/core/service/medical/labs_service.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/widgets/charts/app_time_series_chart.dart';
import '../../../locator.dart'; import '../../../locator.dart';
import '../base_view_model.dart'; import '../base_view_model.dart';
@ -15,6 +17,7 @@ class LabsViewModel extends BaseViewModel {
LabsService _labsService = locator<LabsService>(); LabsService _labsService = locator<LabsService>();
List<LabOrderResult> get labOrdersResultsList => _labsService.labOrdersResultsList; List<LabOrderResult> get labOrdersResultsList => _labsService.labOrdersResultsList;
List<TimeSeriesSales2> timeSeries = [];
List<PatientLabOrdersList> _patientLabOrdersListClinic = List(); List<PatientLabOrdersList> _patientLabOrdersListClinic = List();
List<PatientLabOrdersList> _patientLabOrdersListHospital = List(); List<PatientLabOrdersList> _patientLabOrdersListHospital = List();
@ -121,6 +124,12 @@ class LabsViewModel extends BaseViewModel {
// if (isShouldClear) // if (isShouldClear)
// //
// _labsService.labOrdersResultsList.clear(); // _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); setState(ViewState.Idle);
} }
} }

@ -12,8 +12,9 @@ import 'components/SearchByClinic.dart';
class Search extends StatefulWidget { class Search extends StatefulWidget {
final int type; final int type;
final List clnicIds; final List clnicIds;
Function onBackClick;
Search({this.type = 0, this.clnicIds}); Search({this.type = 0, this.clnicIds,this.onBackClick});
@override @override
_SearchState createState() => _SearchState(); _SearchState createState() => _SearchState();
@ -36,8 +37,11 @@ class _SearchState extends State<Search> with TickerProviderStateMixin {
return AppScaffold( return AppScaffold(
isShowAppBar: false, isShowAppBar: false,
isShowDecPage: false, isShowDecPage: false,
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).bookAppo, appBarTitle: TranslationBase.of(context).bookAppo,
backgroundColor: Color(0xFFF7F7F7), backgroundColor: Color(0xFFF7F7F7),
onTap: widget.onBackClick,
body: Column( body: Column(
children: [ children: [
TabBar( TabBar(

@ -38,8 +38,9 @@ import 'package:provider/provider.dart';
class MyFamily extends StatefulWidget { class MyFamily extends StatefulWidget {
final bool isAppbarVisible; final bool isAppbarVisible;
Function onBackClick;
MyFamily({this.isAppbarVisible = true}); MyFamily({this.isAppbarVisible = true,this.onBackClick});
@override @override
_MyFamily createState() => _MyFamily(); _MyFamily createState() => _MyFamily();
@ -98,6 +99,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
onTap: widget.isAppbarVisible == false ? widget.onBackClick : null,
icon: "assets/images/new/bottom_nav/family_files.svg", icon: "assets/images/new/bottom_nav/family_files.svg",
description: TranslationBase.of(context).familyInfo, description: TranslationBase.of(context).familyInfo,
body: Column( body: Column(

@ -13,6 +13,7 @@ import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/widgets/paymentDialog.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/widgets/paymentDialog.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.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_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';
@ -37,8 +38,9 @@ class ToDo extends StatefulWidget {
MyInAppBrowser browser; MyInAppBrowser browser;
bool isShowAppBar = true; bool isShowAppBar = true;
Function onBackClick;
ToDo({@required this.isShowAppBar}); ToDo({@required this.isShowAppBar,this.onBackClick});
@override @override
_ToDoState createState() => _ToDoState(); _ToDoState createState() => _ToDoState();
@ -77,8 +79,12 @@ class _ToDoState extends State<ToDo> {
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
isShowAppBar: widget.isShowAppBar, isShowAppBar: widget.isShowAppBar,
isShowDecPage: true, isShowDecPage: true,
showNewAppBar: true,
showNewAppBarTitle: true,
icon: "assets/images/new/bottom_nav/todo.svg", icon: "assets/images/new/bottom_nav/todo.svg",
description: TranslationBase.of(context).infoTodo, description: TranslationBase.of(context).infoTodo,
onTap:widget.onBackClick,
backgroundColor: CustomColors.appBackgroudGrey2Color,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column( child: Column(
children: <Widget>[ children: <Widget>[

@ -281,120 +281,103 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
// //
// //_firebase Background message handler // //_firebase Background message handler
_firebaseMessaging.configure( _firebaseMessaging.configure(
onMessage: (Map<String, dynamic> message) async { onMessage: (Map<String, dynamic> message) async {
// showDialog("onMessage: $message"); // showDialog("onMessage: $message");
print("onMessage: $message"); print("onMessage: $message");
print(message); print(message);
print(message['name']); print(message['name']);
print(message['appointmentdate']); print(message['appointmentdate']);
if (Platform.isIOS) { if (Platform.isIOS) {
if (message['is_call'] == "true") { if (message['is_call'] == "true") {
var route = ModalRoute.of(context); var route = ModalRoute.of(context);
if (route != null) { if (route != null) {
print(route.settings.name); print(route.settings.name);
} }
Map<String, dynamic> myMap = new Map<String, dynamic>.from(message); Map<String, dynamic> myMap = new Map<String, dynamic>.from(message);
print(myMap); print(myMap);
LandingPage.isOpenCallPage = true; LandingPage.isOpenCallPage = true;
LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
if (!isPageNavigated) { if (!isPageNavigated) {
isPageNavigated = true; isPageNavigated = true;
Navigator.push( Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))).then((value) {
context, isPageNavigated = false;
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");
} }
} else {
print("Is Call Not Found iOS");
}
} else {
print("Is Call Not Found iOS");
}
if (Platform.isAndroid) { if (Platform.isAndroid) {
if (message['data'].containsKey("is_call")) { if (message['data'].containsKey("is_call")) {
var route = ModalRoute.of(context); var route = ModalRoute.of(context);
if (route != null) { if (route != null) {
print(route.settings.name); print(route.settings.name);
} }
Map<String, dynamic> myMap = Map<String, dynamic> myMap = new Map<String, dynamic>.from(message['data']);
new Map<String, dynamic>.from(message['data']); print(myMap);
print(myMap); LandingPage.isOpenCallPage = true;
LandingPage.isOpenCallPage = true; LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); if (!isPageNavigated) {
if (!isPageNavigated) { isPageNavigated = true;
isPageNavigated = true; Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))).then((value) {
Navigator.push( isPageNavigated = false;
context, });
MaterialPageRoute( }
builder: (context) => IncomingCall( } else {
incomingCallData: LandingPage.incomingCallData))) print("Is Call Not Found Android");
.then((value) { LocalNotification.getInstance().showNow(title: message['notification']['title'], subtitle: message['notification']['body']);
isPageNavigated = false; }
}); } else {
} print("Is Call Not Found Android");
} else { }
print("Is Call Not Found Android"); },
LocalNotification.getInstance().showNow(title: message['notification']['title'], subtitle: message['notification']['body']); onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler,
} onLaunch: (Map<String, dynamic> message) async {
} else { print("onLaunch: $message");
print("Is Call Not Found Android"); // showDialog("onLaunch: $message");
},
onResume: (Map<String, dynamic> 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<String, dynamic> message) async {
print("onLaunch: $message");
// showDialog("onLaunch: $message");
},
onResume: (Map<String, dynamic> 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<String, dynamic> myMap = Map<String, dynamic> myMap = new Map<String, dynamic>.from(message);
new Map<String, dynamic>.from(message); print(myMap);
print(myMap); LandingPage.isOpenCallPage = true;
LandingPage.isOpenCallPage = true; LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); if (!isPageNavigated) {
if (!isPageNavigated) { isPageNavigated = true;
isPageNavigated = true; Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))).then((value) {
Navigator.push( isPageNavigated = false;
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");
} }
}, } else {
); print("Is Call Not Found iOS");
}
} else {
print("Is Call Not Found iOS");
}
},
);
} }
showDialogs(String message) { showDialogs(String message) {
@ -627,10 +610,21 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
changeCurrentTab(1); changeCurrentTab(1);
}, },
), ),
MedicalProfilePageNew(), MedicalProfilePageNew(onTap: (){
Search(), changeCurrentTab(0);
MyFamily(isAppbarVisible: false), },),
ToDo(isShowAppBar: false), 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 ], // Please do not remove the BookingOptions from this array
), ),
RobotIcon() RobotIcon()
@ -645,7 +639,8 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
elevation: true, elevation: true,
onTap: () { onTap: () {
changeCurrentTab(2); changeCurrentTab(2);
}) },
)
: null); : null);
} }

@ -1,4 +1,3 @@
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/medical_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/medical_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_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'; import 'package:provider/provider.dart';
class MedicalProfilePageNew extends StatefulWidget { class MedicalProfilePageNew extends StatefulWidget {
Function onTap;
String a;
MedicalProfilePageNew({this.onTap});
@override @override
_MedicalProfilePageState createState() => _MedicalProfilePageState(); _MedicalProfilePageState createState() => _MedicalProfilePageState();
} }
@ -30,12 +32,15 @@ class _MedicalProfilePageState extends State<MedicalProfilePageNew> {
List<Widget> myMedicalList = Utils.myMedicalList(projectViewModel: projectViewModel, context: context, count: appoCountProvider.count, isLogin: projectViewModel.isLogin); List<Widget> myMedicalList = Utils.myMedicalList(projectViewModel: projectViewModel, context: context, count: appoCountProvider.count, isLogin: projectViewModel.isLogin);
return BaseView<MedicalViewModel>( return BaseView<MedicalViewModel>(
onModelReady: (model) => model.getAppointmentHistory(), onModelReady: (model) => model.getAppointmentHistory(),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget1) => AppScaffold(
isShowDecPage: false, isShowDecPage: false,
isShowAppBar: false, isShowAppBar: false,
baseViewModel: model, baseViewModel: model,
showNewAppBar: false, showNewAppBar: true,
isHelp: true, isHelp: true,
showNewAppBarTitle: true,
appBarTitle: TranslationBase.of(context).medicalFile,
onTap:widget.onTap,
body: Container( body: Container(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.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/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -25,7 +27,7 @@ class FlowChartPage extends StatelessWidget {
baseViewModel: model, baseViewModel: model,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
backgroundColor: Color(0xffF8F8F8), backgroundColor: CustomColors.appBackgroudGrey2Color,
body: SingleChildScrollView( body: SingleChildScrollView(
child: model.labOrdersResultsList.isNotEmpty child: model.labOrdersResultsList.isNotEmpty
? Column( ? Column(
@ -51,9 +53,14 @@ class FlowChartPage extends StatelessWidget {
), ),
], ],
), ),
child: LineChartCurved( // child: LineChartCurved(
// title: filterName,
// labResult: model.labOrdersResultsList,
// ),
child: ShowChart(
title: filterName, title: filterName,
labResult: model.labOrdersResultsList, timeSeries: model.timeSeries,
indexes: model.timeSeries.length ~/ 5.5 ?? 0,
), ),
), ),
LabResultChartAndDetails( LabResultChartAndDetails(

@ -55,10 +55,12 @@ class AppScaffold extends StatelessWidget {
final int dropdownIndexValue; final int dropdownIndexValue;
List<String> dropDownList; List<String> dropDownList;
final Function(int) dropDownIndexChange; final Function(int) dropDownIndexChange;
Function onTap;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
AppBarWidget appBar; AppBarWidget appBar;
AppScaffold({ AppScaffold({
@required this.body, @required this.body,
this.appBarTitle = '', this.appBarTitle = '',
@ -90,6 +92,7 @@ class AppScaffold extends StatelessWidget {
this.dropDownList, this.dropDownList,
this.dropdownIndexValue, this.dropdownIndexValue,
this.dropDownIndexChange, this.dropDownIndexChange,
this.onTap,
}); });
AppScaffold setOnAppBarCartClick(VoidCallback onClick) { AppScaffold setOnAppBarCartClick(VoidCallback onClick) {
@ -114,7 +117,9 @@ class AppScaffold extends StatelessWidget {
dropdownIndexValue: dropdownIndexValue, dropdownIndexValue: dropdownIndexValue,
dropDownList: dropDownList ?? [], dropDownList: dropDownList ?? [],
dropDownIndexChange: dropDownIndexChange, dropDownIndexChange: dropDownIndexChange,
appBarIcons: appBarIcons) appBarIcons: appBarIcons,
onTap: onTap,
)
: (isShowAppBar : (isShowAppBar
? appBar = AppBarWidget( ? appBar = AppBarWidget(
appBarTitle: appBarTitle, appBarTitle: appBarTitle,
@ -167,7 +172,10 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget {
List<String> dropDownList; List<String> dropDownList;
final Function(int) dropDownIndexChange; final Function(int) dropDownIndexChange;
final List<Widget> appBarIcons; final List<Widget> 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); : super(key: key);
@override @override
@ -180,7 +188,9 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget {
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
title: Row( title: Row(
children: [ children: [
ArrowBack(), ArrowBack(
onTap: onTap,
),
if (showTitle) if (showTitle)
Expanded( Expanded(
child: Text( child: Text(
@ -274,6 +284,7 @@ String _badgeText = "0";
class AppBarWidgetState extends State<AppBarWidget> { class AppBarWidgetState extends State<AppBarWidget> {
String badgeText = "0"; String badgeText = "0";
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
widget.badgeUpdater = badgeUpdateBlock; widget.badgeUpdater = badgeUpdateBlock;
@ -435,10 +446,10 @@ class _RobotIcon extends State<RobotIcon> {
bottom: -15); bottom: -15);
} }
// setAnimation() async { // setAnimation() async {
// /// await sharedPref.getBool(IS_ROBOT_VISIBLE) || // /// await sharedPref.getBool(IS_ROBOT_VISIBLE) ||
// // var animation = // // var animation =
// // IS_TEXT_COMPLETED == ? true : false; // // IS_TEXT_COMPLETED == ? true : false;
// } // }
} }

@ -5,7 +5,7 @@ import 'package:provider/provider.dart';
class ArrowBack extends StatelessWidget { class ArrowBack extends StatelessWidget {
final Function onTap; final Function onTap;
ArrowBack({Key key, this.onTap}) : super(key: key); ArrowBack({Key key, this.onTap,}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

Loading…
Cancel
Save