merge-update-with-lab-changes
haroon amjad 4 years ago
parent 3f3ddd7af0
commit 0a9d0e5eaa

@ -34,10 +34,10 @@ class PrescriptionsService extends BaseService {
} }
Future getPrescriptionsOrders() async { Future getPrescriptionsOrders() async {
prescriptionsOrderList.clear();
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
await baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS, onSuccess: (dynamic response, int statusCode) {
prescriptionsOrderList.clear();
response['PatientER_GetPatientAllPresOrdersList'].forEach((prescriptionsOrder) { response['PatientER_GetPatientAllPresOrdersList'].forEach((prescriptionsOrder) {
prescriptionsOrderList.add(PrescriptionsOrder.fromJson(prescriptionsOrder)); prescriptionsOrderList.add(PrescriptionsOrder.fromJson(prescriptionsOrder));
}); });

@ -77,14 +77,17 @@ class PrescriptionsViewModel extends BaseViewModel {
} }
getPrescriptionsOrders({bool showLoading = false}) async { getPrescriptionsOrders({bool showLoading = false}) async {
if (showLoading) setState(ViewState.Busy); // print(showLoading);
await _prescriptionsService.getPrescriptionsOrders(); setState(ViewState.Busy);
if (_prescriptionsService.hasError) { Future.delayed(new Duration(milliseconds: 300)).then((value) async {
error = _prescriptionsService.error; await _prescriptionsService.getPrescriptionsOrders();
setState(ViewState.ErrorLocal); if (_prescriptionsService.hasError) {
} else { error = _prescriptionsService.error;
setState(ViewState.Idle); setState(ViewState.ErrorLocal);
} } else {
setState(ViewState.Idle);
}
});
} }
setFilterType(FilterType filterType) { setFilterType(FilterType filterType) {

@ -1,20 +1,15 @@
import 'dart:ui'; import 'dart:ui';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/month_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/month_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/today_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/today_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/week_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/week_page.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/medical_profile_page_new.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.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';
@ -77,132 +72,37 @@ class _H2OPageState extends State<H2OPage> with SingleTickerProviderStateMixin {
}, },
), ),
], ],
body: Scaffold( body: Column(
// extendBodyBehindAppBar: true, children: <Widget>[
// appBar: PreferredSize( TabBar(
// preferredSize: Size.fromHeight(65.0), controller: _tabController,
// child: Stack( indicatorWeight: 3.0,
// children: <Widget>[ indicatorSize: TabBarIndicatorSize.tab,
// Positioned( labelColor: Color(0xff2B353E),
// bottom: 1, unselectedLabelColor: Color(0xff575757),
// left: 0, labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
// right: 0, labelStyle: TextStyle(
// child: BackdropFilter( fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
// filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), fontSize: 16,
// child: Container( fontWeight: FontWeight.w600,
// color: Theme.of(context).scaffoldBackgroundColor.withOpacity(0.8), letterSpacing: -0.48,
// height: 70.0, ),
// ), unselectedLabelStyle: TextStyle(
// ), fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
// ), fontSize: 16,
// Center( fontWeight: FontWeight.w600,
// child: Container( letterSpacing: -0.48,
// height: 60.0, ),
// alignment: Alignment.center, tabs: [Text(TranslationBase.of(context).today), Text(TranslationBase.of(context).week), Text(TranslationBase.of(context).month.toLowerCase().capitalizeFirstofEach)],
// // margin: EdgeInsets.only(top: 10.0), ),
// // width: MediaQuery.of(context).size.width * 0.9, Expanded(
// child: TabBarView(
// child: TabBar( physics: BouncingScrollPhysics(),
// isScrollable: false,
// controller: _tabController,
// indicatorWeight: 5.0,
// indicatorSize: TabBarIndicatorSize.tab,
// indicatorColor: Colors.red[800],
// labelColor: Theme.of(context).primaryColor,
// labelPadding: EdgeInsets.only(top: 4.0, left: 10.0, right: 13.0),
// unselectedLabelColor: Colors.grey[800],
// tabs: [
// Container(
// width: MediaQuery.of(context).size.width * 0.28,
// child: Center(
// child: Texts(TranslationBase.of(context).today),
// ),
// ),
// Container(
// width: MediaQuery.of(context).size.width * 0.28,
// child: Center(
// child: Texts(TranslationBase.of(context).week),
// ),
// ),
// Container(
// width: MediaQuery.of(context).size.width * 0.28,
// child: Center(
// child: Texts(TranslationBase.of(context).month),
// ),
// ),
// ],
// ),
// ),
// ),
// ],
// ),
// ),
// backgroundColor: Colors.white,
body: Column(
children: <Widget>[
TabBar(
controller: _tabController, controller: _tabController,
indicatorWeight: 3.0, children: <Widget>[TodayPage(), WeekPage(), MonthPage()],
indicatorSize: TabBarIndicatorSize.tab,
labelColor: Color(0xff2B353E),
unselectedLabelColor: Color(0xff575757),
labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
labelStyle: TextStyle(
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
unselectedLabelStyle: TextStyle(
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
tabs: [Text(TranslationBase.of(context).today), Text(TranslationBase.of(context).week), Text(TranslationBase.of(context).month.toLowerCase().capitalizeFirstofEach)],
), ),
Expanded( )
child: TabBarView( ],
physics: BouncingScrollPhysics(),
controller: _tabController,
children: <Widget>[TodayPage(), WeekPage(), MonthPage()],
),
)
],
),
bottomNavigationBar: BottomNavBar(
changeIndex: (index) {
if (index == 0) {
IS_VOICE_COMMAND_CLOSED = false;
} else if (index == 1) {
Navigator.push(
context,
FadePage(
page: AppScaffold(
appBarTitle: TranslationBase.of(context).medicalProfile,
isShowAppBar: true,
showHomeAppBarIcon: false,
appBarIcons: [
IconButton(
icon: Image.asset("assets/images/new-design/setting_gear_icon.png"),
color: Colors.white,
onPressed: () => Navigator.of(context).pushNamed(
SETTINGS,
),
),
],
body: MedicalProfilePageNew())));
} else if (index == 2) {
Navigator.of(context).pushNamedAndRemoveUntil(HOME, (Route<dynamic> route) => false);
} else if (index == 3) {
Navigator.of(context).pushNamed(MY_FAMILIY);
} else if (index == 4) {
Navigator.push(context, FadePage(page: ToDo(isShowAppBar: false)));
}
},
showHomeIcon: true,
index: 0,
),
), ),
), ),
); );

Loading…
Cancel
Save