bug fixes

merge-requests/305/head
Sultan Khan 5 years ago
parent 8e255f1f22
commit 3d6858d0ec

@ -186,10 +186,7 @@ const Map localizedValues = {
"fileNo": {"en": "File Number", "ar": "رقم الملف"},
"fileno": {"en": "File No", "ar": "رقم الملف"},
"forgotFileNo": {"en": "Forgot file Number?", "ar": "نسيت رقم الملف الطبي؟"},
"forgotFileNoTitle": {
"en": "Forgot medical file Number",
"ar": "نسيت رقم الملف"
},
"forgotFileNoTitle": {"en": "Forgot medical file", "ar": "نسيت رقم الملف"},
"enter-national-id": {
"en": "Please enter mobile number and identification number",

File diff suppressed because it is too large Load Diff

@ -461,23 +461,27 @@ class _HomePageState extends State<HomePage> {
],
),
Padding(
padding: const EdgeInsets.only(bottom: 15, right: 15, left: 15),
padding:
const EdgeInsets.only(bottom: 15, right: 15, left: 15),
child: InkWell(
onTap: (){
Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesHomePage()));
onTap: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => PackagesHomePage()));
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Color(0xffB8382C),
borderRadius: BorderRadius.circular(10),
color: Color(0xffB8382C),
),
child: Padding(
padding: const EdgeInsets.all(8),
child: Row(
children: [
Texts(
TranslationBase.of(context).offerAndPackages,
color: Colors.white, fontSize: 20, fontWeight: FontWeight.normal,
TranslationBase.of(context).offerAndPackages,
color: Colors.white,
fontSize: 20,
fontWeight: FontWeight.normal,
),
Spacer(),
Image.asset("assets/images/offer_icon.png"),
@ -833,7 +837,7 @@ class _HomePageState extends State<HomePage> {
}
getPharmacyToken(DashboardViewModel model) async {
if(!model.isLogin) {
if (!model.isLogin) {
Navigator.push(context, FadePage(page: LandingPagePharmacy()));
} else {
GifLoaderDialogUtils.showMyDialog(context);

@ -543,7 +543,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
children: [
HomePage(
goToMyProfile: () {
_changeCurrentTab(0);
_changeCurrentTab(1);
},
),
MedicalProfilePage(),

@ -21,7 +21,7 @@ class _ForgotPassword extends State<ForgotPassword> {
String selectedType = 'Saudi Arabia';
String countryCode = '966';
final TextEditingController nationalIDorFile = null;
String mobileNo;
String mobileNo = "";
var con;
@override
Widget build(BuildContext context) {
@ -53,9 +53,15 @@ class _ForgotPassword extends State<ForgotPassword> {
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[],
),
MobileNo(
onNumberChange: (value) => {mobileNo = value},
onCountryChange: (value) => countryCode = value),
MobileNo(onNumberChange: (value) {
setState(() {
mobileNo = value;
});
}, onCountryChange: (value) {
setState(() {
countryCode = value;
});
}),
],
),
),
@ -73,6 +79,10 @@ class _ForgotPassword extends State<ForgotPassword> {
sendPatientIDBySMS();
// print(mobileNo.text);
},
color: mobileNo.length >= 9 == true
? Colors.grey[900]
: Colors.grey,
textColor: Colors.white,
)),
],
),
@ -85,7 +95,7 @@ class _ForgotPassword extends State<ForgotPassword> {
sendPatientIDBySMS() {
GifLoaderDialogUtils.showMyDialog(context);
final authService = new AuthProvider();
authService.sendPatientIDSMS(mobileNo, context).then((res) {
authService.sendPatientIDSMS(mobileNo, countryCode, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
this.startSMSService(mobileNo, res['LogInTokenID']);

@ -376,26 +376,16 @@ class AuthProvider with ChangeNotifier {
}
}
Future<Map> sendPatientIDSMS(mobileNo, context) async {
Future<Map> sendPatientIDSMS(mobileNo, zipCode, context) async {
Map<String, dynamic> request;
// var languageID =
// await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
// "LanguageID": languageID == 'ar' ? 1 : 2,
// "IPAdress": "10.20.10.20",
// "VersionID": req.VersionID,
// "Channel": req.Channel,
// "generalid": 'Cs2020@2016\$2958',
// "PatientOutSA": 0,
// "PatientID": 0,
// "TokenID": "",
"PatientOutSA": zipCode == '+966' ? 0 : 1,
"PatientMobileNumber": mobileNo,
"SearchType": 2,
// "ZipCode": "966",
// "PatientIdentificationID": "",
"ZipCode": zipCode,
"DeviceTypeID": req.DeviceTypeID,
// "SessionID": null
};
dynamic localRes;

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/mobile_number.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
@ -13,12 +14,13 @@ class MobileNo extends StatefulWidget {
final bool disabled;
// final String data;
final List<Countries> countries = [
new Countries( name: "Saudi Arabia",
name_ar:"المملكة العربية السعودية", code: '966' ),
new Countries(name: "United Arab Emirates",
name_ar:"الإمارات العربية المتحدة", code: '971'),
];
// final List<Countries> countries = [
// new Countries( name: "Saudi Arabia",
// name_ar:"المملكة العربية السعودية", code: '966' ),
// new Countries(name: "United Arab Emirates",
// name_ar:"الإمارات العربية المتحدة", code: '971'),
// ];
final double margin;
final double marginTop;
final double marginRight;
@ -44,9 +46,18 @@ class MobileNo extends StatefulWidget {
}
class _MobileNo extends State<MobileNo> {
var _selectedType = '966';
String countryCode = '966';
var _selectedType = '+966';
String countryCode = '+966';
List<Countries> counties = [];
ProjectViewModel projectProvider;
@override
void initState() {
countriesData.forEach((element) {
this.counties.add(Countries.fromJson(element));
});
super.initState();
}
@override
Widget build(BuildContext context) {
projectProvider = Provider.of(context);
@ -83,11 +94,13 @@ class _MobileNo extends State<MobileNo> {
_selectedType = value;
})
},
items: widget.countries
.map<DropdownMenuItem<String>>((Countries value) {
items: counties.map<DropdownMenuItem<String>>(
(Countries value) {
return DropdownMenuItem<String>(
value: value.code,
child: Text(projectProvider.isArabic == true ? value.name_ar : value.name),
child: Text(projectProvider.isArabic == true
? value
: value.name),
);
}).toList())))),
),
@ -125,12 +138,17 @@ class _MobileNo extends State<MobileNo> {
child: TextField(
controller: widget.controller,
keyboardType: TextInputType.phone,
maxLength: 10,
// maxLengthEnforced: true,
// onChanged: (value) {
// widget.controller.text = countryCode;
// },
onChanged: (value) => widget.onNumberChange(value),
decoration: InputDecoration(
border: InputBorder.none, hintText: '5xxxxxxxx'),
counterText: "",
border: InputBorder.none,
hintText: '5xxxxxxxx'),
),
),
)
@ -140,10 +158,10 @@ class _MobileNo extends State<MobileNo> {
}
}
class Countries {
final String name;
final String name_ar;
final String code;
// class Countries {
// final String name;
// final String name_ar;
// final String code;
Countries({this.name, this.name_ar, this.code});
}
// Countries({this.name, this.name_ar, this.code});
// }

Loading…
Cancel
Save