actaivation code page

merge-requests/878/head
hussam al-habibeh 4 years ago
parent 08df479b37
commit fd9e8ddb28

@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/core/model/PatientRegistration/GetPatientInfo
import 'package:doctor_app_flutter/core/model/PatientRegistration/PatientRegistrationModel.dart';
import 'package:doctor_app_flutter/core/model/PatientRegistration/SendActivationCodebyOTPNotificationTypeForRegistrationModel.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart';
class PatientRegistrationService extends BaseService {
GetPatientInfoResponseModel getPatientInfoResponseModel;
@ -37,17 +38,21 @@ class PatientRegistrationService extends BaseService {
sendActivationCodeByOTPNotificationType(
{SendActivationCodeByOTPNotificationTypeForRegistrationModel
registrationModel,
int otpType}) async {
int otpType,
PatientRegistrationViewModel user}) async {
registrationModel =
SendActivationCodeByOTPNotificationTypeForRegistrationModel(
oTPSendType: otpType,
patientIdentificationID: 1062938285,
patientMobileNumber: 785228065,
zipCode: "966",
patientIdentificationID:
user.checkPatientForRegistrationModel.patientIdentificationID,
patientMobileNumber:
user.checkPatientForRegistrationModel.patientMobileNumber,
zipCode: user.checkPatientForRegistrationModel.zipCode,
patientOutSA: false,
mobileNo: "785228065",
healthId: "30000018540264",
dOB: "31/07/1988",
dOB: user.checkPatientForRegistrationModel.dOB,
isRegister: user.checkPatientForRegistrationModel.isRegister,
isHijri: user.checkPatientForRegistrationModel.isHijri,
);
hasError = false;
await baseAppClient.post(SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE,

@ -14,15 +14,13 @@ class PatientRegistrationViewModel extends BaseViewModel {
PatientRegistrationService _patientRegistrationService =
locator<PatientRegistrationService>();
GetPatientInfoResponseModel get getPatientInfoResponseModel =>
_patientRegistrationService.getPatientInfoResponseModel;
GetPatientInfoResponseModel get getPatientInfoResponseModel =>_patientRegistrationService.getPatientInfoResponseModel;
CheckPatientForRegistrationModel checkPatientForRegistrationModel ;
CheckPatientForRegistrationModel checkPatientForRegistrationModel;
Future checkPatientForRegistration(
CheckPatientForRegistrationModel registrationModel) async {
checkPatientForRegistrationModel =registrationModel;
checkPatientForRegistrationModel = registrationModel;
setState(ViewState.BusyLocal);
await _patientRegistrationService
.checkPatientForRegistration(registrationModel);
@ -36,8 +34,8 @@ class PatientRegistrationViewModel extends BaseViewModel {
Future getPatientInfo(
GetPatientInfoRequestModel getPatientInfoRequestModel) async {
setState(ViewState.BusyLocal);
await _patientRegistrationService.
getPatientInfo(getPatientInfoRequestModel);
await _patientRegistrationService
.getPatientInfo(getPatientInfoRequestModel);
if (_patientRegistrationService.hasError) {
error = _patientRegistrationService.error;
setState(ViewState.ErrorLocal);
@ -48,7 +46,8 @@ class PatientRegistrationViewModel extends BaseViewModel {
Future sendActivationCodeByOTPNotificationType(
{SendActivationCodeByOTPNotificationTypeForRegistrationModel
registrationModel,
int otpType}) async {
int otpType,
PatientRegistrationViewModel user}) async {
setState(ViewState.Busy);
await _patientRegistrationService.sendActivationCodeByOTPNotificationType(
otpType: otpType);

@ -99,8 +99,12 @@ class _RegisterPatientPageState extends State<RegisterPatientPage>
},
scrollDirection: Axis.horizontal,
children: <Widget>[
RegisterSearchPatientPage(changePageViewIndex: changePageViewIndex,),
ActivationPage(model: model,),
RegisterSearchPatientPage(
changePageViewIndex: changePageViewIndex,
),
ActivationPage(
user: model,
),
RegisterConfirmationPatientPage(),
]),
),

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckPatientForRegistrationModel.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';
@ -7,7 +8,8 @@ import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class ActivationPage extends StatefulWidget {
const ActivationPage({Key key}) : super(key: key);
PatientRegistrationViewModel user = PatientRegistrationViewModel();
ActivationPage({this.user});
@override
_ActivationPageState createState() => _ActivationPageState();

Loading…
Cancel
Save