|
|
|
@ -6,8 +6,10 @@ import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
import 'package:diplomaticquarterapp/locator.dart';
|
|
|
|
import 'package:diplomaticquarterapp/locator.dart';
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
|
|
|
|
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart' as checkActivation;
|
|
|
|
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'
|
|
|
|
|
|
|
|
as checkActivation;
|
|
|
|
import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart';
|
|
|
|
import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart';
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Authentication/countries_list.dart';
|
|
|
|
import 'package:diplomaticquarterapp/models/Authentication/register_info_response.dart';
|
|
|
|
import 'package:diplomaticquarterapp/models/Authentication/register_info_response.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart';
|
|
|
|
import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart';
|
|
|
|
@ -36,7 +38,8 @@ class RegisterInfo extends StatefulWidget {
|
|
|
|
final Function changePageViewIndex;
|
|
|
|
final Function changePageViewIndex;
|
|
|
|
final int page;
|
|
|
|
final int page;
|
|
|
|
|
|
|
|
|
|
|
|
const RegisterInfo({Key key, this.changePageViewIndex, this.page = 1}) : super(key: key);
|
|
|
|
const RegisterInfo({Key key, this.changePageViewIndex, this.page = 1})
|
|
|
|
|
|
|
|
: super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
_RegisterInfo createState() => _RegisterInfo();
|
|
|
|
_RegisterInfo createState() => _RegisterInfo();
|
|
|
|
@ -45,7 +48,7 @@ class RegisterInfo extends StatefulWidget {
|
|
|
|
class _RegisterInfo extends State<RegisterInfo> {
|
|
|
|
class _RegisterInfo extends State<RegisterInfo> {
|
|
|
|
final authService = new AuthProvider();
|
|
|
|
final authService = new AuthProvider();
|
|
|
|
final sharedPref = new AppSharedPreferences();
|
|
|
|
final sharedPref = new AppSharedPreferences();
|
|
|
|
RegisterInfoResponse registerInfo;
|
|
|
|
RegisterInfoResponse registerInfo =RegisterInfoResponse();
|
|
|
|
bool isLoading;
|
|
|
|
bool isLoading;
|
|
|
|
int page;
|
|
|
|
int page;
|
|
|
|
final List<Location> locationList = [
|
|
|
|
final List<Location> locationList = [
|
|
|
|
@ -53,30 +56,48 @@ class _RegisterInfo extends State<RegisterInfo> {
|
|
|
|
new Location(name: 'Dubai', value: '2'),
|
|
|
|
new Location(name: 'Dubai', value: '2'),
|
|
|
|
];
|
|
|
|
];
|
|
|
|
String language = '1';
|
|
|
|
String language = '1';
|
|
|
|
var registerd_data;
|
|
|
|
CheckPatientAuthenticationReq registerd_data;
|
|
|
|
final List<Language> languageList = [
|
|
|
|
final List<Language> languageList = [
|
|
|
|
new Language(name: 'English', value: '2'),
|
|
|
|
new Language(name: 'English', value: '2'),
|
|
|
|
new Language(name: 'Arabic', value: '1'),
|
|
|
|
new Language(name: 'Arabic', value: '1'),
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
final List<Language> genderList = [
|
|
|
|
|
|
|
|
new Language(name: 'Male', value: 'M'),
|
|
|
|
|
|
|
|
new Language(name: 'Female', value: 'F'),
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
final List<Language> maritalList = [
|
|
|
|
|
|
|
|
new Language(name: 'Married', value: 'M'),
|
|
|
|
|
|
|
|
new Language(name: 'Single', value: 'S'),
|
|
|
|
|
|
|
|
new Language(name: 'Divorce', value: 'D'),
|
|
|
|
|
|
|
|
];
|
|
|
|
String email = '';
|
|
|
|
String email = '';
|
|
|
|
|
|
|
|
List<CountriesLists> countriesList = [];
|
|
|
|
ToDoCountProviderModel toDoProvider;
|
|
|
|
ToDoCountProviderModel toDoProvider;
|
|
|
|
String location = '1';
|
|
|
|
String location = '1';
|
|
|
|
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
|
|
|
|
AuthenticatedUserObject authenticatedUserObject =
|
|
|
|
|
|
|
|
locator<AuthenticatedUserObject>();
|
|
|
|
|
|
|
|
|
|
|
|
ProjectViewModel projectViewModel;
|
|
|
|
ProjectViewModel projectViewModel;
|
|
|
|
|
|
|
|
|
|
|
|
AppointmentRateViewModel appointmentRateViewModel = locator<AppointmentRateViewModel>();
|
|
|
|
AppointmentRateViewModel appointmentRateViewModel =
|
|
|
|
|
|
|
|
locator<AppointmentRateViewModel>();
|
|
|
|
|
|
|
|
bool isDubai =false;
|
|
|
|
|
|
|
|
RegisterInfoResponse data = RegisterInfoResponse();
|
|
|
|
|
|
|
|
CheckPatientAuthenticationReq data2;
|
|
|
|
|
|
|
|
String gender = 'M';
|
|
|
|
|
|
|
|
String maritalStatus = 'M';
|
|
|
|
|
|
|
|
String nationality = 'SAU';
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(widget.page ==1) {
|
|
|
|
|
|
|
|
getCountries();
|
|
|
|
|
|
|
|
}
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
|
|
|
getRegisterInfo();
|
|
|
|
getRegisterInfo();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
page = widget.page;
|
|
|
|
page = widget.page;
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
super.initState();
|
|
|
|
super.initState();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -85,17 +106,23 @@ class _RegisterInfo extends State<RegisterInfo> {
|
|
|
|
projectViewModel = Provider.of(context);
|
|
|
|
projectViewModel = Provider.of(context);
|
|
|
|
toDoProvider = Provider.of<ToDoCountProviderModel>(context);
|
|
|
|
toDoProvider = Provider.of<ToDoCountProviderModel>(context);
|
|
|
|
return AppScaffold(
|
|
|
|
return AppScaffold(
|
|
|
|
appBarTitle: TranslationBase.of(context).register,
|
|
|
|
appBarTitle: TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.register,
|
|
|
|
isShowAppBar: false,
|
|
|
|
isShowAppBar: false,
|
|
|
|
isShowDecPage: false,
|
|
|
|
isShowDecPage: false,
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
padding: EdgeInsets.all(30),
|
|
|
|
padding: EdgeInsets.all(30),
|
|
|
|
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
|
|
|
|
child:
|
|
|
|
|
|
|
|
Column(crossAxisAlignment: CrossAxisAlignment.start, children: <
|
|
|
|
|
|
|
|
Widget>[
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: AppText(
|
|
|
|
child: AppText(
|
|
|
|
TranslationBase.of(context).personalInfo,
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.personalInfo,
|
|
|
|
fontSize: 16,
|
|
|
|
fontSize: 16,
|
|
|
|
textAlign: TextAlign.left,
|
|
|
|
textAlign: TextAlign.left,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
@ -105,45 +132,225 @@ class _RegisterInfo extends State<RegisterInfo> {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(height: 20),
|
|
|
|
SizedBox(height: 20),
|
|
|
|
registerInfo != null && page == 1
|
|
|
|
(isDubai && page == 1)
|
|
|
|
|
|
|
|
? Column(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
SizedBox(height: 20),
|
|
|
|
|
|
|
|
getnameField(
|
|
|
|
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.identificationNumber,
|
|
|
|
|
|
|
|
registerd_data.patientIdentificationID,
|
|
|
|
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.mobileNumber,
|
|
|
|
|
|
|
|
registerd_data.patientMobileNumber.toString()),
|
|
|
|
|
|
|
|
// SizedBox(height: 20),
|
|
|
|
|
|
|
|
getnameField(
|
|
|
|
|
|
|
|
'',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inputWidget( TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.firstName, TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.firstName,'fName'),
|
|
|
|
|
|
|
|
'',
|
|
|
|
|
|
|
|
inputWidget( TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.middleName, TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.middleName,'sName'),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getnameField(
|
|
|
|
|
|
|
|
'',
|
|
|
|
|
|
|
|
inputWidget( TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.lastName, TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.lastName, 'lName'),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.gender,
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
height: 20,
|
|
|
|
|
|
|
|
child: DropdownButtonHideUnderline(
|
|
|
|
|
|
|
|
child: DropdownButton(
|
|
|
|
|
|
|
|
isExpanded: true,
|
|
|
|
|
|
|
|
value: gender,
|
|
|
|
|
|
|
|
hint: Text(TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.gender),
|
|
|
|
|
|
|
|
iconSize: 40,
|
|
|
|
|
|
|
|
elevation: 16,
|
|
|
|
|
|
|
|
onChanged: (value) =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
gender = value;
|
|
|
|
|
|
|
|
registerInfo.gender = value;
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
items: genderList
|
|
|
|
|
|
|
|
.map<DropdownMenuItem<String>>(
|
|
|
|
|
|
|
|
(Language value) {
|
|
|
|
|
|
|
|
return DropdownMenuItem<String>(
|
|
|
|
|
|
|
|
value: value.value,
|
|
|
|
|
|
|
|
child: Text(value.name),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}).toList()))),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(height: 20),
|
|
|
|
|
|
|
|
getnameField(
|
|
|
|
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.maritalStatus,
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
height: 18,
|
|
|
|
|
|
|
|
child: DropdownButtonHideUnderline(
|
|
|
|
|
|
|
|
child: DropdownButton(
|
|
|
|
|
|
|
|
isExpanded: true,
|
|
|
|
|
|
|
|
value: maritalStatus,
|
|
|
|
|
|
|
|
hint: Text(TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.maritalStatus),
|
|
|
|
|
|
|
|
iconSize: 40,
|
|
|
|
|
|
|
|
elevation: 16,
|
|
|
|
|
|
|
|
onChanged: (value) =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
maritalStatus = value;
|
|
|
|
|
|
|
|
registerInfo.maritalStatusCode = value;
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
items: maritalList
|
|
|
|
|
|
|
|
.map<DropdownMenuItem<String>>(
|
|
|
|
|
|
|
|
(Language value) {
|
|
|
|
|
|
|
|
return DropdownMenuItem<String>(
|
|
|
|
|
|
|
|
value: value.value,
|
|
|
|
|
|
|
|
child: Text(value.name),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}).toList()))),
|
|
|
|
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.nationality,
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
height: 22,
|
|
|
|
|
|
|
|
child: DropdownButtonHideUnderline(
|
|
|
|
|
|
|
|
child: DropdownButton(
|
|
|
|
|
|
|
|
isExpanded: true,
|
|
|
|
|
|
|
|
value: nationality,
|
|
|
|
|
|
|
|
hint: Text(TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.nationality),
|
|
|
|
|
|
|
|
iconSize: 40,
|
|
|
|
|
|
|
|
elevation: 16,
|
|
|
|
|
|
|
|
onChanged: (value) =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
nationality = value;
|
|
|
|
|
|
|
|
registerInfo.nationalityCode = value;
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
items: countriesList
|
|
|
|
|
|
|
|
.map<DropdownMenuItem<String>>(
|
|
|
|
|
|
|
|
(CountriesLists value) {
|
|
|
|
|
|
|
|
return DropdownMenuItem<String>(
|
|
|
|
|
|
|
|
value: value.iD,
|
|
|
|
|
|
|
|
child: Text(value.name),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}).toList())))),
|
|
|
|
|
|
|
|
SizedBox(height: 20),
|
|
|
|
|
|
|
|
getnameField(
|
|
|
|
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.dateOfBirth,
|
|
|
|
|
|
|
|
registerd_data.dob,
|
|
|
|
|
|
|
|
"", ""),
|
|
|
|
|
|
|
|
SizedBox(height: 20),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
: (registerInfo.healthId != null && page == 1)
|
|
|
|
? Column(
|
|
|
|
? Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
SizedBox(height: 20),
|
|
|
|
SizedBox(height: 20),
|
|
|
|
getnameField(TranslationBase.of(context).identificationNumber, registerInfo.idNumber, TranslationBase.of(context).firstName,
|
|
|
|
getnameField(
|
|
|
|
registerInfo.firstNameEn == '-' ? registerInfo.firstNameAr : registerInfo.firstNameEn),
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.identificationNumber,
|
|
|
|
|
|
|
|
registerInfo.idNumber,
|
|
|
|
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.firstName,
|
|
|
|
|
|
|
|
registerInfo.firstNameEn == '-'
|
|
|
|
|
|
|
|
? registerInfo.firstNameAr
|
|
|
|
|
|
|
|
: registerInfo.firstNameEn),
|
|
|
|
SizedBox(height: 20),
|
|
|
|
SizedBox(height: 20),
|
|
|
|
getnameField(TranslationBase.of(context).middleName, registerInfo.secondNameEn == '-' ? registerInfo.secondNameEn : registerInfo.secondNameEn,
|
|
|
|
getnameField(
|
|
|
|
TranslationBase.of(context).lastName, registerInfo.lastNameEn == '-' ? registerInfo.lastNameEn : registerInfo.lastNameEn),
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.middleName,
|
|
|
|
|
|
|
|
registerInfo.secondNameEn == '-'
|
|
|
|
|
|
|
|
? registerInfo.secondNameEn
|
|
|
|
|
|
|
|
: registerInfo.secondNameEn,
|
|
|
|
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.lastName,
|
|
|
|
|
|
|
|
registerInfo.lastNameEn == '-'
|
|
|
|
|
|
|
|
? registerInfo.lastNameEn
|
|
|
|
|
|
|
|
: registerInfo.lastNameEn),
|
|
|
|
SizedBox(height: 20),
|
|
|
|
SizedBox(height: 20),
|
|
|
|
getnameField(
|
|
|
|
getnameField(
|
|
|
|
TranslationBase.of(context).gender,
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.gender,
|
|
|
|
registerInfo.maritalStatusCode == 'U'
|
|
|
|
registerInfo.maritalStatusCode == 'U'
|
|
|
|
? 'Unknown'
|
|
|
|
? 'Unknown'
|
|
|
|
: registerInfo.maritalStatusCode == 'M'
|
|
|
|
: registerInfo.maritalStatusCode == 'M'
|
|
|
|
? 'Male'
|
|
|
|
? 'Male'
|
|
|
|
: 'Female',
|
|
|
|
: 'Female',
|
|
|
|
TranslationBase.of(context).maritalStatus,
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.maritalStatus,
|
|
|
|
registerInfo.maritalStatus),
|
|
|
|
registerInfo.maritalStatus),
|
|
|
|
SizedBox(height: 20),
|
|
|
|
SizedBox(height: 20),
|
|
|
|
getnameField(TranslationBase.of(context).nationality, registerInfo.nationality, TranslationBase.of(context).mobileNumber, registerd_data.patientMobileNumber.toString()),
|
|
|
|
getnameField(
|
|
|
|
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.nationality,
|
|
|
|
|
|
|
|
registerInfo.nationality,
|
|
|
|
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.mobileNumber,
|
|
|
|
|
|
|
|
registerd_data.patientMobileNumber.toString()),
|
|
|
|
SizedBox(height: 20),
|
|
|
|
SizedBox(height: 20),
|
|
|
|
getnameField(TranslationBase.of(context).dateOfBirth, registerInfo.dateOfBirth, "", ""),
|
|
|
|
getnameField(TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.dateOfBirth,
|
|
|
|
|
|
|
|
registerInfo.dateOfBirth, "", ""),
|
|
|
|
SizedBox(height: 20),
|
|
|
|
SizedBox(height: 20),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: registerInfo != null && widget.page == 2
|
|
|
|
: widget.page == 2
|
|
|
|
? Column(
|
|
|
|
? Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: <Widget>[
|
|
|
|
children: <Widget>[
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
width: double.infinity,
|
|
|
|
width: double.infinity,
|
|
|
|
decoration: containerRadius(Colors.white, 12),
|
|
|
|
decoration: containerRadius(Colors.white, 12),
|
|
|
|
padding: EdgeInsets.only(left: 10, right: 10, top: 5, bottom: 25),
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
|
|
|
left: 10, right: 10, top: 5, bottom: 25),
|
|
|
|
child: Row(children: [
|
|
|
|
child: Row(children: [
|
|
|
|
Flexible(
|
|
|
|
Flexible(
|
|
|
|
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
TranslationBase.of(context).prefferedLanguage,
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.prefferedLanguage,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 11,
|
|
|
|
fontSize: 11,
|
|
|
|
letterSpacing: -0.44,
|
|
|
|
letterSpacing: -0.44,
|
|
|
|
@ -152,22 +359,33 @@ class _RegisterInfo extends State<RegisterInfo> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
height: 18,
|
|
|
|
height: 18,
|
|
|
|
child: DropdownButtonHideUnderline(
|
|
|
|
child:
|
|
|
|
|
|
|
|
DropdownButtonHideUnderline(
|
|
|
|
child: DropdownButton(
|
|
|
|
child: DropdownButton(
|
|
|
|
isExpanded: true,
|
|
|
|
isExpanded: true,
|
|
|
|
value: language,
|
|
|
|
value: language,
|
|
|
|
hint: Text(TranslationBase.of(context).prefferedLanguage),
|
|
|
|
hint: Text(TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.prefferedLanguage),
|
|
|
|
iconSize: 40,
|
|
|
|
iconSize: 40,
|
|
|
|
elevation: 16,
|
|
|
|
elevation: 16,
|
|
|
|
onChanged: (value) => {
|
|
|
|
onChanged: (value) =>
|
|
|
|
|
|
|
|
{
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
language = value;
|
|
|
|
language =
|
|
|
|
|
|
|
|
value;
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
items: languageList.map<DropdownMenuItem<String>>((Language value) {
|
|
|
|
items: languageList.map<
|
|
|
|
return DropdownMenuItem<String>(
|
|
|
|
DropdownMenuItem<
|
|
|
|
value: value.value,
|
|
|
|
String>>(
|
|
|
|
child: Text(value.name),
|
|
|
|
(Language value) {
|
|
|
|
|
|
|
|
return DropdownMenuItem<
|
|
|
|
|
|
|
|
String>(
|
|
|
|
|
|
|
|
value:
|
|
|
|
|
|
|
|
value.value,
|
|
|
|
|
|
|
|
child: Text(
|
|
|
|
|
|
|
|
value.name),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}).toList())))
|
|
|
|
}).toList())))
|
|
|
|
]))
|
|
|
|
]))
|
|
|
|
@ -178,12 +396,18 @@ class _RegisterInfo extends State<RegisterInfo> {
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
width: double.infinity,
|
|
|
|
width: double.infinity,
|
|
|
|
decoration: containerRadius(Colors.white, 12),
|
|
|
|
decoration: containerRadius(Colors.white, 12),
|
|
|
|
padding: EdgeInsets.only(left: 10, right: 10, top: 5, bottom: 25),
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
|
|
|
left: 10, right: 10, top: 5, bottom: 25),
|
|
|
|
child: Row(children: [
|
|
|
|
child: Row(children: [
|
|
|
|
Flexible(
|
|
|
|
Flexible(
|
|
|
|
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
TranslationBase.of(context).selectLocation,
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.selectLocation,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 11,
|
|
|
|
fontSize: 11,
|
|
|
|
letterSpacing: -0.44,
|
|
|
|
letterSpacing: -0.44,
|
|
|
|
@ -192,21 +416,33 @@ class _RegisterInfo extends State<RegisterInfo> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
height: 18,
|
|
|
|
height: 18,
|
|
|
|
child: DropdownButtonHideUnderline(
|
|
|
|
child:
|
|
|
|
|
|
|
|
DropdownButtonHideUnderline(
|
|
|
|
child: DropdownButton(
|
|
|
|
child: DropdownButton(
|
|
|
|
isExpanded: true,
|
|
|
|
isExpanded: true,
|
|
|
|
value: location,
|
|
|
|
value: location,
|
|
|
|
hint: Text(TranslationBase.of(context).selectLocation),
|
|
|
|
hint: Text(
|
|
|
|
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(
|
|
|
|
|
|
|
|
context)
|
|
|
|
|
|
|
|
.selectLocation),
|
|
|
|
iconSize: 40,
|
|
|
|
iconSize: 40,
|
|
|
|
elevation: 16,
|
|
|
|
elevation: 16,
|
|
|
|
onChanged: (value) => {
|
|
|
|
onChanged: (value) =>
|
|
|
|
|
|
|
|
{
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
location = value;
|
|
|
|
location =
|
|
|
|
|
|
|
|
value;
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
items: locationList.map<DropdownMenuItem<String>>((Location value) {
|
|
|
|
items: locationList.map<
|
|
|
|
return DropdownMenuItem<String>(
|
|
|
|
DropdownMenuItem<
|
|
|
|
value: value.value,
|
|
|
|
String>>(
|
|
|
|
|
|
|
|
(Location value) {
|
|
|
|
|
|
|
|
return DropdownMenuItem<
|
|
|
|
|
|
|
|
String>(
|
|
|
|
|
|
|
|
value:
|
|
|
|
|
|
|
|
value.value,
|
|
|
|
child: Text(
|
|
|
|
child: Text(
|
|
|
|
value.name,
|
|
|
|
value.name,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -220,13 +456,19 @@ class _RegisterInfo extends State<RegisterInfo> {
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
width: double.infinity,
|
|
|
|
width: double.infinity,
|
|
|
|
decoration: containerRadius(Colors.white, 12),
|
|
|
|
decoration: containerRadius(Colors.white, 12),
|
|
|
|
padding: EdgeInsets.only(left: 10, right: 10, top: 5, bottom: 12),
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
|
|
|
left: 10, right: 10, top: 5, bottom: 12),
|
|
|
|
margin: EdgeInsets.only(bottom: 0),
|
|
|
|
margin: EdgeInsets.only(bottom: 0),
|
|
|
|
child: Row(children: [
|
|
|
|
child: Row(children: [
|
|
|
|
Flexible(
|
|
|
|
Flexible(
|
|
|
|
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
TranslationBase.of(context).email,
|
|
|
|
TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.email,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 11,
|
|
|
|
fontSize: 11,
|
|
|
|
letterSpacing: -0.44,
|
|
|
|
letterSpacing: -0.44,
|
|
|
|
@ -256,7 +498,8 @@ class _RegisterInfo extends State<RegisterInfo> {
|
|
|
|
color: Color(0xff575757),
|
|
|
|
color: Color(0xff575757),
|
|
|
|
letterSpacing: -0.56,
|
|
|
|
letterSpacing: -0.56,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
prefixIconConstraints: BoxConstraints(minWidth: 50),
|
|
|
|
prefixIconConstraints:
|
|
|
|
|
|
|
|
BoxConstraints(minWidth: 50),
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
border: InputBorder.none,
|
|
|
|
border: InputBorder.none,
|
|
|
|
focusedBorder: InputBorder.none,
|
|
|
|
focusedBorder: InputBorder.none,
|
|
|
|
@ -278,51 +521,101 @@ class _RegisterInfo extends State<RegisterInfo> {
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
child: DefaultButton(TranslationBase.of(context).cancel, () {
|
|
|
|
child:
|
|
|
|
|
|
|
|
DefaultButton(TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.cancel, () {
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
locator<GAnalytics>().loginRegistration.registration_cancel(step: page == 1 ? 'personal info' : 'other details');
|
|
|
|
locator<GAnalytics>()
|
|
|
|
|
|
|
|
.loginRegistration
|
|
|
|
|
|
|
|
.registration_cancel(
|
|
|
|
|
|
|
|
step: page == 1
|
|
|
|
|
|
|
|
? 'personal info'
|
|
|
|
|
|
|
|
: 'other details');
|
|
|
|
}, textColor: Colors.white, color: Color(0xffD02127))),
|
|
|
|
}, textColor: Colors.white, color: Color(0xffD02127))),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
child: DefaultButton(page == 1 ? TranslationBase.of(context).next : TranslationBase.of(context).register, () {
|
|
|
|
child: DefaultButton(
|
|
|
|
|
|
|
|
page == 1
|
|
|
|
|
|
|
|
? TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.next
|
|
|
|
|
|
|
|
: TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.register, () {
|
|
|
|
nextPage();
|
|
|
|
nextPage();
|
|
|
|
page == 1 ? locator<GAnalytics>().loginRegistration.registration_personal_info() : locator<GAnalytics>().loginRegistration.registration_patient_info();
|
|
|
|
page == 1
|
|
|
|
}, textColor: Colors.white, color: isValid() == true && page == 2 || page == 1 ? Color(0xff359846) : Colors.grey)),
|
|
|
|
? locator<GAnalytics>()
|
|
|
|
|
|
|
|
.loginRegistration
|
|
|
|
|
|
|
|
.registration_personal_info()
|
|
|
|
|
|
|
|
: locator<GAnalytics>()
|
|
|
|
|
|
|
|
.loginRegistration
|
|
|
|
|
|
|
|
.registration_patient_info();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
|
|
|
color: isValid() == true
|
|
|
|
|
|
|
|
? Color(0xff359846)
|
|
|
|
|
|
|
|
: Colors.grey)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)));
|
|
|
|
)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
nextPage() {
|
|
|
|
nextPage() async{
|
|
|
|
if (page == 1) {
|
|
|
|
if (page == 1) {
|
|
|
|
setState(() {
|
|
|
|
if(isDubai) {
|
|
|
|
|
|
|
|
await setRegisterData();
|
|
|
|
widget.changePageViewIndex(2);
|
|
|
|
widget.changePageViewIndex(2);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
else{
|
|
|
|
|
|
|
|
widget.changePageViewIndex(2);
|
|
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
registerNow();
|
|
|
|
registerNow();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
setRegisterData() async{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
registerInfo.gender = gender;
|
|
|
|
|
|
|
|
registerInfo.maritalStatusCode =maritalStatus;
|
|
|
|
|
|
|
|
registerInfo.nationalityCode =nationality;
|
|
|
|
|
|
|
|
projectViewModel.setRegisterData(registerInfo);
|
|
|
|
|
|
|
|
// await sharedPref.setObject(REGISTER_INFO_DUBAI, registerInfo);
|
|
|
|
|
|
|
|
}
|
|
|
|
registerNow() {
|
|
|
|
registerNow() {
|
|
|
|
dynamic request = getTempUserRequest();
|
|
|
|
dynamic request;
|
|
|
|
|
|
|
|
if(isDubai)
|
|
|
|
|
|
|
|
request = getTempUserRequestDubai();
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
request = getTempUserRequest();
|
|
|
|
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
dynamic res;
|
|
|
|
dynamic res;
|
|
|
|
this
|
|
|
|
this
|
|
|
|
.authService
|
|
|
|
.authService
|
|
|
|
.registerUser(request)
|
|
|
|
.registerUser(request)
|
|
|
|
.then((result) => {
|
|
|
|
.then((result) =>
|
|
|
|
|
|
|
|
{
|
|
|
|
GifLoaderDialogUtils.hideDialog(context),
|
|
|
|
GifLoaderDialogUtils.hideDialog(context),
|
|
|
|
if (result is String)
|
|
|
|
if (result is String)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
new ConfirmDialog(
|
|
|
|
new ConfirmDialog(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
confirmMessage: result,
|
|
|
|
confirmMessage: result,
|
|
|
|
okText: TranslationBase.of(context).ok,
|
|
|
|
okText: TranslationBase
|
|
|
|
cancelText: TranslationBase.of(context).cancel_nocaps,
|
|
|
|
.of(context)
|
|
|
|
okFunction: () => {ConfirmDialog.closeAlertDialog(context)},
|
|
|
|
.ok,
|
|
|
|
cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)}).showAlertDialog(context)
|
|
|
|
cancelText: TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.cancel_nocaps,
|
|
|
|
|
|
|
|
okFunction: () =>
|
|
|
|
|
|
|
|
{ConfirmDialog.closeAlertDialog(context)},
|
|
|
|
|
|
|
|
cancelFunction: () =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ConfirmDialog.closeAlertDialog(context)
|
|
|
|
|
|
|
|
}).showAlertDialog(context)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -345,9 +638,13 @@ class _RegisterInfo extends State<RegisterInfo> {
|
|
|
|
|
|
|
|
|
|
|
|
sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID),
|
|
|
|
sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID),
|
|
|
|
sharedPref.setString(TOKEN, result.authenticationTokenID),
|
|
|
|
sharedPref.setString(TOKEN, result.authenticationTokenID),
|
|
|
|
AppToast.showSuccessToast(message: TranslationBase.of(context).successRegister),
|
|
|
|
AppToast.showSuccessToast(
|
|
|
|
|
|
|
|
message: TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.successRegister),
|
|
|
|
checkIfUserAgreedBefore(result),
|
|
|
|
checkIfUserAgreedBefore(result),
|
|
|
|
projectViewModel.analytics.loginRegistration.registration_confirmation()
|
|
|
|
projectViewModel.analytics.loginRegistration
|
|
|
|
|
|
|
|
.registration_confirmation()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.catchError((err) {
|
|
|
|
.catchError((err) {
|
|
|
|
@ -355,12 +652,17 @@ class _RegisterInfo extends State<RegisterInfo> {
|
|
|
|
ConfirmDialog dialog = new ConfirmDialog(
|
|
|
|
ConfirmDialog dialog = new ConfirmDialog(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
confirmMessage: err,
|
|
|
|
confirmMessage: err,
|
|
|
|
okText: TranslationBase.of(context).confirm,
|
|
|
|
okText: TranslationBase
|
|
|
|
cancelText: TranslationBase.of(context).cancel_nocaps,
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.confirm,
|
|
|
|
|
|
|
|
cancelText: TranslationBase
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.cancel_nocaps,
|
|
|
|
okFunction: () => {ConfirmDialog.closeAlertDialog(context)},
|
|
|
|
okFunction: () => {ConfirmDialog.closeAlertDialog(context)},
|
|
|
|
cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)});
|
|
|
|
cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)});
|
|
|
|
dialog.showAlertDialog(context);
|
|
|
|
dialog.showAlertDialog(context);
|
|
|
|
projectViewModel.analytics.loginRegistration.registration_fail(errorType: err);
|
|
|
|
projectViewModel.analytics.loginRegistration
|
|
|
|
|
|
|
|
.registration_fail(errorType: err);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -374,30 +676,44 @@ class _RegisterInfo extends State<RegisterInfo> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
getRegisterInfo() async {
|
|
|
|
getRegisterInfo() async {
|
|
|
|
var data = RegisterInfoResponse.fromJson(await sharedPref.getObject(NHIC_DATA));
|
|
|
|
|
|
|
|
|
|
|
|
if (await sharedPref.getObject(NHIC_DATA) != null) {
|
|
|
|
|
|
|
|
data =
|
|
|
|
|
|
|
|
RegisterInfoResponse.fromJson(await sharedPref.getObject(NHIC_DATA));
|
|
|
|
|
|
|
|
this.registerInfo = data;
|
|
|
|
|
|
|
|
}
|
|
|
|
if (await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN) != null) {
|
|
|
|
if (await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN) != null) {
|
|
|
|
var data2 = CheckPatientAuthenticationReq.fromJson(await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN));
|
|
|
|
data2 = CheckPatientAuthenticationReq.fromJson(
|
|
|
|
|
|
|
|
await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN));
|
|
|
|
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
this.registerInfo = data;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.registerd_data = data2;
|
|
|
|
this.registerd_data = data2;
|
|
|
|
|
|
|
|
isDubai = data2.patientOutSA == 1 ? true : false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
getTempUserRequest() {
|
|
|
|
getTempUserRequest() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DateFormat dateFormat = DateFormat("mm/dd/yyyy");
|
|
|
|
DateFormat dateFormat = DateFormat("mm/dd/yyyy");
|
|
|
|
print(dateFormat.parse(registerInfo.dateOfBirth));
|
|
|
|
print(dateFormat.parse(registerInfo.dateOfBirth));
|
|
|
|
var hDate = new HijriCalendar.fromDate(dateFormat.parse(registerInfo.dateOfBirth));
|
|
|
|
var hDate =
|
|
|
|
|
|
|
|
new HijriCalendar.fromDate(dateFormat.parse(registerInfo.dateOfBirth));
|
|
|
|
var date = hDate.toString();
|
|
|
|
var date = hDate.toString();
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
"Patientobject": {
|
|
|
|
"Patientobject": {
|
|
|
|
"TempValue": true,
|
|
|
|
"TempValue": true,
|
|
|
|
"PatientIdentificationType": registerInfo.idNumber.substring(0, 1) == "1" ? 1 : 2,
|
|
|
|
"PatientIdentificationType":
|
|
|
|
|
|
|
|
registerInfo.idNumber.substring(0, 1) == "1" ? 1 : 2,
|
|
|
|
"PatientIdentificationNo": registerInfo.idNumber,
|
|
|
|
"PatientIdentificationNo": registerInfo.idNumber,
|
|
|
|
"MobileNumber": registerd_data.patientMobileNumber,
|
|
|
|
"MobileNumber": registerd_data.patientMobileNumber,
|
|
|
|
"PatientOutSA": (registerd_data.zipCode == '966' || registerd_data.zipCode == '+966') ? 0 : 1,
|
|
|
|
"PatientOutSA": (registerd_data.zipCode == '966' ||
|
|
|
|
|
|
|
|
registerd_data.zipCode == '+966')
|
|
|
|
|
|
|
|
? 0
|
|
|
|
|
|
|
|
: 1,
|
|
|
|
"FirstNameN": registerInfo.firstNameAr,
|
|
|
|
"FirstNameN": registerInfo.firstNameAr,
|
|
|
|
"FirstName": registerInfo.firstNameEn,
|
|
|
|
"FirstName": registerInfo.firstNameEn,
|
|
|
|
"MiddleNameN": registerInfo.secondNameAr,
|
|
|
|
"MiddleNameN": registerInfo.secondNameAr,
|
|
|
|
@ -405,8 +721,9 @@ class _RegisterInfo extends State<RegisterInfo> {
|
|
|
|
"LastNameN": registerInfo.lastNameAr,
|
|
|
|
"LastNameN": registerInfo.lastNameAr,
|
|
|
|
"LastName": registerInfo.lastNameEn,
|
|
|
|
"LastName": registerInfo.lastNameEn,
|
|
|
|
"StrDateofBirth": registerInfo.dateOfBirth,
|
|
|
|
"StrDateofBirth": registerInfo.dateOfBirth,
|
|
|
|
"DateofBirth": DateUtil.convertISODateToJsonDate(registerInfo.dateOfBirth.replaceAll('/', '-')),
|
|
|
|
"DateofBirth": DateUtil.convertISODateToJsonDate(
|
|
|
|
"Gender": registerInfo.gender == 'M' ? 1 : 2,
|
|
|
|
registerInfo.dateOfBirth.replaceAll('/', '-')),
|
|
|
|
|
|
|
|
"Gender": registerInfo.gender== 'M' ? 1 : 2,
|
|
|
|
"NationalityID": registerInfo.nationalityCode,
|
|
|
|
"NationalityID": registerInfo.nationalityCode,
|
|
|
|
"eHealthIDField": registerInfo.healthId,
|
|
|
|
"eHealthIDField": registerInfo.healthId,
|
|
|
|
"DateofBirthN": date,
|
|
|
|
"DateofBirthN": date,
|
|
|
|
@ -420,12 +737,72 @@ class _RegisterInfo extends State<RegisterInfo> {
|
|
|
|
: '2',
|
|
|
|
: '2',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"PatientIdentificationID": registerInfo.idNumber,
|
|
|
|
"PatientIdentificationID": registerInfo.idNumber,
|
|
|
|
"PatientMobileNumber": registerd_data.patientMobileNumber.toString()[0] == '0' ? registerd_data.patientMobileNumber : '0' + registerd_data.patientMobileNumber.toString(),
|
|
|
|
"PatientMobileNumber":
|
|
|
|
|
|
|
|
registerd_data.patientMobileNumber.toString()[0] == '0'
|
|
|
|
|
|
|
|
? registerd_data.patientMobileNumber
|
|
|
|
|
|
|
|
: '0' + registerd_data.patientMobileNumber.toString(),
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getTempUserRequestDubai(){
|
|
|
|
|
|
|
|
DateFormat dateFormat = DateFormat("mm/dd/yyyy");
|
|
|
|
|
|
|
|
registerInfo= projectViewModel.registerInfo;
|
|
|
|
|
|
|
|
print(dateFormat.parse(registerd_data.dob));
|
|
|
|
|
|
|
|
var hDate =
|
|
|
|
|
|
|
|
new HijriCalendar.fromDate(dateFormat.parse(registerd_data.dob));
|
|
|
|
|
|
|
|
var date = hDate.toString();
|
|
|
|
|
|
|
|
final DateFormat dateFormat1 = DateFormat('MM/dd/yyyy');
|
|
|
|
|
|
|
|
final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
"Patientobject": {
|
|
|
|
|
|
|
|
"TempValue": true,
|
|
|
|
|
|
|
|
"PatientIdentificationType":
|
|
|
|
|
|
|
|
registerd_data.patientIdentificationID.substring(0, 1) == "1" ? 1 : 2,
|
|
|
|
|
|
|
|
"PatientIdentificationNo": registerd_data.patientIdentificationID,
|
|
|
|
|
|
|
|
"MobileNumber": registerd_data.patientMobileNumber,
|
|
|
|
|
|
|
|
"PatientOutSA": (registerd_data.zipCode == '966' ||
|
|
|
|
|
|
|
|
registerd_data.zipCode == '+966')
|
|
|
|
|
|
|
|
? 0
|
|
|
|
|
|
|
|
: 1,
|
|
|
|
|
|
|
|
"FirstNameN": registerInfo.firstNameAr ??"",
|
|
|
|
|
|
|
|
"FirstName": registerInfo.firstNameEn??"",
|
|
|
|
|
|
|
|
"MiddleNameN": registerInfo.secondNameAr?? "",
|
|
|
|
|
|
|
|
"MiddleName": registerInfo.secondNameEn ??"",
|
|
|
|
|
|
|
|
"LastNameN": registerInfo.lastNameAr ??"",
|
|
|
|
|
|
|
|
"LastName":registerInfo.lastNameEn ??"",
|
|
|
|
|
|
|
|
"StrDateofBirth": dateFormat1.format(
|
|
|
|
|
|
|
|
dateFormat2.parse(registerd_data.dob)),
|
|
|
|
|
|
|
|
"DateofBirth": DateUtil.convertISODateToJsonDate(
|
|
|
|
|
|
|
|
registerd_data.dob.replaceAll('/', '-')),
|
|
|
|
|
|
|
|
"Gender": registerInfo.gender== 'M' ? 1 : 2,
|
|
|
|
|
|
|
|
"NationalityID": registerInfo.nationalityCode,
|
|
|
|
|
|
|
|
"eHealthIDField":null,
|
|
|
|
|
|
|
|
"DateofBirthN": date,
|
|
|
|
|
|
|
|
"EmailAddress": email,
|
|
|
|
|
|
|
|
"SourceType": location,
|
|
|
|
|
|
|
|
"PreferredLanguage": registerd_data.languageID.toString(),
|
|
|
|
|
|
|
|
"Marital": registerInfo.maritalStatusCode == 'U'
|
|
|
|
|
|
|
|
? '0'
|
|
|
|
|
|
|
|
: registerInfo.maritalStatusCode == 'M'
|
|
|
|
|
|
|
|
? '1'
|
|
|
|
|
|
|
|
: '2',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
"PatientIdentificationID": registerd_data.patientIdentificationID,
|
|
|
|
|
|
|
|
"PatientMobileNumber":
|
|
|
|
|
|
|
|
registerd_data.patientMobileNumber.toString()[0] == '0'
|
|
|
|
|
|
|
|
? registerd_data.patientMobileNumber
|
|
|
|
|
|
|
|
: '0' + registerd_data.patientMobileNumber.toString(),
|
|
|
|
|
|
|
|
"DOB":registerd_data.dob,
|
|
|
|
|
|
|
|
"IsHijri":registerd_data.isHijri
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool isValid() {
|
|
|
|
bool isValid() {
|
|
|
|
if (location != null && language != null && Utils.validEmail(email) == true) {
|
|
|
|
if ((location != null &&
|
|
|
|
|
|
|
|
language != null &&
|
|
|
|
|
|
|
|
Utils.validEmail(email) == true) || (registerInfo.firstNameEn !=null && registerInfo.secondNameEn !=null && registerInfo.lastNameEn !=null)) {
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
@ -436,6 +813,8 @@ class _RegisterInfo extends State<RegisterInfo> {
|
|
|
|
return Row(
|
|
|
|
return Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: Padding(
|
|
|
|
|
|
|
|
padding: EdgeInsets.only(left: 5, right: 5),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
@ -447,17 +826,21 @@ class _RegisterInfo extends State<RegisterInfo> {
|
|
|
|
letterSpacing: -0.44,
|
|
|
|
letterSpacing: -0.44,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
value1 is String
|
|
|
|
|
|
|
|
? Text(
|
|
|
|
value1,
|
|
|
|
value1,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 12,
|
|
|
|
fontSize: 12,
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
letterSpacing: -0.44,
|
|
|
|
letterSpacing: -0.44,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
|
|
|
: value1,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
))),
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: Padding(
|
|
|
|
|
|
|
|
padding: EdgeInsets.only(left: 5, right: 5),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
@ -469,16 +852,18 @@ class _RegisterInfo extends State<RegisterInfo> {
|
|
|
|
letterSpacing: -0.44,
|
|
|
|
letterSpacing: -0.44,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
value2 is String
|
|
|
|
|
|
|
|
? Text(
|
|
|
|
value2,
|
|
|
|
value2,
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 12,
|
|
|
|
fontSize: 12,
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
letterSpacing: -0.44,
|
|
|
|
letterSpacing: -0.44,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
|
|
|
: value2,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
))
|
|
|
|
)))
|
|
|
|
],
|
|
|
|
],
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -494,7 +879,10 @@ class _RegisterInfo extends State<RegisterInfo> {
|
|
|
|
|
|
|
|
|
|
|
|
insertIMEI() async {
|
|
|
|
insertIMEI() async {
|
|
|
|
var selectedOption = await sharedPref.getInt(LAST_LOGIN);
|
|
|
|
var selectedOption = await sharedPref.getInt(LAST_LOGIN);
|
|
|
|
authService.insertDeviceImei(selectedOption).then((value) => {goToHome()}).catchError((err) {
|
|
|
|
authService
|
|
|
|
|
|
|
|
.insertDeviceImei(selectedOption)
|
|
|
|
|
|
|
|
.then((value) => {goToHome()})
|
|
|
|
|
|
|
|
.catchError((err) {
|
|
|
|
print(err);
|
|
|
|
print(err);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -507,7 +895,8 @@ class _RegisterInfo extends State<RegisterInfo> {
|
|
|
|
await authenticatedUserObject.getUser(getUser: true);
|
|
|
|
await authenticatedUserObject.getUser(getUser: true);
|
|
|
|
appointmentRateViewModel
|
|
|
|
appointmentRateViewModel
|
|
|
|
.getIsLastAppointmentRatedList()
|
|
|
|
.getIsLastAppointmentRatedList()
|
|
|
|
.then((value) => {
|
|
|
|
.then((value) =>
|
|
|
|
|
|
|
|
{
|
|
|
|
getToDoCount(),
|
|
|
|
getToDoCount(),
|
|
|
|
GifLoaderDialogUtils.hideDialog(AppGlobal.context),
|
|
|
|
GifLoaderDialogUtils.hideDialog(AppGlobal.context),
|
|
|
|
if (appointmentRateViewModel.isHaveAppointmentNotRate)
|
|
|
|
if (appointmentRateViewModel.isHaveAppointmentNotRate)
|
|
|
|
@ -547,8 +936,114 @@ class _RegisterInfo extends State<RegisterInfo> {
|
|
|
|
print(err);
|
|
|
|
print(err);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getCountries() {
|
|
|
|
|
|
|
|
ClinicListService service = new ClinicListService();
|
|
|
|
|
|
|
|
service.getCountries().then((res) {
|
|
|
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
res['ListNationality'].forEach((items) => {
|
|
|
|
|
|
|
|
countriesList.add(CountriesLists.fromJson(items))
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setState(() {});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
|
|
|
print(err);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Widget inputWidget(String _labelText, String _hintText, String name, {String prefix, bool isEnable = true, bool hasSelection = false}) {
|
|
|
|
|
|
|
|
return Container(
|
|
|
|
|
|
|
|
padding: EdgeInsets.only(left: 10, right: 10, bottom: 5, top: 5),
|
|
|
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(15),
|
|
|
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
|
|
border: Border.all(
|
|
|
|
|
|
|
|
color: Color(0xffefefef),
|
|
|
|
|
|
|
|
width: 1,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
child: InkWell(
|
|
|
|
|
|
|
|
onTap: hasSelection ? () {} : null,
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
_labelText,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontSize: 11,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
|
|
|
color: Color(0xff2B353E),
|
|
|
|
|
|
|
|
letterSpacing: -0.44,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
TextField(
|
|
|
|
|
|
|
|
enabled: isEnable,
|
|
|
|
|
|
|
|
scrollPadding: EdgeInsets.zero,
|
|
|
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
|
|
|
// controller: _controller,
|
|
|
|
|
|
|
|
onChanged: (value) => {
|
|
|
|
|
|
|
|
setState((){
|
|
|
|
|
|
|
|
switch(name) {
|
|
|
|
|
|
|
|
case 'fName':
|
|
|
|
|
|
|
|
registerInfo.firstNameEn = registerInfo.firstNameAr = value;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'sName':
|
|
|
|
|
|
|
|
registerInfo.secondNameEn = registerInfo.secondNameAr = value;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'lName':
|
|
|
|
|
|
|
|
registerInfo.lastNameEn = registerInfo.lastNameAr = value;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
//_controller.text =value
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
|
|
|
height: 21 / 14,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
|
|
|
color: Color(0xff2B353E),
|
|
|
|
|
|
|
|
letterSpacing: -0.44,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
decoration: InputDecoration(
|
|
|
|
|
|
|
|
isDense: true,
|
|
|
|
|
|
|
|
hintText: _hintText,
|
|
|
|
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
|
|
|
height: 21 / 14,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
|
|
|
color: Color(0xff575757),
|
|
|
|
|
|
|
|
letterSpacing: -0.56,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
prefixIconConstraints: BoxConstraints(minWidth: 50),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
|
|
|
|
border: InputBorder.none,
|
|
|
|
|
|
|
|
focusedBorder: InputBorder.none,
|
|
|
|
|
|
|
|
enabledBorder: InputBorder.none,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Language {
|
|
|
|
class Language {
|
|
|
|
final String name;
|
|
|
|
final String name;
|
|
|
|
final String value;
|
|
|
|
final String value;
|
|
|
|
|