Bug fixes

merge-requests/390/head
Sultan Khan 4 years ago
parent e3758cfbba
commit 73ff5c4707

@ -33,3 +33,4 @@ const H2O_UNIT = 'H2O_UNIT';
const H2O_REMINDER = 'H2O_REMINDER';
const LIVECARE_CLINIC_DATA = 'LIVECARE_CLINIC_DATA';
const DOCTOR_SCHEDULE_DATE_SEL = 'DOCTOR_SCHEDULE_DATE_SEL';
const APPOINTMENT_HISTORY_MEDICAL = 'APPOINTMENT_HISTORY_MEDICAL';

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:flutter/cupertino.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/DoctorScheduleResponse.dart';
@ -18,16 +19,24 @@ class MedicalService extends BaseService {
body['IsActiveAppointment'] = true;
body['isDentalAllowedBackend'] = false;
}
await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, onSuccess: (response, statusCode) async {
var appoHistory = await sharedPref.getObject(APPOINTMENT_HISTORY_MEDICAL);
if (appoHistory != null) {
appoitmentAllHistoryResultList.clear();
response['AppoimentAllHistoryResultList'].forEach((appoitment) {
appoHistory.forEach((appoitment) {
appoitmentAllHistoryResultList.add(AppoitmentAllHistoryResultList.fromJson(appoitment));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
} else {
await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, onSuccess: (response, statusCode) async {
appoitmentAllHistoryResultList.clear();
response['AppoimentAllHistoryResultList'].forEach((appoitment) {
appoitmentAllHistoryResultList.add(AppoitmentAllHistoryResultList.fromJson(appoitment));
});
sharedPref.setObject(APPOINTMENT_HISTORY_MEDICAL, response['AppoimentAllHistoryResultList']);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
}
addAmbulanceRequest({@required PatientER patientER}) async {

@ -157,21 +157,28 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
return;
}
}
setState(() {
if (currentTab > 0 && tab == 2)
pageController.jumpToPage(0);
else if (tab != 0) {
if (tab == 4 && model.count == 0) {
AppToast.showErrorToast(message: TranslationBase.of(context).noBookedAppo);
if (tab == 5) {
IS_VOICE_COMMAND_CLOSED = false;
triggerRobot();
// pageController.jumpToPage(tab);
} else {
if (currentTab > 0 && tab == 2)
pageController.jumpToPage(0);
else if (tab != 0) {
if (tab == 4 && model.count == 0) {
AppToast.showErrorToast(message: TranslationBase.of(context).noBookedAppo);
} else {
pageController.jumpToPage(tab);
}
} else {
pageController.jumpToPage(tab);
}
} else {
IS_VOICE_COMMAND_CLOSED = false;
pageController.jumpToPage(tab);
currentTab = tab;
}
currentTab = tab;
});
}
@ -631,7 +638,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
}
triggerRobot() {
event.setValue({"isRobot": 'true'});
event.setValue({"isRobotVisible": 'true'});
}
getText(currentTab) {

@ -37,7 +37,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
builder: (_, model, widget) => AppScaffold(
isShowDecPage: false,
baseViewModel: model,
isHelp: true,
isHelp: false,
body: Container(
child: SingleChildScrollView(
child: Column(

@ -22,9 +22,7 @@ class BottomNavBar extends StatefulWidget {
final ValueChanged<int> changeIndex;
final int index;
final bool showHomeIcon;
BottomNavBar(
{Key key, this.changeIndex, this.index, this.showHomeIcon = false})
: super(key: key);
BottomNavBar({Key key, this.changeIndex, this.index, this.showHomeIcon = false}) : super(key: key);
@override
_BottomNavBarState createState() => _BottomNavBarState();
@ -36,7 +34,7 @@ class _BottomNavBarState extends State<BottomNavBar> {
var event = RobotProvider();
_changeIndex(int index) async {
widget.changeIndex(index);
if (index == 0) {
if (index == 5) {
event.setValue({'isRobotVisible': 'true'});
}
}
@ -114,8 +112,7 @@ class _BottomNavBarState extends State<BottomNavBar> {
// currentIndex: 2,
// name: TranslationBase.of(context).bookAppo,
// ),
if (/*widget.index == 0 && */ projectViewModel
.havePrivilege(34))
if (/*widget.index == 0 && */ projectViewModel.havePrivilege(34))
BottomNavigationItem(
icon: EvaIcons.calendar,
activeIcon: EvaIcons.calendar,
@ -130,7 +127,7 @@ class _BottomNavBarState extends State<BottomNavBar> {
activeIcon: DQIcons.roboticon,
changeIndex: _changeIndex,
index: widget.index,
currentIndex: 0,
currentIndex: 5,
name: TranslationBase.of(context).help,
)
],

@ -13,7 +13,7 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/data_display/list/flexible_container.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart' as auth;
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart';
@ -34,7 +34,7 @@ class _TimeLineViewState extends State<TimeLineView> {
List<AppoitmentAllHistoryResultList> tempList = [];
List<DateObj> dateObjs = [];
DateObj selectedDateObj = null;
final authService = new auth.AuthProvider();
@override
void initState() {
super.initState();
@ -276,9 +276,29 @@ class _TimeLineViewState extends State<TimeLineView> {
}
login() async {
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
);
var data = await sharedPref.getObject(IMEI_USER_DATA);
sharedPref.remove(REGISTER_DATA_FOR_LOGIIN);
if (data != null) {
Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else {
GifLoaderDialogUtils.showMyDialog(context);
authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES value) {
GifLoaderDialogUtils.hideDialog(context);
if (value != null) {
sharedPref.setObject(IMEI_USER_DATA, value);
Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else {
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
);
});
}
}
}

@ -312,6 +312,7 @@ class _AppDrawerState extends State<AppDrawer> {
fontHeight: projectProvider.isArabic ? 1 : 0.8,
),
onTap: () {
sharedPref.remove(APPOINTMENT_HISTORY_MEDICAL);
sharedPref.setBool(IS_ROBOT_INIT, null);
if (projectProvider.isArabic) {
projectProvider.changeLanguage('en');

@ -279,6 +279,7 @@ class AppBarWidget extends StatefulWidget with PreferredSizeWidget {
}
String _badgeText = "0";
class AppBarWidgetState extends State<AppBarWidget> {
String badgeText = "0";
@override
@ -397,42 +398,42 @@ class _RobotIcon extends State<RobotIcon> {
return Positioned(
child: Column(
children: [
isAnimation
? Container(
height: 150,
width: 200,
padding: EdgeInsets.all(5),
margin: EdgeInsets.only(right: 35.0, bottom: 0),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.white,
boxShadow: [
BoxShadow(color: Colors.black, spreadRadius: 1),
],
),
child: TyperAnimatedTextKit(
text: Provider.of<ProjectViewModel>(context, listen: false).isArabic == true
? "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي."
: "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file.",
textLength: Provider.of<ProjectViewModel>(context, listen: false).isArabic == true
? "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي.".length
: "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file."
.length))
: Container(),
// isAnimation
// ? Container(
// height: 150,
// width: 200,
// padding: EdgeInsets.all(5),
// margin: EdgeInsets.only(right: 35.0, bottom: 0),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(10),
// color: Colors.white,
// boxShadow: [
// BoxShadow(color: Colors.black, spreadRadius: 1),
// ],
// ),
// child: TyperAnimatedTextKit(
// text: Provider.of<ProjectViewModel>(context, listen: false).isArabic == true
// ? "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي."
// : "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file.",
// textLength: Provider.of<ProjectViewModel>(context, listen: false).isArabic == true
// ? "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي.".length
// : "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file."
// .length))
// : Container(),
Stack(
children: [
isAnimation
? Positioned(
top: 0,
right: 40,
child: Container(
height: 0,
width: 0,
decoration: ShapeDecoration(
color: Colors.grey,
shape: MessageBorder(reverse: true),
)))
: Container(),
// isAnimation
// ? Positioned(
// top: 0,
// right: 40,
// child: Container(
// height: 0,
// width: 0,
// decoration: ShapeDecoration(
// color: Colors.grey,
// shape: MessageBorder(reverse: true),
// )))
// : Container(),
FloatingSearchButton()
],
)

@ -78,7 +78,7 @@ class FloatingSearchButton extends StatefulWidget {
class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProviderStateMixin {
Offset position = Offset(250, 400);
bool activeAnimation = false;
bool isShow = true;
bool isShow = false;
SearchProvider searchProvider = new SearchProvider();
RobotProvider eventProvider = RobotProvider();
bool isLoading = false;
@ -115,18 +115,16 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
offset = Tween<Offset>(begin: Offset(0.0, 1.0), end: Offset(0.0, 0.0)).animate(controller);
if (IS_VOICE_COMMAND_CLOSED == true) {
controller.reverse(from: -1);
}
if (mounted) {
//Future.delayed(const Duration(seconds: 2), () {
isArabic = Provider.of<ProjectViewModel>(context, listen: false).isArabic;
requestPermissions();
getUserData();
initialSpeak();
setState(() {
if (IS_TEXT_COMPLETED) {
isAnimationEnable = false;
}
});
} else {
if (mounted) {
//Future.delayed(const Duration(seconds: 2), () {
setState(() {
if (IS_TEXT_COMPLETED) {
isAnimationEnable = false;
}
});
}
}
event.controller.stream.listen((p) {
@ -190,7 +188,7 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
placeholder: (context, url) => Image.asset('assets/images/gif/robot-idle.gif'),
errorWidget: (context, url, error) => Icon(Icons.error),
)
: Image.asset(isAnimationEnable == true ? 'assets/images/gif/robot-speaking.gif' : 'assets/images/gif/robot-idle.gif'),
: Image.asset('assets/images/gif/robot-idle.gif'),
),
onTap: () {
new RoboSearch(context: context).showAlertDialog(context);
@ -273,7 +271,7 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
// });
}
void requestPermissions() async {
requestPermissions() async {
if (await Permission.microphone.isDenied || await Permission.microphone.isUndetermined) {
Map<Permission, PermissionStatus> statuses = await [
Permission.microphone,
@ -282,7 +280,6 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
}
Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener);
//if (hasSpeech) {
// _currentLocaleId =
// _currentLocaleId == 'en'
@ -290,6 +287,13 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
// : 'ar-SA'; // systemLocale.localeId;
// }
isArabic = Provider.of<ProjectViewModel>(context, listen: false).isArabic;
await requestPermissions();
getUserData();
await speech.initialize(onError: errorListener, onStatus: statusListener);
//initialSpeak();
if (!mounted) return;
// setState(() {

@ -1,9 +1,13 @@
import 'package:carousel_slider/carousel_slider.dart';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
import 'package:diplomaticquarterapp/pages/login/login-type.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart' as auth;
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -30,6 +34,7 @@ class NotAutPage extends StatefulWidget {
}
class _NotAutPageState extends State<NotAutPage> {
final authService = new auth.AuthProvider();
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
@ -64,7 +69,7 @@ class _NotAutPageState extends State<NotAutPage> {
style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 23 / 24),
),
Text(
widget.description??"",
widget.description ?? "",
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56, height: 21 / 14),
),
SizedBox(
@ -329,9 +334,23 @@ class _NotAutPageState extends State<NotAutPage> {
if (data != null) {
Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else {
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
);
GifLoaderDialogUtils.showMyDialog(context);
authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES value) {
GifLoaderDialogUtils.hideDialog(context);
if (value != null) {
sharedPref.setObject(IMEI_USER_DATA, value);
Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else {
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
);
});
}
}
}

Loading…
Cancel
Save