regstration activtion code

merge-requests/878/head
hussam al-habibeh 4 years ago
parent 4d01c74bf8
commit 1a35201f27

@ -16,7 +16,7 @@ class SendActivationCodeByOTPNotificationTypeForRegistrationModel {
int channel;
String iPAdress;
String generalid;
int patientOutSA;
bool patientOutSA;
Null sessionID;
bool isDentalAllowedBackend;
int deviceTypeID;
@ -26,29 +26,29 @@ class SendActivationCodeByOTPNotificationTypeForRegistrationModel {
SendActivationCodeByOTPNotificationTypeForRegistrationModel(
{this.patientMobileNumber,
this.mobileNo,
this.projectOutSA,
this.loginType,
this.zipCode,
this.isRegister,
this.logInTokenID,
this.searchType,
this.patientID,
this.nationalID,
this.patientIdentificationID,
this.oTPSendType,
this.languageID,
this.versionID,
this.channel,
this.iPAdress,
this.generalid,
this.patientOutSA,
this.sessionID,
this.isDentalAllowedBackend,
this.deviceTypeID,
this.dOB,
this.isHijri,
this.healthId});
this.mobileNo,
this.projectOutSA,
this.loginType,
this.zipCode,
this.isRegister,
this.logInTokenID,
this.searchType,
this.patientID,
this.nationalID,
this.patientIdentificationID,
this.oTPSendType,
this.languageID,
this.versionID,
this.channel,
this.iPAdress,
this.generalid,
this.patientOutSA,
this.sessionID,
this.isDentalAllowedBackend,
this.deviceTypeID,
this.dOB,
this.isHijri,
this.healthId});
SendActivationCodeByOTPNotificationTypeForRegistrationModel.fromJson(
Map<String, dynamic> json) {

@ -18,12 +18,27 @@ class PatientRegistrationService extends BaseService {
}
sendActivationCodeByOTPNotificationType(
SendActivationCodeByOTPNotificationTypeForRegistrationModel
registrationModel) async {
{SendActivationCodeByOTPNotificationTypeForRegistrationModel
registrationModel,
int otpType}) async {
registrationModel =
SendActivationCodeByOTPNotificationTypeForRegistrationModel(
oTPSendType: otpType,
patientIdentificationID: 1062938285,
patientMobileNumber: 785228065,
zipCode: "966",
patientOutSA: false,
mobileNo: "785228065",
healthId: "30000018540264",
dOB: "31/07/1988",
);
hasError = false;
await baseAppClient.post(SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE,
onSuccess: (dynamic response, int statusCode) {},
onFailure: (String error, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
registrationModel =
SendActivationCodeByOTPNotificationTypeForRegistrationModel.fromJson(
response);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: registrationModel.toJson());

@ -25,11 +25,12 @@ class PatientRegistrationViewModel extends BaseViewModel {
}
Future sendActivationCodeByOTPNotificationType(
SendActivationCodeByOTPNotificationTypeForRegistrationModel
registrationModel) async {
{SendActivationCodeByOTPNotificationTypeForRegistrationModel
registrationModel,
int otpType}) async {
setState(ViewState.Busy);
await _patientRegistrationService
.sendActivationCodeByOTPNotificationType(registrationModel);
await _patientRegistrationService.sendActivationCodeByOTPNotificationType(
otpType: otpType);
if (_patientRegistrationService.hasError) {
error = _patientRegistrationService.error;
setState(ViewState.Error);

@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
import 'package:doctor_app_flutter/screens/patients/profile/UCAF/page-stepper-widget.dart';
import 'package:doctor_app_flutter/screens/patients/register_patient/RegisterConfirmationPatientPage.dart';
import 'package:doctor_app_flutter/screens/patients/register_patient/VerifyMethodPage.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
@ -99,8 +100,8 @@ class _RegisterPatientPageState extends State<RegisterPatientPage>
scrollDirection: Axis.horizontal,
children: <Widget>[
RegisterSearchPatientPage(),
ActivationPage(),
RegisterConfirmationPatientPage(),
]),
),
),

@ -0,0 +1,48 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
class VerifyActivationCodePage extends StatefulWidget {
const VerifyActivationCodePage({Key key}) : super(key: key);
@override
_VerifyActivationCodePageState createState() =>
_VerifyActivationCodePageState();
}
class _VerifyActivationCodePageState extends State<VerifyActivationCodePage> {
@override
Widget build(BuildContext context) {
return BaseView<PatientRegistrationViewModel>(
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
body: Column(
children: [
Container(
width: double.infinity,
margin: EdgeInsets.all(16.0),
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
"Please enter the verification code sent to 02221552",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.2,
fontWeight: FontWeight.w800,
),
],
),
),
)
],
),
),
);
}
}

@ -0,0 +1,147 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class ActivationPage extends StatefulWidget {
const ActivationPage({Key key}) : super(key: key);
@override
_ActivationPageState createState() => _ActivationPageState();
}
class _ActivationPageState extends State<ActivationPage> {
@override
Widget build(BuildContext context) {
return BaseView<PatientRegistrationViewModel>(
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: false,
body: Column(
children: [
Container(
width: double.infinity,
margin: EdgeInsets.all(16.0),
child: SingleChildScrollView(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
"Please select how you want to be verified",
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 2.2,
fontWeight: FontWeight.w800,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: InkWell(
onTap: () {
model.sendActivationCodeByOTPNotificationType(
otpType: 1);
},
child: Container(
height:
MediaQuery.of(context).size.height * 0.233,
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10),
),
border: Border.all(
color: HexColor('#707070'), width: 0.1),
),
child: Column(
children: [
Row(
children: [
Image.asset(
"assets/images/verify-sms.png",
height:
MediaQuery.of(context).size.height *
0.15,
width:
MediaQuery.of(context).size.width *
0.15,
),
],
),
SizedBox(
height: 20,
),
AppText(
"Verify through SMS",
fontSize: 14,
color: Color(0xFF2E303A),
fontWeight: FontWeight.bold,
)
],
),
),
),
),
Expanded(
child: InkWell(
onTap: () {
model.sendActivationCodeByOTPNotificationType(
otpType: 1);
},
child: Container(
height:
MediaQuery.of(context).size.height * 0.233,
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10),
),
border: Border.all(
color: HexColor('#707070'), width: 0.1),
),
child: Column(
children: [
Row(
children: [
Image.asset(
"assets/images/verify-whtsapp.png",
height:
MediaQuery.of(context).size.height *
0.15,
width:
MediaQuery.of(context).size.width *
0.15,
),
],
),
SizedBox(
height: 20,
),
AppText(
"Verify through WhatsApp",
fontSize: 14,
color: Color(0xFF2E303A),
fontWeight: FontWeight.bold,
)
],
),
),
),
),
],
),
],
),
),
)
],
),
),
);
}
}
Loading…
Cancel
Save