|
|
@ -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),
|
|
|
|