|
|
|
@ -8,9 +8,11 @@ import 'package:diplomaticquarterapp/routes.dart';
|
|
|
|
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
|
|
|
|
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
|
|
|
|
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
|
|
|
|
@ -208,7 +210,7 @@ class _RegisterInfo extends State<RegisterInfo> {
|
|
|
|
child: DropdownButtonHideUnderline(
|
|
|
|
child: DropdownButtonHideUnderline(
|
|
|
|
child: DropdownButton(
|
|
|
|
child: DropdownButton(
|
|
|
|
isExpanded: true,
|
|
|
|
isExpanded: true,
|
|
|
|
value: language,
|
|
|
|
value: location,
|
|
|
|
iconSize: 40,
|
|
|
|
iconSize: 40,
|
|
|
|
elevation: 16,
|
|
|
|
elevation: 16,
|
|
|
|
onChanged: (value) => {
|
|
|
|
onChanged: (value) => {
|
|
|
|
@ -275,16 +277,46 @@ class _RegisterInfo extends State<RegisterInfo> {
|
|
|
|
|
|
|
|
|
|
|
|
registerNow() {
|
|
|
|
registerNow() {
|
|
|
|
dynamic request = getTempUserRequest();
|
|
|
|
dynamic request = getTempUserRequest();
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
this.authService.registerUser(request).then((result) => {
|
|
|
|
this.authService.registerUser(request).then((result) => {
|
|
|
|
print(result),
|
|
|
|
GifLoaderDialogUtils.hideDialog(context),
|
|
|
|
// userData = result.list;
|
|
|
|
// userData = result.list;
|
|
|
|
//AuthenticatedUser.fromJson(result['List'][0]),
|
|
|
|
//AuthenticatedUser.fromJson(result['List'][0]),
|
|
|
|
|
|
|
|
if(result is String){
|
|
|
|
|
|
|
|
new ConfirmDialog(
|
|
|
|
|
|
|
|
context: context,
|
|
|
|
|
|
|
|
confirmMessage: result,
|
|
|
|
|
|
|
|
okText: TranslationBase.of(context).ok,
|
|
|
|
|
|
|
|
cancelText: TranslationBase.of(context).cancel_nocaps,
|
|
|
|
|
|
|
|
okFunction: () => {
|
|
|
|
|
|
|
|
ConfirmDialog.closeAlertDialog(context)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)})
|
|
|
|
|
|
|
|
.showAlertDialog(context)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else
|
|
|
|
|
|
|
|
{
|
|
|
|
sharedPref.setObject(USER_PROFILE, result.list),
|
|
|
|
sharedPref.setObject(USER_PROFILE, result.list),
|
|
|
|
|
|
|
|
|
|
|
|
sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID),
|
|
|
|
sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID),
|
|
|
|
sharedPref.setString(TOKEN, result.authenticationTokenID),
|
|
|
|
sharedPref.setString(TOKEN, result.authenticationTokenID),
|
|
|
|
Navigator.of(context).pushNamed(HOME)
|
|
|
|
Navigator.of(context).pushNamed(HOME)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
|
|
|
ConfirmDialog dialog = new ConfirmDialog(
|
|
|
|
|
|
|
|
context: context,
|
|
|
|
|
|
|
|
confirmMessage: err,
|
|
|
|
|
|
|
|
okText: TranslationBase.of(context).confirm,
|
|
|
|
|
|
|
|
cancelText: TranslationBase.of(context).cancel_nocaps,
|
|
|
|
|
|
|
|
okFunction: () => {
|
|
|
|
|
|
|
|
Navigator.of(context).pushNamed(
|
|
|
|
|
|
|
|
REGISTER,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
ConfirmDialog.closeAlertDialog(context)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)});
|
|
|
|
|
|
|
|
dialog.showAlertDialog(context);
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -316,15 +348,12 @@ class _RegisterInfo extends State<RegisterInfo> {
|
|
|
|
"PatientIdentificationNo": registerInfo.idNumber,
|
|
|
|
"PatientIdentificationNo": registerInfo.idNumber,
|
|
|
|
"MobileNumber": registerd_data.patientMobileNumber,
|
|
|
|
"MobileNumber": registerd_data.patientMobileNumber,
|
|
|
|
"PatientOutSA": registerd_data.zipCode == '966' ? 0 : 1,
|
|
|
|
"PatientOutSA": registerd_data.zipCode == '966' ? 0 : 1,
|
|
|
|
"FirstName": registerInfo.firstNameEn == '-'
|
|
|
|
"FirstNameN":registerInfo.firstNameAr =='-' ?"": registerInfo.firstNameAr,
|
|
|
|
? registerInfo.firstNameAr
|
|
|
|
"FirstName": registerInfo.firstNameEn =='-' ?"":registerInfo.firstNameEn,
|
|
|
|
: registerInfo.firstNameEn,
|
|
|
|
"MiddleNameN":registerInfo.secondNameAr =='-' ? "" : registerInfo.secondNameAr,
|
|
|
|
"MiddleName":registerInfo.secondNameEn == '-'
|
|
|
|
"MiddleName":registerInfo.secondNameEn == '-' ? "": registerInfo.secondNameEn,
|
|
|
|
? registerInfo.secondNameAr
|
|
|
|
"LastNameN": registerInfo.lastNameAr =='-'? "" : registerInfo.lastNameAr,
|
|
|
|
: registerInfo.secondNameEn,
|
|
|
|
"LastName": registerInfo.lastNameEn =='-' ? "": registerInfo.lastNameEn,
|
|
|
|
"LastName": registerInfo.lastNameEn == '-'
|
|
|
|
|
|
|
|
? registerInfo.lastNameAr
|
|
|
|
|
|
|
|
: registerInfo.lastNameEn,
|
|
|
|
|
|
|
|
"StrDateofBirth": registerInfo.dateOfBirth,
|
|
|
|
"StrDateofBirth": registerInfo.dateOfBirth,
|
|
|
|
"DateofBirth": DateUtil.convertISODateToJsonDate(
|
|
|
|
"DateofBirth": DateUtil.convertISODateToJsonDate(
|
|
|
|
registerInfo.dateOfBirth.replaceAll('/', '-')),
|
|
|
|
registerInfo.dateOfBirth.replaceAll('/', '-')),
|
|
|
|
|