Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into hijri_calender

 Conflicts:
	lib/screens/patients/register_patient/RegisterSearchPatientPage.dart
merge-requests/883/head
Elham Rababh 4 years ago
commit 0bdb15b14e

@ -24,14 +24,14 @@ class ProfileReqModel {
{this.projectID,
this.clinicID,
this.doctorID,
this.isRegistered =true,
this.isRegistered = true,
this.license,
this.languageID,
this.stamp = '2020-04-26T09:32:18.317Z',
this.iPAdress='11.11.11.11',
this.iPAdress = '11.11.11.11',
// this.versionID=5.5,
this.channel=9,
this.sessionID='E2bsEeYEJo',
this.channel = 9,
this.sessionID = 'E2bsEeYEJo',
this.tokenID,
this.isLoginForDoctorApp = true});

@ -53,6 +53,7 @@ class _RegisterPatientPageState extends State<RegisterPatientPage>
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
///TODO Elham* Add Translation
return BaseView<PatientRegistrationViewModel>(
builder: (_, model, w) => AppScaffold(

@ -18,6 +18,7 @@ import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dar
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/country_textfield_custom.dart';
import 'package:flutter/material.dart';
import 'package:hijri/hijri_calendar.dart';
import 'package:hijri_picker/hijri_picker.dart';
@ -40,6 +41,11 @@ class RegisterSearchPatientPage extends StatefulWidget {
class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
String countryError;
dynamic _selectedCountry;
List<dynamic> countryList;
dynamic country;
bool isSubmitted = false;
TextEditingController _phoneController =
@ -57,6 +63,18 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
var birthDateInHijri = new HijriCalendar.now();
CalenderType calenderType = CalenderType.Gregorian;
@override
void initState() {
_phoneCode.text = "";
countryList = List();
dynamic ksaCountry = {"id": 967, "name": "Saudi Arabia"};
dynamic uaeCountry = {"id": 971, "name": "United Arab Emirates"};
countryList.add(ksaCountry);
countryList.add(uaeCountry);
}
@override
Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
@ -85,15 +103,19 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
SizedBox(
height: 10,
),
AppTextFieldCustom(
height: screenSize.height * 0.075,
CountryTextField(
elementList: countryList,
element: country,
elementError: countryError,
keyName: 'name',
keyId: 'id',
okFunction: (selectedValue) {
setState(() {
country = selectedValue;
_phoneCode.text = selectedValue['id'].toString();
});
},
hintText: "Country",
isTextFieldHasSuffix: true,
validationError: countryError,
dropDownText: _selectedCountry != null
? _selectedCountry['nameEn']
: "Saudi Arabia",
enabled: false,
),
SizedBox(
height: 10,
@ -110,6 +132,7 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
inputType: TextInputType.phone,
controller: _phoneCode,
validationError: phoneError,
enabled: false,
),
),
if (_phoneController.text.isEmpty && isSubmitted)
@ -283,6 +306,11 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
setState(() {
isSubmitted = true;
});
if (country == null) {
countryError = TranslationBase.of(context).fieldRequired;
} else {
countryError = null;
}
if (isFormValid()) {
GifLoaderDialogUtils.showMyDialog(context);
CheckPatientForRegistrationModel
@ -306,8 +334,8 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
GetPatientInfoRequestModel getPatientInfoRequestModel =
GetPatientInfoRequestModel(
//TODO Elham* this return the static to dynamic
patientIdentificationID: "1062938285",
//_idController.text,
//patientIdentificationID: "1062938285",
_idController.text,
isHijri: 0,
isDentalAllowedBackend: false,
patientOutSA: 0,

@ -105,27 +105,33 @@ class _ActivationPageState extends State<ActivationPage> {
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,
Padding(
padding: EdgeInsets.symmetric(
horizontal: 10),
child: 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,
Center(
child: AppText(
"Verify through SMS",
fontSize: 14,
color: Color(0xFF2E303A),
fontWeight: FontWeight.bold,
),
)
],
),
@ -155,27 +161,33 @@ class _ActivationPageState extends State<ActivationPage> {
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,
Padding(
padding: EdgeInsets.symmetric(
horizontal: 10.0),
child: 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,
Center(
child: AppText(
"Verify through WhatsApp",
fontSize: 14,
color: Color(0xFF2E303A),
fontWeight: FontWeight.bold,
),
)
],
),
@ -445,11 +457,12 @@ class _ActivationPageState extends State<ActivationPage> {
fontSize: 2.0,
onPressed: () async {
GifLoaderDialogUtils.showMyDialog(context);
await widget.model.checkActivationCode("${digit1.text}${digit2.text}${digit3.text}${digit4.text}");
await widget.model.checkActivationCode(
"${digit1.text}${digit2.text}${digit3.text}${digit4.text}");
if (widget.model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(widget.model.error);
//TODO Elham* remove this
widget.changePageViewIndex(2);
//widget.changePageViewIndex(2);
GifLoaderDialogUtils.hideDialog(context);
} else {
GifLoaderDialogUtils.hideDialog(context);
@ -473,7 +486,10 @@ class _ActivationPageState extends State<ActivationPage> {
Helpers.showErrorToast(widget.model.error);
GifLoaderDialogUtils.hideDialog(context);
// TODO Elham* retuen the else
// } else {
setState(() {
isSendOtp = false;
});
} else {
setState(() {
isSendOtp = true;
});

@ -0,0 +1,77 @@
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class CountryTextField extends StatefulWidget {
final dynamic element;
final String elementError;
final List<dynamic> elementList;
final String keyName;
final String keyId;
final String hintText;
final double width;
final Function(dynamic) okFunction;
CountryTextField(
{Key key,
@required this.element,
@required this.elementError,
this.width,
this.elementList,
this.keyName,
this.keyId,
this.hintText,
this.okFunction})
: super(key: key);
@override
_CountryTextfieldState createState() => _CountryTextfieldState();
}
class _CountryTextfieldState extends State<CountryTextField> {
@override
Widget build(BuildContext context) {
return Container(
width: widget.width ?? null,
child: InkWell(
onTap: widget.elementList != null
? () {
Helpers.hideKeyboard(context);
ListSelectDialog dialog = ListSelectDialog(
list: widget.elementList,
attributeName: '${widget.keyName}',
attributeValueId: widget.elementList.length == 1
? widget.elementList[0]['${widget.keyId}']
: '${widget.keyId}',
okText: TranslationBase.of(context).ok,
okFunction: (selectedValue) =>
widget.okFunction(selectedValue),
);
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return dialog;
},
);
}
: null,
child: AppTextFieldCustom(
hintText: widget.hintText,
dropDownText: widget.elementList.length == 1
? widget.elementList[0]['${widget.keyName}']
: widget.element != null
? widget.element['${widget.keyName}']
: null,
isTextFieldHasSuffix: true,
validationError:
widget.elementList.length != 1 ? widget.elementError : null,
enabled: false,
),
),
);
}
}
Loading…
Cancel
Save