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 {
prescriptionsOrderList.clear();
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS, onSuccess: (dynamic response, int statusCode) {
prescriptionsOrderList.clear();
response['PatientER_GetPatientAllPresOrdersList'].forEach((prescriptionsOrder) {
prescriptionsOrderList.add(PrescriptionsOrder.fromJson(prescriptionsOrder));
});

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

@ -1,20 +1,15 @@
import 'dart:ui';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_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/month_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/today_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/medical/medical_profile_page_new.dart';
import 'package:diplomaticquarterapp/routes.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/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
@ -77,132 +72,37 @@ class _H2OPageState extends State<H2OPage> with SingleTickerProviderStateMixin {
},
),
],
body: Scaffold(
// extendBodyBehindAppBar: true,
// appBar: PreferredSize(
// preferredSize: Size.fromHeight(65.0),
// child: Stack(
// children: <Widget>[
// Positioned(
// bottom: 1,
// left: 0,
// right: 0,
// child: BackdropFilter(
// filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
// child: Container(
// color: Theme.of(context).scaffoldBackgroundColor.withOpacity(0.8),
// height: 70.0,
// ),
// ),
// ),
// Center(
// child: Container(
// height: 60.0,
// alignment: Alignment.center,
// // margin: EdgeInsets.only(top: 10.0),
// // width: MediaQuery.of(context).size.width * 0.9,
//
// child: TabBar(
// 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(
body: Column(
children: <Widget>[
TabBar(
controller: _tabController,
indicatorWeight: 3.0,
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,
indicatorWeight: 3.0,
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)],
children: <Widget>[TodayPage(), WeekPage(), MonthPage()],
),
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