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 { _firebaseMessaging.getToken().then((String token) async {
sharedPref.setString(PUSH_TOKEN, token); sharedPref.setString(PUSH_TOKEN, token);
if (token != null && await sharedPref.getObject(USER_PROFILE) == null) { if (token != null && projectViewModel.isLogin == false) {
DEVICE_TOKEN = token; DEVICE_TOKEN = token;
checkUserStatus(token); checkUserStatus(token);
} else if (projectViewModel.isLogin) { } else if (projectViewModel.isLogin) {

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

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

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

Loading…
Cancel
Save