Merge branch 'diplomatic-quarter-live' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into hot_fixes

merge-requests/216/head
Mohammad Aljammal 4 years ago
commit 5c8e43c163

@ -154,7 +154,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
_firebaseMessaging.getToken().then((String token) async {
sharedPref.setString(PUSH_TOKEN, token);
if (token != null && await sharedPref.getObject(USER_PROFILE) == null) {
if (token != null && projectViewModel.isLogin == false) {
DEVICE_TOKEN = token;
checkUserStatus(token);
} else if (projectViewModel.isLogin) {

@ -99,6 +99,7 @@ class _Login extends State<Login> {
textDirection: TextDirection.ltr,
child: Container(
child: TextFields(
keyboardType: TextInputType.number,
fontWeight: FontWeight.normal,
controller: nationalIDorFile,
onChanged: (value) => {validateForm()},
@ -240,50 +241,49 @@ class _Login extends State<Login> {
request['PatientID'] = int.parse(nationalIDorFile.text);
}
// request.isRegister = false;
this.authService.checkActivationCode(request, code).then((result) async{
sharedPref.remove(FAMILY_FILE);
result = CheckActivationCode.fromJson(result);
result.list.isFamily = false;
// this.sharedPref.setString(BLOOD_TYPE, result['PatientBloodType']),
this.sharedPref.setObject(USER_PROFILE, result.list);
this.sharedPref.setObject(MAIN_USER, result.list);
this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID);
this.sharedPref.setString(TOKEN, result.authenticationTokenID);
await authenticatedUserObject.getUser(getUser: true);
authenticatedUserObject.isLogin = true;
appointmentRateViewModel.isLogin = true;
projectViewModel.isLogin = true;
projectViewModel.user = authenticatedUserObject.user;
appointmentRateViewModel
.getIsLastAppointmentRatedList()
.then((value) => {
getToDoCount(),
GifLoaderDialogUtils.hideDialog(context),
if (appointmentRateViewModel.isHaveAppointmentNotRate)
{
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: RateAppointmentDoctor(),
),
(r) => false)
}
else
{
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: LandingPage(),
),
(r) => false)
}
})
.catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
});
});
this.authService.checkActivationCode(request, code).then((result) async {
sharedPref.remove(FAMILY_FILE);
result = CheckActivationCode.fromJson(result);
result.list.isFamily = false;
// this.sharedPref.setString(BLOOD_TYPE, result['PatientBloodType']),
this.sharedPref.setObject(USER_PROFILE, result.list);
this.sharedPref.setObject(MAIN_USER, result.list);
this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID);
this.sharedPref.setString(TOKEN, result.authenticationTokenID);
await authenticatedUserObject.getUser(getUser: true);
authenticatedUserObject.isLogin = true;
appointmentRateViewModel.isLogin = true;
projectViewModel.isLogin = true;
projectViewModel.user = authenticatedUserObject.user;
appointmentRateViewModel
.getIsLastAppointmentRatedList()
.then((value) => {
getToDoCount(),
GifLoaderDialogUtils.hideDialog(context),
if (appointmentRateViewModel.isHaveAppointmentNotRate)
{
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: RateAppointmentDoctor(),
),
(r) => false)
}
else
{
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: LandingPage(),
),
(r) => false)
}
})
.catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
});
});
}
getToDoCount() {

@ -50,135 +50,136 @@ class _Register extends State<Register> {
isShowAppBar: true,
isShowDecPage: false,
body: SingleChildScrollView(
child: Container(
padding:
EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30),
height: SizeConfig.realScreenHeight * .9,
width: SizeConfig.realScreenWidth,
child: Column(children: <Widget>[
Expanded(
flex: 1,
child: AppText(
TranslationBase.of(context).enterNationalId,
fontSize: SizeConfig.textMultiplier * 3,
textAlign: TextAlign.left,
)),
Expanded(
flex: 4,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
MobileNo(
onNumberChange: (value) =>
{mobileNo = value, validateForm()},
onCountryChange: (value) => countryCode = value),
Directionality(
textDirection:TextDirection.ltr,child:Container(
child: TextFields(
controller: nationalIDorFile,
onChanged: (value) => validateForm(),
prefixIcon:
Icon(Icons.chrome_reader_mode, color: Color(0xFF40ACC9)),
padding: EdgeInsets.only(
top: 20, bottom: 20, left: 10, right: 10),
hintText: TranslationBase.of(context).nationalID,
))),
Row(
child: Container(
padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30),
height: SizeConfig.realScreenHeight * .9,
width: SizeConfig.realScreenWidth,
child: Column(children: <Widget>[
Expanded(
flex: 1,
child: AppText(
TranslationBase.of(context).enterNationalId,
fontSize: SizeConfig.textMultiplier * 3,
textAlign: TextAlign.left,
)),
Expanded(
flex: 4,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
MobileNo(
onNumberChange: (value) =>
{mobileNo = value, validateForm()},
onCountryChange: (value) => countryCode = value),
Directionality(
textDirection: TextDirection.ltr,
child: Container(
child: TextFields(
controller: nationalIDorFile,
onChanged: (value) => validateForm(),
keyboardType: TextInputType.number,
prefixIcon: Icon(Icons.chrome_reader_mode,
color: Color(0xFF40ACC9)),
padding: EdgeInsets.only(
top: 20, bottom: 20, left: 10, right: 10),
hintText: TranslationBase.of(context).nationalID,
))),
Row(
children: <Widget>[
Expanded(
child: Row(
children: <Widget>[
Expanded(
child: Row(
children: <Widget>[
Radio(
value: 1,
groupValue: isHijri,
onChanged: (value) {
setState(() {
isHijri = value;
});
validateForm();
},
),
Text(TranslationBase.of(context).hijriDate),
],
),
Radio(
value: 1,
groupValue: isHijri,
onChanged: (value) {
setState(() {
isHijri = value;
});
validateForm();
},
),
Expanded(
child: Row(
children: <Widget>[
Radio(
value: 0,
groupValue: isHijri,
onChanged: (value) {
setState(() {
isHijri = value;
});
validateForm();
},
),
Text(TranslationBase.of(context)
.gregorianDate),
],
),
Text(TranslationBase.of(context).hijriDate),
],
),
),
Expanded(
child: Row(
children: <Widget>[
Radio(
value: 0,
groupValue: isHijri,
onChanged: (value) {
setState(() {
isHijri = value;
});
validateForm();
},
),
Text(TranslationBase.of(context).gregorianDate),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Container(
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Container(
width: SizeConfig.realScreenWidth * .9,
height:60,
child: isHijri == 1
? TextFields(
onChanged: (value) => {dob = value},
hintText: 'DD/MM/YYYY',
prefixIcon: Icon(Icons.date_range),
)
: RaisedButton.icon(
shape: RoundedRectangleBorder(
height: 60,
child: isHijri == 1
? TextFields(
onChanged: (value) => {dob = value},
hintText: 'DD/MM/YYYY',
prefixIcon: Icon(Icons.date_range),
)
: RaisedButton.icon(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15.0),
),
color:Colors.white,
onPressed: () => {
if (isHijri != null)
_selectDate(context)
},
icon: Icon(Icons.date_range),
label: Text(selectedDate != null
? "${selectedDate.toLocal()}"
.split(' ')[0]
: TranslationBase.of(context).dob)))
])
),
color: Colors.white,
onPressed: () => {
if (isHijri != null)
_selectDate(context)
},
icon: Icon(Icons.date_range),
label: Text(selectedDate != null
? "${selectedDate.toLocal()}"
.split(' ')[0]
: TranslationBase.of(context).dob)))
])
],
),
),
Expanded(
flex: 2,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Divider(
color: Colors.grey,
height: 2,
),
SizedBox(
height: 10,
),
Row(
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).registerNow,
() => {startRegistration()},
textColor: Colors.white,
color: isButtonDisabled == true
? Colors.grey
: Colors.grey[900]))
],
),
),
Expanded(
flex: 2,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Divider(
color: Colors.grey,
height: 2,
),
SizedBox(height: 10,),
Row(
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).registerNow,
() => {startRegistration()},
textColor: Colors.white,
color: isButtonDisabled == true
? Colors.grey
: Colors.grey[900]))
],
),
],
))
]),
)));
],
))
]),
)));
}
Future<Null> _selectDate(BuildContext context) async {
@ -216,7 +217,8 @@ class _Register extends State<Register> {
this
.authService
.checkPatientForRegisteration(request)
.then((response) => {checkUserStatus(response, request)}).catchError((err) {
.then((response) => {checkUserStatus(response, request)})
.catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
ConfirmDialog dialog = new ConfirmDialog(
context: context,
@ -224,15 +226,13 @@ class _Register extends State<Register> {
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {
ConfirmDialog.closeAlertDialog(context),
Navigator.of(context).pushNamed(
REGISTER,
),
},
ConfirmDialog.closeAlertDialog(context),
Navigator.of(context).pushNamed(
REGISTER,
),
},
cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)});
dialog.showAlertDialog(context);
});
}
@ -257,7 +257,7 @@ class _Register extends State<Register> {
var nRequest = request.toJson();
nRequest['LogInTokenID'] = response['LogInTokenID'];
if (response['hasFile'] == true) {
// AppToast.showErrorToast(message: response['ErrorEndUserMessage']);
// AppToast.showErrorToast(message: response['ErrorEndUserMessage']);
AlertDialogBox(
context: context,
confirmMessage: response['ErrorEndUserMessage'],
@ -308,7 +308,7 @@ class _Register extends State<Register> {
request.isHijri = isHijri;
request.patientOutSA = countryCode == '966' ? 0 : 1;
this.authService.checkUserStatus(request).then((result) => {
GifLoaderDialogUtils.hideDialog(context),
GifLoaderDialogUtils.hideDialog(context),
if (result is Map)
{
result = CheckUserStatusResponse.fromJson(result),

@ -114,6 +114,8 @@ class _AppDrawerState extends State<AppDrawer> {
padding: EdgeInsets.only(
left: 30, right: 10),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(
@ -182,7 +184,7 @@ class _AppDrawerState extends State<AppDrawer> {
case ConnectionState.waiting:
return Padding(
padding: EdgeInsets.all(10),
child: Text('Loading....'));
child: Text(''));
default:
if (snapshot.hasError)
return Padding(

Loading…
Cancel
Save