bug fixes

merge-update-with-lab-changes
Sultan Khan 5 years ago
parent 8e255f1f22
commit 3d6858d0ec

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

File diff suppressed because it is too large Load Diff

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

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

@ -21,7 +21,7 @@ class _ForgotPassword extends State<ForgotPassword> {
String selectedType = 'Saudi Arabia'; String selectedType = 'Saudi Arabia';
String countryCode = '966'; String countryCode = '966';
final TextEditingController nationalIDorFile = null; final TextEditingController nationalIDorFile = null;
String mobileNo; String mobileNo = "";
var con; var con;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -53,9 +53,15 @@ class _ForgotPassword extends State<ForgotPassword> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[], children: <Widget>[],
), ),
MobileNo( MobileNo(onNumberChange: (value) {
onNumberChange: (value) => {mobileNo = value}, setState(() {
onCountryChange: (value) => countryCode = value), mobileNo = value;
});
}, onCountryChange: (value) {
setState(() {
countryCode = value;
});
}),
], ],
), ),
), ),
@ -73,6 +79,10 @@ class _ForgotPassword extends State<ForgotPassword> {
sendPatientIDBySMS(); sendPatientIDBySMS();
// print(mobileNo.text); // 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() { sendPatientIDBySMS() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
final authService = new AuthProvider(); final authService = new AuthProvider();
authService.sendPatientIDSMS(mobileNo, context).then((res) { authService.sendPatientIDSMS(mobileNo, countryCode, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
this.startSMSService(mobileNo, res['LogInTokenID']); 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; Map<String, dynamic> request;
// var languageID =
// await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
// "LanguageID": languageID == 'ar' ? 1 : 2, "PatientOutSA": zipCode == '+966' ? 0 : 1,
// "IPAdress": "10.20.10.20",
// "VersionID": req.VersionID,
// "Channel": req.Channel,
// "generalid": 'Cs2020@2016\$2958',
// "PatientOutSA": 0,
// "PatientID": 0,
// "TokenID": "",
"PatientMobileNumber": mobileNo, "PatientMobileNumber": mobileNo,
"SearchType": 2, "SearchType": 2,
// "ZipCode": "966", "ZipCode": zipCode,
// "PatientIdentificationID": "",
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
// "SessionID": null
}; };
dynamic localRes; dynamic localRes;

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

Loading…
Cancel
Save