Merge branch 'development_v2.5' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into fatima_v2

merge-requests/580/head
Fatimah Alshammari 4 years ago
commit f83adbc6ff

@ -33,7 +33,7 @@ class NavObserver extends RouteObserver<PageRoute<dynamic>> {
screenName: event.flutterName(), screenClassOverride: className) screenName: event.flutterName(), screenClassOverride: className)
.catchError( .catchError(
(Object error) { (Object error) {
debugPrint('$FirebaseAnalyticsObserver: $error'); print('$FirebaseAnalyticsObserver: $error');
}, },
test: (Object error) { test: (Object error) {
return error is PlatformException; return error is PlatformException;

@ -15,8 +15,8 @@ const PACKAGES_CUSTOMER = '/api/customers';
const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders'; const PACKAGES_ORDERS = '/api/orders';
const PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; const PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// const BASE_URL = 'https://uat.hmgwebservices.com/'; const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
// const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';

@ -811,7 +811,7 @@ const Map localizedValues = {
"HealthTipsBasedOnCurrentWeather": {"en": "Health Tips Based On Current Weather", 'ar': ' نصائح صحية بناءاً على الطقس الحالي '}, "HealthTipsBasedOnCurrentWeather": {"en": "Health Tips Based On Current Weather", 'ar': ' نصائح صحية بناءاً على الطقس الحالي '},
"MoreDetails": {"en": "More details", "ar": " المزيد من التفاصيل "}, "MoreDetails": {"en": "More details", "ar": " المزيد من التفاصيل "},
"SendCopy": {"en": "Send Copy", "ar": "ارسال نسخة"}, "SendCopy": {"en": "Send Copy", "ar": "ارسال نسخة"},
"ResendOrder": {"en": "Re-Order & Delivery", "ar": "إعادة طلب و توصيل"}, "ResendOrder": {"en": "Refill & Delivery", "ar": "إعادة صرف وتوصيل"},
"Ports": {"en": "Ports", "ar": "المنافذ"}, "Ports": {"en": "Ports", "ar": "المنافذ"},
"Way": {"en": "Way", "ar": "الطريقة"}, "Way": {"en": "Way", "ar": "الطريقة"},
"Average": {"en": "Average", "ar": "متوسط"}, "Average": {"en": "Average", "ar": "متوسط"},
@ -1572,7 +1572,7 @@ const Map localizedValues = {
"modesBelow": {"en": "Please select the modes below:", "ar": ":الرجاء تحديد الأوضاع أدناه"}, "modesBelow": {"en": "Please select the modes below:", "ar": ":الرجاء تحديد الأوضاع أدناه"},
"prefferedMode": {"en": "Please select the preferred mode below:", "ar": ":الرجاء تحديد الوضع المفضل أدناه"}, "prefferedMode": {"en": "Please select the preferred mode below:", "ar": ":الرجاء تحديد الوضع المفضل أدناه"},
"permissionsBellow": {"en": "Please allow the permissions below:", "ar": ":الرجاء السماح الأذونات أدناه"}, "permissionsBellow": {"en": "Please allow the permissions below:", "ar": ":الرجاء السماح الأذونات أدناه"},
"appointmentReminder": {"en": "Would you like to set a reminder for this appointment in your calendar?", "ar": "هل ترغب في اضافة تذكير لهذا الموعد في التقويم؟"}, "appointmentReminder": {"en": "Would you like to set a reminder for this in your calendar?", "ar": "هل ترغب في اضافة تذكير لهذا في التقويم؟"},
"cancelAppointment": {"en": "Cancel Appt.", "ar": "الغاء الموعد"}, "cancelAppointment": {"en": "Cancel Appt.", "ar": "الغاء الموعد"},
"updateInsurCards": {"en": "Update Insurance Cards", "ar": "تحديث بطاقات التأمين"}, "updateInsurCards": {"en": "Update Insurance Cards", "ar": "تحديث بطاقات التأمين"},
"patientAge": {"en": "y", "ar": "سنة"}, "patientAge": {"en": "y", "ar": "سنة"},

@ -1,11 +1,11 @@
import 'PointsAmountPerday.dart'; import 'PointsAmountPerday.dart';
class PointsAmountPerMonth { class PointsAmountPerMonth {
dynamic amountPerMonth; num amountPerMonth;
dynamic month; String month;
int monthNumber; num monthNumber;
List<PointsAmountPerday> pointsAmountPerday; List<PointsAmountPerday> pointsAmountPerday;
dynamic pointsPerMonth; num pointsPerMonth;
PointsAmountPerMonth( PointsAmountPerMonth(
{this.amountPerMonth, {this.amountPerMonth,

@ -20,8 +20,6 @@ class AncillaryOrdersService extends BaseService {
_ancillaryLists = []; _ancillaryLists = [];
response['AncillaryOrderList'].forEach((item) { response['AncillaryOrderList'].forEach((item) {
ancillaryLists.add(AncillaryOrdersListModel.fromJson(item)); ancillaryLists.add(AncillaryOrdersListModel.fromJson(item));
print("response of ancillary Lists__________");
print(response);
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -34,7 +32,6 @@ class AncillaryOrdersService extends BaseService {
body['AppointmentNo_Vida'] = appointmentNo; body['AppointmentNo_Vida'] = appointmentNo;
body['OrderNo'] = orderNo; body['OrderNo'] = orderNo;
body['ProjectID'] = projectID; body['ProjectID'] = projectID;
// "OrderNo=$orderNo&AppointmentNo_Vida=$appointmentNo&ProjectID=$projectID"
hasError = false; hasError = false;
await baseAppClient.post(GET_ANCILLARY_ORDERS_DETAILS, await baseAppClient.post(GET_ANCILLARY_ORDERS_DETAILS,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
@ -42,12 +39,7 @@ class AncillaryOrdersService extends BaseService {
response['AncillaryOrderProcList'].forEach((item) { response['AncillaryOrderProcList'].forEach((item) {
ancillaryProcLists.add(AncillaryOrdersListProcListModel.fromJson(item)); ancillaryProcLists.add(AncillaryOrdersListProcListModel.fromJson(item));
// ancillaryProcLists.add(AncillaryOrdersListProcListModel.fromJson(response['AncillaryOrderProcList']));
print("----------------------------------");
print("Test data");
print(response);
}); });
//Future.value(_ancillaryProcLists);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -122,11 +122,15 @@ class BaseAppClient {
} }
} }
// body['IdentificationNo'] = 1009199553; // body['IdentificationNo'] = 2076117163;
// body['MobileNo'] = "966545156035"; // body['MobileNo'] = "966503109207";
// body['PatientID'] = 1018977; //3844083 // body['PatientID'] = 2478442; //3844083
// body['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";
// Patient ID: 2478442
// Mobile no.: 0503109207
// ID: 2076117163
body.removeWhere((key, value) => key == null || value == null); body.removeWhere((key, value) => key == null || value == null);
print("URL : $url"); print("URL : $url");

@ -88,10 +88,6 @@ class AmService extends BaseService {
pendingAmbulanceRequestOrder = AmbulanceRequestOrdersModel.fromJson(item); pendingAmbulanceRequestOrder = AmbulanceRequestOrdersModel.fromJson(item);
} }
}); });
print(patientAmbulanceRequestOrdersList.length);
print(hasPendingOrder);
print(pendingOrderID);
print(pendingOrderStatus);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
@ -142,10 +138,7 @@ class AmService extends BaseService {
Future insertERPressOrder({@required PatientER_RC patientER}) async { Future insertERPressOrder({@required PatientER_RC patientER}) async {
hasError = false; hasError = false;
var body = patientER.toJson(); var body = patientER.toJson();
print(body);
await baseAppClient.post(INSERT_TRANSPORTATION_ORDER_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { await baseAppClient.post(INSERT_TRANSPORTATION_ORDER_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -8,7 +8,6 @@ import 'package:diplomaticquarterapp/core/model/geofencing/responses/GeoZonesRes
import 'package:diplomaticquarterapp/core/model/geofencing/responses/LogGeoZoneResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/geofencing/responses/LogGeoZoneResponseModel.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
class GeofencingServices extends BaseService { class GeofencingServices extends BaseService {
@ -25,8 +24,6 @@ class GeofencingServices extends BaseService {
geoZones.add(GeoZonesResponseModel().fromJson(json)); geoZones.add(GeoZonesResponseModel().fromJson(json));
}); });
if (kDebugMode || testZones) addTestingGeoZones(zones);
_zonesJsonString = json.encode(zones); _zonesJsonString = json.encode(zones);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -35,13 +32,11 @@ class GeofencingServices extends BaseService {
AppSharedPreferences pref = AppSharedPreferences(); AppSharedPreferences pref = AppSharedPreferences();
await pref.setString(HMG_GEOFENCES, _zonesJsonString); await pref.setString(HMG_GEOFENCES, _zonesJsonString);
debugPrint("Finished Fetching GEO ZONES from HMG service...");
debugPrint("GEO ZONES saved to AppPreferences with key '$HMG_GEOFENCES'");
return geoZones; return geoZones;
} }
LogGeoZoneResponseModel logResponse; LogGeoZoneResponseModel logResponse;
Future<LogGeoZoneResponseModel> logGeoZone(LogGeoZoneRequestModel request) async { Future<LogGeoZoneResponseModel> logGeoZone(LogGeoZoneRequestModel request) async {
hasError = false; hasError = false;
await baseAppClient.post(LOG_GEO_ZONES, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(LOG_GEO_ZONES, onSuccess: (dynamic response, int statusCode) {
@ -52,12 +47,4 @@ class GeofencingServices extends BaseService {
}, body: request.toFlatMap()); }, body: request.toFlatMap());
return logResponse; return logResponse;
} }
addTestingGeoZones(List zones) {
// zones.add({"GEOF_ID": 12, "Description": "ZiK Home", "Latitude": "24.691136", "Longitude": "46.650116", "Radius": 100, "Type": 1});
// zones.add({"GEOF_ID": 13, "Description": "CS Office", "Latitude": "24.7087913", "Longitude": "46.6656461", "Radius": 100, "Type": 1});
// zones.add({"GEOF_ID": 14, "Description": "Mahmoud Shrouf Home", "Latitude": "24.777577", "Longitude": "46.652675", "Radius": 100, "Type": 1});
// zones.add({"GEOF_ID": 14, "Description": "Panorama Mall", "Latitude": "24.692453", "Longitude": "46.669168", "Radius": 450, "Type": 1});
// zones.add({"GEOF_ID": 16, "Description": "Saudi Architects Crossing", "Latitude": "24.698375", "Longitude": "46.668567", "Radius": 140, "Type": 1});
}
} }

@ -99,7 +99,6 @@ class MyBalanceService extends BaseService {
onSuccess: (response, statusCode) async { onSuccess: (response, statusCode) async {
logInTokenID = response['LogInTokenID']; logInTokenID = response['LogInTokenID'];
verificationCode = response['VerificationCode']; verificationCode = response['VerificationCode'];
print(verificationCode);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -23,8 +23,6 @@ class LacumService extends BaseService{
await baseAppClient.post(GET_LACUM_ACCOUNT_INFORMATION, await baseAppClient.post(GET_LACUM_ACCOUNT_INFORMATION,
onSuccess: (response, statusCode) async { onSuccess: (response, statusCode) async {
lacumInformation = LacumAccountInformation.fromJson(response); lacumInformation = LacumAccountInformation.fromJson(response);
print("Test Lacum Account Information");
print(response);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
@ -39,20 +37,14 @@ class LacumService extends BaseService{
super.error = ""; super.error = "";
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
// body['IdentificationNo'] = user.patientIdentificationNo; body['IdentificationNo'] = user.patientIdentificationNo;
// body['AccountNumber'] = "${lacumInformation.yahalaAccountNo}"; body['AccountNumber'] = "${lacumInformation.yahalaAccountNo}";
body['IdentificationNo'] = "2076117163";
body['AccountNumber'] = "2019000006";
body['IsDetailsRequired'] = true; body['IsDetailsRequired'] = true;
try { try {
await baseAppClient.post(GET_LACUM_GROUP_INFORMATION, await baseAppClient.post(GET_LACUM_GROUP_INFORMATION,
onSuccess: (response, statusCode) async { onSuccess: (response, statusCode) async {
lacumGroupInformation = LacumAccountInformation.fromJson(response); lacumGroupInformation = LacumAccountInformation.fromJson(response);
print("Test Lacum Group Information");
print(response);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -28,7 +28,6 @@ class PharmacyModuleService extends BaseService {
await baseAppClient.getPharmacy(PHARMACY_VERIFY_CUSTOMER, onSuccess: (dynamic response, int statusCode) async { await baseAppClient.getPharmacy(PHARMACY_VERIFY_CUSTOMER, onSuccess: (dynamic response, int statusCode) async {
if (response['UserName'] != null) { if (response['UserName'] != null) {
sharedPref.setString(PHARMACY_CUSTOMER_ID, response['CustomerId'].toString()); sharedPref.setString(PHARMACY_CUSTOMER_ID, response['CustomerId'].toString());
print(response);
} else { } else {
await createUser(); await createUser();
} }
@ -57,8 +56,6 @@ class PharmacyModuleService extends BaseService {
if (!response['IsRegistered']) { if (!response['IsRegistered']) {
} else { } else {
customerInfo = CustomerInfo.fromJson(response); customerInfo = CustomerInfo.fromJson(response);
print(response['customerDto']);
print(response['customerDto']['customerGuid']);
await sharedPref.setObject(PHARMACY_CUSTOMER_ID, customerInfo.customerId); await sharedPref.setObject(PHARMACY_CUSTOMER_ID, customerInfo.customerId);
await sharedPref.setObject(PHARMACY_CUSTOMER_GUID, response['customerDto']['customerGuid']); await sharedPref.setObject(PHARMACY_CUSTOMER_GUID, response['customerDto']['customerGuid']);
} }
@ -189,8 +186,6 @@ class PharmacyModuleService extends BaseService {
response['products'].forEach((item) { response['products'].forEach((item) {
mostViewedProducts.add(PharmacyProduct.fromJson(item)); mostViewedProducts.add(PharmacyProduct.fromJson(item));
}); });
// print("most viewed products ---------");
// print(response);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -64,7 +64,6 @@ class _LocationPageState extends State<LocationPage> {
enableMapTypeButton: true, enableMapTypeButton: true,
searchForInitialValue: false, searchForInitialValue: false,
onPlacePicked: (PickResult result) { onPlacePicked: (PickResult result) {
print("onPlacePickedonPlacePickedonPlacePickedonPlacePicked");
print(result.adrAddress); print(result.adrAddress);
}, },
selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) { selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) {
@ -79,8 +78,6 @@ class _LocationPageState extends State<LocationPage> {
child: state == SearchingState.Searching child: state == SearchingState.Searching
? SizedBox(height: 43,child: Center(child: CircularProgressIndicator())).insideContainer ? SizedBox(height: 43,child: Center(child: CircularProgressIndicator())).insideContainer
: DefaultButton(TranslationBase.of(context).addNewAddress, () async { : DefaultButton(TranslationBase.of(context).addNewAddress, () async {
// print();
AddNewAddressRequestModel addNewAddressRequestModel = new AddNewAddressRequestModel( AddNewAddressRequestModel addNewAddressRequestModel = new AddNewAddressRequestModel(
customer: Customer(addresses: [ customer: Customer(addresses: [
Addresses( Addresses(

@ -1,21 +1,26 @@
import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class AnicllaryOrders extends StatefulWidget { class AnicllaryOrders extends StatefulWidget {
@override @override
_AnicllaryOrdersState createState() => _AnicllaryOrdersState(); _AnicllaryOrdersState createState() => _AnicllaryOrdersState();
} }
class _AnicllaryOrdersState extends State<AnicllaryOrders> class _AnicllaryOrdersState extends State<AnicllaryOrders> with SingleTickerProviderStateMixin {
with SingleTickerProviderStateMixin {
TabController _tabController; TabController _tabController;
ProjectViewModel projectViewModel;
void initState() { void initState() {
super.initState(); super.initState();
_tabController = TabController(length: 2, vsync: this); _tabController = TabController(length: 2, vsync: this);
@ -28,58 +33,103 @@ class _AnicllaryOrdersState extends State<AnicllaryOrders>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return BaseView<AnciallryOrdersViewModel>( return BaseView<AnciallryOrdersViewModel>(
onModelReady: (model) => model.getOrders(), onModelReady: (model) => model.getOrders(),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).anicllaryOrders, appBarTitle: TranslationBase.of(context).anicllaryOrders,
body: SingleChildScrollView( body: SingleChildScrollView(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12), child: model.ancillaryLists.length > 0 ? Column(children: [getPatientInfo(model), getAncillaryOrdersList(model)]) : getNoDataWidget(context))));
child: model.ancillaryLists.length > 0
? Column(children: [
getPatientInfo(model),
getAncillaryOrdersList(model)
])
: SizedBox())));
} }
Widget getPatientInfo(AnciallryOrdersViewModel model) { Widget getPatientInfo(AnciallryOrdersViewModel model) {
print(model.ancillaryLists);
return Padding( return Padding(
child: Column( child: Column(
children: [ children: [
Row( Container(
children: [ width: double.infinity,
Texts( child: Container(
TranslationBase.of(context).mrn, decoration: cardRadius(12),
fontWeight: FontWeight.bold, margin: EdgeInsets.zero,
fontSize: 22, child: Padding(
), padding: const EdgeInsets.all(12.0),
Texts( child: Column(
" : ", crossAxisAlignment: CrossAxisAlignment.start,
fontSize: 20, children: [
), Row(
Texts( children: [
model.ancillaryLists[0].patientID.toString(), Text(
) TranslationBase.of(context).patientName + ":",
], style: TextStyle(
), fontWeight: FontWeight.w600,
Row( fontSize: 10,
children: [ letterSpacing: -0.6,
Texts( color: CustomColors.grey,
TranslationBase.of(context).patientName, ),
fontWeight: FontWeight.bold, ),
fontSize: 20, mWidth(3),
), Text(
Texts( projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
" : ", style: TextStyle(
fontSize: 20, fontWeight: FontWeight.w600,
fontSize: 12,
letterSpacing: -0.48,
),
),
],
),
Row(
children: [
Text(
TranslationBase.of(context).mrn + ":",
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 10,
letterSpacing: -0.6,
color: CustomColors.grey,
),
),
mWidth(3),
Text(
projectViewModel.user.patientID.toString(),
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
letterSpacing: -0.48,
),
),
],
),
Row(
children: [
Text(
TranslationBase.of(context).nationalIdNumber + ":",
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 10,
letterSpacing: -0.6,
color: CustomColors.grey,
),
),
mWidth(3),
Text(
projectViewModel.user.patientIdentificationNo,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
letterSpacing: -0.48,
),
),
],
),
],
),
), ),
Texts( ),
model.ancillaryLists[0].patientName,
)
],
), ),
Divider() Divider()
], ],
@ -89,87 +139,34 @@ class _AnicllaryOrdersState extends State<AnicllaryOrders>
} }
Widget getAncillaryOrdersList(AnciallryOrdersViewModel model) { Widget getAncillaryOrdersList(AnciallryOrdersViewModel model) {
return Column( return Column(children: [
children: model.ancillaryLists[0].ancillaryOrderList ListView.separated(
.map( shrinkWrap: true,
(item) => InkWell( physics: NeverScrollableScrollPhysics(),
onTap: () { itemBuilder: (context, index) {
ancillaryOrdersDetails(item, model.ancillaryLists[0].projectID); return DoctorCard(
}, onTap: () => ancillaryOrdersDetails(model.ancillaryLists[0].ancillaryOrderList[index], model.ancillaryLists[0].projectID),
child: Container( isInOutPatient: true,
decoration: BoxDecoration( name: TranslationBase.of(context).dr.toString() + " " + (model.ancillaryLists[0].ancillaryOrderList[index].doctorName),
border: Border( billNo: model.ancillaryLists[0].ancillaryOrderList[index].orderNo.toString(),
bottom: BorderSide( profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
width: 0.5, subName: model.ancillaryLists[0].projectName,
))), isLiveCareAppointment: false,
padding: EdgeInsets.all(15), date: DateUtil.convertStringToDate(model.ancillaryLists[0].ancillaryOrderList[index].orderDate),
child: Row( isSortByClinic: true,
mainAxisAlignment: MainAxisAlignment.spaceBetween, );
children: [ },
Column( itemCount: model.ancillaryLists[0].ancillaryOrderList.length,
crossAxisAlignment: CrossAxisAlignment.start, separatorBuilder: (context, index) => SizedBox(height: 14),
children: [ ),
Padding( ]);
padding: EdgeInsets.all(3),
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context)
.appointmentNo +
' : ',
fontWeight: FontWeight.bold,
),
Texts(item.appointmentNo.toString())
],
)),
Padding(
padding: EdgeInsets.all(3),
child: Row(
children: [
Texts(
TranslationBase.of(context)
.appointmentDate +
' : ',
fontWeight: FontWeight.bold),
Texts(DateUtil.getFormattedDate(
DateUtil.convertStringToDate(
item.appointmentDate),
"MMM dd,yyyy"))
],
)),
Padding(
padding: EdgeInsets.all(3),
child: Row(
children: [
Texts(
TranslationBase.of(context)
.doctorName +
' : ',
fontWeight: FontWeight.bold),
Texts(item.doctorName.toString())
],
)),
Divider(
color: Colors.black12,
height: 1,
)
]),
Icon(
Icons.arrow_right,
size: 25,
)
]))),
)
.toList());
} }
ancillaryOrdersDetails(item, projectId) { ancillaryOrdersDetails(item, projectId) {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: AnicllaryOrdersDetails(item.appointmentNo, item.orderNo,projectId ), page: AnicllaryOrdersDetails(item.appointmentNo, item.orderNo, projectId),
), ),
); );
} }

@ -1,15 +1,19 @@
import "package:collection/collection.dart"; import "package:collection/collection.dart";
import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ancillary-orders/ordersPayment.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ancillary-orders/ordersPayment.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class AnicllaryOrdersDetails extends StatefulWidget { class AnicllaryOrdersDetails extends StatefulWidget {
final dynamic appoNo; final dynamic appoNo;
@ -17,11 +21,14 @@ class AnicllaryOrdersDetails extends StatefulWidget {
final dynamic projectID; final dynamic projectID;
AnicllaryOrdersDetails(this.appoNo, this.orderNo, this.projectID); AnicllaryOrdersDetails(this.appoNo, this.orderNo, this.projectID);
@override @override
_AnicllaryOrdersState createState() => _AnicllaryOrdersState(); _AnicllaryOrdersState createState() => _AnicllaryOrdersState();
} }
class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTickerProviderStateMixin { class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTickerProviderStateMixin {
ProjectViewModel projectViewModel;
void initState() { void initState() {
super.initState(); super.initState();
} }
@ -32,10 +39,13 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return BaseView<AnciallryOrdersViewModel>( return BaseView<AnciallryOrdersViewModel>(
onModelReady: (model) => model.getOrdersDetails(widget.appoNo, widget.orderNo, widget.projectID), onModelReady: (model) => model.getOrdersDetails(widget.appoNo, widget.orderNo, widget.projectID),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).anicllaryOrders, appBarTitle: TranslationBase.of(context).anicllaryOrders,
body: SingleChildScrollView( body: SingleChildScrollView(
@ -83,48 +93,94 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
} }
Widget getPatientInfo(AnciallryOrdersViewModel model) { Widget getPatientInfo(AnciallryOrdersViewModel model) {
print(model.ancillaryListsDetails);
return Padding( return Padding(
child: Column( child: Column(
children: [ children: [
Row( Container(
children: [ width: double.infinity,
Texts( child: Container(
TranslationBase.of(context).mrn, decoration: cardRadius(12),
fontWeight: FontWeight.bold, margin: EdgeInsets.zero,
fontSize: 22, child: Padding(
), padding: const EdgeInsets.all(12.0),
Texts( child: Column(
" : ", crossAxisAlignment: CrossAxisAlignment.start,
fontSize: 20, children: [
), Row(
Texts( children: [
model.ancillaryLists[0].patientID.toString(), Text(
) TranslationBase.of(context).patientName + ":",
], style: TextStyle(
), fontWeight: FontWeight.w600,
Row( fontSize: 10,
children: [ letterSpacing: -0.6,
Texts( color: CustomColors.grey,
TranslationBase.of(context).patientName, ),
fontWeight: FontWeight.bold, ),
fontSize: 20, mWidth(3),
), Text(
Texts( projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
" : ", style: TextStyle(
fontSize: 20, fontWeight: FontWeight.w600,
fontSize: 12,
letterSpacing: -0.48,
),
),
],
),
Row(
children: [
Text(
TranslationBase.of(context).mrn + ":",
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 10,
letterSpacing: -0.6,
color: CustomColors.grey,
),
),
mWidth(3),
Text(
projectViewModel.user.patientID.toString(),
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
letterSpacing: -0.48,
),
),
],
),
Row(
children: [
Text(
TranslationBase.of(context).nationalIdNumber + ":",
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 10,
letterSpacing: -0.6,
color: CustomColors.grey,
),
),
mWidth(3),
Text(
projectViewModel.user.patientIdentificationNo,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
letterSpacing: -0.48,
),
),
],
),
],
),
), ),
Texts( ),
model.ancillaryLists[0].patientName,
)
],
), ),
Divider( Divider()
color: Colors.black26,
)
], ],
), ),
padding: EdgeInsets.only(top: 5.0, bottom: 5.0), padding: EdgeInsets.only(top: 5.0, bottom: 10.0),
); );
} }

@ -122,7 +122,6 @@ class FatResult extends StatelessWidget {
service.getCalculationDoctors(calculationID: 5).then((res) { service.getCalculationDoctors(calculationID: 5).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res['List_CalculationTable'].length);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
if (res['List_CalculationTable'].length != 0) { if (res['List_CalculationTable'].length != 0) {
res['List_CalculationTable'].forEach((item) { res['List_CalculationTable'].forEach((item) {

@ -142,7 +142,6 @@ class CarbsResult extends StatelessWidget {
service.getCalculationDoctors(calculationID: 11).then((res) { service.getCalculationDoctors(calculationID: 11).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res['List_CalculationTable'].length);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
if (res['List_CalculationTable'].length != 0) { if (res['List_CalculationTable'].length != 0) {
res['List_CalculationTable'].forEach((item) { res['List_CalculationTable'].forEach((item) {

@ -250,16 +250,7 @@ class _IdealBodyState extends State<IdealBody> {
color: CustomColors.accentColor, color: CustomColors.accentColor,
onTap: () { onTap: () {
setState(() { setState(() {
// calculateBmr();
// calculateCalories();
calculateIdealWeight(); calculateIdealWeight();
print(idealWeight);
print(minRange);
print(maxRange);
print(overWeightBy);
print(textResult);
//print(overWeightBy);
{ {
Navigator.push( Navigator.push(
context, context,

@ -200,7 +200,6 @@ class _DentalComplaintsState extends State<DentalComplaints> {
service.getDoctorsList(int.parse("17"), widget.searchInfo.ProjectID, false, context, isContinueDentalPlan: true).then((res) { service.getDoctorsList(int.parse("17"), widget.searchInfo.ProjectID, false, context, isContinueDentalPlan: true).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
print(res['List_IsPatientHasOnGoingEstimation']);
dentalProceduresModel = DentalProceduresModel.fromJson(res); dentalProceduresModel = DentalProceduresModel.fromJson(res);
dentalProceduresModel.listIsPatientHasOnGoingEstimation.forEach((procedure) { dentalProceduresModel.listIsPatientHasOnGoingEstimation.forEach((procedure) {
appoTime += procedure.neededTime; appoTime += procedure.neededTime;
@ -251,7 +250,6 @@ class _DentalComplaintsState extends State<DentalComplaints> {
res['List_DentalChiefComplain'].forEach((v) { res['List_DentalChiefComplain'].forEach((v) {
complaintsList.add(new ListDentalChiefComplain.fromJson(v)); complaintsList.add(new ListDentalChiefComplain.fromJson(v));
}); });
print(complaintsList.length);
}); });
} else {} } else {}
}).catchError((err) { }).catchError((err) {

@ -43,8 +43,12 @@ class _QRCodeState extends State<QRCode> {
_bytes = base64.decode(widget.appoQR.split(',').last); _bytes = base64.decode(widget.appoQR.split(',').last);
widget.authUser = new AuthenticatedUser(); widget.authUser = new AuthenticatedUser();
FlutterNfcKit.nfcAvailability.then((value) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
_supportsNFC = (value == NFCAvailability.available); FlutterNfcKit.nfcAvailability.then((value) {
setState(() {
_supportsNFC = (value == NFCAvailability.available);
});
});
}); });
super.initState(); super.initState();
@ -69,36 +73,37 @@ class _QRCodeState extends State<QRCode> {
height: MediaQuery.of(context).size.width / 3, height: MediaQuery.of(context).size.width / 3,
child: Row( child: Row(
children: [ children: [
_supportsNFC // _supportsNFC
? Expanded( // ?
flex: 1, Expanded(
child: Row( flex: 1,
crossAxisAlignment: CrossAxisAlignment.center, child: Row(
mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ mainAxisAlignment: MainAxisAlignment.center,
InkWell( children: [
child: Container( InkWell(
margin: EdgeInsets.only(top: 30.0), child: Container(
alignment: Alignment.center, margin: EdgeInsets.only(top: 30.0),
padding: EdgeInsets.all(8), alignment: Alignment.center,
decoration: BoxDecoration( padding: EdgeInsets.all(8),
border: Border.all(color: Colors.black), decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10), border: Border.all(color: Colors.black),
), borderRadius: BorderRadius.circular(10),
child: Image.asset("assets/images/nfc/ic_nfc.png"), ),
), child: Image.asset("assets/images/nfc/ic_nfc.png"),
onTap: () {
showNfcReader(context, onNcfScan: (String nfcId) {
Future.delayed(const Duration(milliseconds: 100), () {
sendNfcCheckInRequest(nfcId);
});
});
},
),
],
), ),
) onTap: () {
: Container(), showNfcReader(context, onNcfScan: (String nfcId) {
Future.delayed(const Duration(milliseconds: 100), () {
sendNfcCheckInRequest(nfcId);
});
});
},
),
],
),
),
// : Container(),
Expanded( Expanded(
flex: 1, flex: 1,
child: Container( child: Container(

@ -196,7 +196,6 @@ class _SearchByClinicState extends State<SearchByClinic> {
onChanged: (bool value) { onChanged: (bool value) {
setState(() { setState(() {
nearestAppo = value; nearestAppo = value;
print(nearestAppo);
if (nearestAppo) if (nearestAppo)
getProjectsList(); getProjectsList();
else else
@ -231,7 +230,6 @@ class _SearchByClinicState extends State<SearchByClinic> {
showClickListDialog(context, clinicsList, onSelection: (ListClinicCentralized clincs) { showClickListDialog(context, clinicsList, onSelection: (ListClinicCentralized clincs) {
Navigator.pop(context); Navigator.pop(context);
setState(() { setState(() {
print(clincs.clinicID.toString() + "-" + clincs.isLiveCareClinicAndOnline.toString() + "-" + clincs.liveCareClinicID.toString() + "-" + clincs.liveCareServiceID.toString());
dropdownTitle = clincs.clinicDescription; dropdownTitle = clincs.clinicDescription;
dropdownValue = dropdownValue =
clincs.clinicID.toString() + "-" + clincs.isLiveCareClinicAndOnline.toString() + "-" + clincs.liveCareClinicID.toString() + "-" + clincs.liveCareServiceID.toString(); clincs.clinicID.toString() + "-" + clincs.isLiveCareClinicAndOnline.toString() + "-" + clincs.liveCareClinicID.toString() + "-" + clincs.liveCareServiceID.toString();
@ -241,7 +239,6 @@ class _SearchByClinicState extends State<SearchByClinic> {
projectDropdownValue = ""; projectDropdownValue = "";
getDoctorsList(context); getDoctorsList(context);
} else { } else {
print("Dental");
} }
}); });
}); });
@ -534,7 +531,6 @@ class _SearchByClinicState extends State<SearchByClinic> {
), ),
).then((value) { ).then((value) {
setState(() { setState(() {
print(value);
if (value == "false") dropdownValue = null; if (value == "false") dropdownValue = null;
}); });
if (value == "livecare") { if (value == "livecare") {

@ -27,7 +27,7 @@ class TestPageState extends State<TestPage>{
void location(){ void location(){
LocationUtils().getCurrentLocation(callBack: (latLng){ LocationUtils().getCurrentLocation(callBack: (latLng){
debugPrint(latLng.toString()); print(latLng.toString());
}); });
} }

@ -243,205 +243,6 @@ class _ToDoState extends State<ToDo> {
], ],
), ),
); );
// return Container(
// margin: EdgeInsets.all(10.0),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Container(
// child: Card(
// margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 8.0),
// color: Colors.white,
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(10),
// ),
// child: Container(
// width: MediaQuery.of(context).size.width,
// padding: EdgeInsets.all(10.0),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisSize: MainAxisSize.max,
// children: <Widget>[
// Row(
// children: <Widget>[
// Image.asset("assets/images/new-design/time_icon.png", width: 20.0, height: 20.0),
// Container(
// width: MediaQuery.of(context).size.width * 0.4,
// margin: EdgeInsets.only(left: 10.0, right: 10.0),
// child: Text(
// DateUtil.getWeekDayMonthDayYearDateFormatted(
// DateUtil.convertStringToDate(widget.appoList[index].appointmentDate), projectViewModel.isArabic ? "ar" : "en") +
// " " +
// widget.appoList[index].startTime.substring(0, 5),
// overflow: TextOverflow.clip,
// style: TextStyle(fontSize: 10.0)),
// ),
// !widget.appoList[index].isLiveCareAppointment ? Image.asset("assets/images/new-design/hospital_address_icon.png", width: 20.0, height: 20.0) : Container(),
// Container(
// margin: EdgeInsets.only(left: 5.0, right: 5.0),
// child: widget.appoList[index].isLiveCareAppointment
// ? Container()
// : Text(widget.appoList[index].projectName != null ? widget.appoList[index].projectName : "-",
// overflow: TextOverflow.clip, maxLines: 2, style: TextStyle(fontSize: 10.0)),
// ),
// ],
// ),
// Container(
// margin: EdgeInsets.only(top: 5.0),
// child: Divider(
// color: Colors.grey[500],
// ),
// ),
// Flex(
// direction: Axis.horizontal,
// children: <Widget>[
// Expanded(
// flex: 1,
// child: Container(
// height: MediaQuery.of(context).size.height * 0.1,
// margin: EdgeInsets.only(top: 5.0),
// child: ClipRRect(
// borderRadius: BorderRadius.circular(100.0),
// child: Image.network(widget.appoList[index].doctorImageURL, fit: BoxFit.fill),
// ),
// ),
// ),
// Expanded(
// flex: 3,
// child: Container(
// margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[
// Text(widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj,
// style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.bold, letterSpacing: -0.64)),
// if (getDoctorSpeciality(widget.appoList[index].doctorSpeciality) != "null\n")
// Container(
// margin: EdgeInsets.only(top: 3.0, bottom: 3.0),
// child: Text(getDoctorSpeciality(widget.appoList[index].doctorSpeciality).trim(),
// style: TextStyle(fontSize: 12.0, color: Colors.grey[600], letterSpacing: -0.64)),
// ),
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// mainAxisSize: MainAxisSize.max,
// children: <Widget>[
// RatingBar.readOnly(
// initialRating: widget.appoList[index].actualDoctorRate.toDouble(),
// size: 20.0,
// filledColor: Colors.yellow[700],
// emptyColor: Colors.grey[500],
// isHalfAllowed: true,
// halfFilledIcon: Icons.star_half,
// filledIcon: Icons.star,
// emptyIcon: Icons.star,
// ),
// ],
// ),
// Container(
// child: CountdownTimer(
// controller:
// new CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (widget.appoList[index].remaniningHoursTocanPay * 1000) * 60),
// widgetBuilder: (_, CurrentRemainingTime time) {
// return time != null
// ? Text(
// '${time.days != null ? time.days : "0"}:${time.hours != null ? time.hours.toString().length == 1 ? "0" + time.hours.toString() : time.hours : "00"}:${time.min}:${time.sec} ' +
// TranslationBase.of(context).upcomingTimeLeft,
// style: TextStyle(fontSize: 12.0, color: Color(0xffC5272D)))
// : Container();
// },
// ),
// ),
// ],
// ),
// ),
// ),
// Expanded(
// flex: 1,
// child: InkWell(
// onTap: () => performNextAction(widget.appoList[index]),
// child: Container(
// margin: EdgeInsets.only(top: 20.0),
// child: Column(
// children: <Widget>[
// Image.asset(getNextActionImage(widget.appoList[index].nextAction), width: 50.0, height: 50.0),
// Container(
// margin: EdgeInsets.only(top: 5.0),
// child: Text(getNextActionText(widget.appoList[index].nextAction), textAlign: TextAlign.center, style: TextStyle(fontSize: 12.0)),
// )
// ],
// ),
// ),
// ),
// )
// ],
// ),
// Divider(
// color: Colors.grey[500],
// ),
// Flex(
// direction: Axis.horizontal,
// children: <Widget>[
// Expanded(
// flex: 2,
// child: Container(
// child: Text(getNextActionDescription(widget.appoList[index].nextAction), style: TextStyle(fontSize: 11.0, color: Colors.grey[700])),
// ),
// ),
// Expanded(
// flex: 1,
// child: GestureDetector(
// onTap: () {
// navigateToAppointmentDetails(context, widget.appoList[index]);
// },
// child: Container(
// child: Text(TranslationBase.of(context).upcomingDetails,
// textAlign: TextAlign.end, style: TextStyle(fontSize: 11.0, color: new Color(0xffC5272D), decoration: TextDecoration.underline)),
// ),
// ),
// )
// ],
// ),
// ],
// ),
// ),
// ),
// ),
// Container(
// decoration: BoxDecoration(
// borderRadius: BorderRadius.only(bottomLeft: Radius.circular(10.0), bottomRight: Radius.circular(10.0)),
// color: Color(0xff20bc44),
// ),
// height: 30.0,
// padding: EdgeInsets.only(right: 10, left: 10),
// margin: EdgeInsets.symmetric(horizontal: 20),
// transform: Matrix4.translationValues(0.0, -8.0, 0.0),
// child: Row(
// mainAxisSize: MainAxisSize.min,
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// widget.appoList[index].clinicID == 265
// ? Container(
// margin: EdgeInsets.only(left: 5.0, right: 5.0),
// child: SvgPicture.asset(
// "assets/images/new/car_icon.svg",
// height: 15,
// width: 15,
// ),
// )
// : widget.appoList[index].isLiveCareAppointment
// ? Image.asset("assets/images/new-design/video.png")
// : Image.asset("assets/images/new-design/walkin.png"),
// widget.appoList[index].clinicID == 265
// ? Text(TranslationBase.of(context).drivethruAppo, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 11.0))
// : widget.appoList[index].isLiveCareAppointment
// ? Text(TranslationBase.of(context).videoAppo, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 11.0))
// : Text(TranslationBase.of(context).walkinAppo, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 11.0))
// ],
// ),
// ),
// ],
// ),
// );
}, },
), ),
), ),
@ -736,7 +537,6 @@ class _ToDoState extends State<ToDo> {
getLiveCareAppointmentPatientShare(context, DoctorsListService service, AppoitmentAllHistoryResultList appo) { getLiveCareAppointmentPatientShare(context, DoctorsListService service, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getLiveCareAppointmentPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, context).then((res) { service.getLiveCareAppointmentPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, context).then((res) {
print(res);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
widget.patientShareResponse = new PatientShareResponse.fromJson(res); widget.patientShareResponse = new PatientShareResponse.fromJson(res);
openPaymentDialog(appo, widget.patientShareResponse); openPaymentDialog(appo, widget.patientShareResponse);
@ -801,7 +601,6 @@ class _ToDoState extends State<ToDo> {
context: context, context: context,
pageBuilder: (context, animation1, animation2) {}) pageBuilder: (context, animation1, animation2) {})
.then((value) { .then((value) {
print(value);
if (value != null) { if (value != null) {
navigateToPaymentMethod(context, value, appo); navigateToPaymentMethod(context, value, appo);
@ -882,7 +681,6 @@ class _ToDoState extends State<ToDo> {
String paymentReference = res['Fort_id'].toString(); String paymentReference = res['Fort_id'].toString();
service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) { service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res['OnlineCheckInAppointments'][0]);
addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, appo.appointmentNo.toString(), appo, res['OnlineCheckInAppointments'][0]); addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, appo.appointmentNo.toString(), appo, res['OnlineCheckInAppointments'][0]);
}).catchError((err) { }).catchError((err) {
print(err); print(err);
@ -917,26 +715,7 @@ class _ToDoState extends State<ToDo> {
}); });
} }
// getPatientData() async {
// AppSharedPreferences sharedPref = AppSharedPreferences();
// if (await sharedPref.getObject(USER_PROFILE) != null) {
// var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
// setState(() {
// print(data);
// authUser = data;
// });
// getPatientAppointmentHistory();
// }
// }
Future navigateToPaymentMethod(context, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async { Future navigateToPaymentMethod(context, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async {
// if (await this.sharedPref.getObject(USER_PROFILE) != null) {
// var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
// setState(() {
// authUser = data;
// });
// }
Navigator.push(context, FadePage(page: PaymentMethod(onSelectedMethod: (String metohd) { Navigator.push(context, FadePage(page: PaymentMethod(onSelectedMethod: (String metohd) {
setState(() {}); setState(() {});
}))).then((value) { }))).then((value) {

@ -139,7 +139,6 @@ class _LiveCareHomeState extends State<LiveCareHome> with SingleTickerProviderSt
service.getLivecareHistory(context).then((res) { service.getLivecareHistory(context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
setState(() { setState(() {
print(res['ErRequestHistoryList'].length);
if (res['ErRequestHistoryList'].length != 0) { if (res['ErRequestHistoryList'].length != 0) {
patientERVirtualHistoryResponse = PatientERVirtualHistoryResponse.fromJson(res); patientERVirtualHistoryResponse = PatientERVirtualHistoryResponse.fromJson(res);
erRequestHistoryList = patientERVirtualHistoryResponse.erRequestHistoryList; erRequestHistoryList = patientERVirtualHistoryResponse.erRequestHistoryList;

@ -257,7 +257,6 @@ class _Login extends State<Login> {
authService authService
.checkPatientAuthentication(request) .checkPatientAuthentication(request)
.then((value) => { .then((value) => {
//showLoader(false),
if (value['isSMSSent']) if (value['isSMSSent'])
{ {
sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']), sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']),
@ -284,17 +283,11 @@ class _Login extends State<Login> {
cancelFunction: () => {}); cancelFunction: () => {});
dialog.showAlertDialog(context); dialog.showAlertDialog(context);
}); });
// SMSOTP.showLoadingDialog(context, false),
} }
checkActivationCode({code}) async { checkActivationCode({code}) async {
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
// request.logInTokenID = await sharedPref.getString(LOGIN_TOKEN_ID); if (code == null) request['PatientMobileNumber'] = int.parse(mobileNo);
// request.activationCode = code ?? "0000";
// request.isSilentLogin = code != null ? false : true;
if (code == null)
//showLoader(true);
request['PatientMobileNumber'] = int.parse(mobileNo);
request['ZipCode'] = countryCode; request['ZipCode'] = countryCode;
request['SearchType'] = loginType; request['SearchType'] = loginType;
request['LoginType'] = loginType; request['LoginType'] = loginType;
@ -305,10 +298,8 @@ class _Login extends State<Login> {
request['PatientIdentificationID'] = ''; request['PatientIdentificationID'] = '';
request['PatientID'] = int.parse(nationalIDorFile.text); request['PatientID'] = int.parse(nationalIDorFile.text);
} }
// request.isRegister = false;
this.authService.checkActivationCode(request, code).then((result) async { this.authService.checkActivationCode(request, code).then((result) async {
sharedPref.remove(FAMILY_FILE); sharedPref.remove(FAMILY_FILE);
// Register GeoZones after login
registerGeoZones(); registerGeoZones();
projectViewModel.setPrivilege(privilegeList: result); projectViewModel.setPrivilege(privilegeList: result);
result = CheckActivationCode.fromJson(result); result = CheckActivationCode.fromJson(result);
@ -323,15 +314,8 @@ class _Login extends State<Login> {
appointmentRateViewModel.isLogin = true; appointmentRateViewModel.isLogin = true;
projectViewModel.isLogin = true; projectViewModel.isLogin = true;
authenticatedUserObject.user = result.list; authenticatedUserObject.user = result.list;
// authenticatedUserObject.user.cRSVerificationStatus =
// result['CRSVerificationStatus'];
projectViewModel.user = authenticatedUserObject.user; projectViewModel.user = authenticatedUserObject.user;
//await familyFileProvider.getSharedRecordByStatus();
// await pharmacyModuleViewModel.generatePharmacyToken().then((value) async {
// if (pharmacyModuleViewModel.error.isNotEmpty) await pharmacyModuleViewModel.createUser();
// });
appointmentRateViewModel appointmentRateViewModel
.getIsLastAppointmentRatedList() .getIsLastAppointmentRatedList()
.then((value) => { .then((value) => {

@ -297,8 +297,6 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
GifLoaderDialogUtils.showMyDialog(AppGlobal.context); GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.checkPaymentStatus(transID, AppGlobal.context).then((res) { service.checkPaymentStatus(transID, AppGlobal.context).then((res) {
print("Printing Payment Status Reponse!!!!");
print(res);
String paymentInfo = res['Response_Message']; String paymentInfo = res['Response_Message'];
if (paymentInfo == 'Success') { if (paymentInfo == 'Success') {
createAdvancePayment(res, appo); createAdvancePayment(res, appo);
@ -327,7 +325,6 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
widget.advanceModel.fileNumber, widget.advanceModel.fileNumber,
AppGlobal.context) AppGlobal.context)
.then((res) { .then((res) {
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']);
addAdvancedNumberRequest( addAdvancedNumberRequest(
res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference, paymentReference,

@ -283,7 +283,6 @@ class _PassportUpdatePageState extends State<PassportUpdatePage> {
service.getCovidPassportNumber().then((res) { service.getCovidPassportNumber().then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res['Covid19_Certificate_GetPassportList'][0]['PassportNo']);
passportNumber.text = res['Covid19_Certificate_GetPassportList'][0]['PassportNo']; passportNumber.text = res['Covid19_Certificate_GetPassportList'][0]['PassportNo'];
if (res['Covid19_Certificate_GetPassportList'][0]['PassportNo'] != "") { if (res['Covid19_Certificate_GetPassportList'][0]['PassportNo'] != "") {
_isButtonDisabled = false; _isButtonDisabled = false;

@ -30,7 +30,6 @@ class _MedicalProfilePageState extends State<MedicalProfilePageNew> {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
var appoCountProvider = Provider.of<ToDoCountProviderModel>(context); var appoCountProvider = Provider.of<ToDoCountProviderModel>(context);
List<Widget> myMedicalList = Utils.myMedicalList(projectViewModel: projectViewModel, context: context, count: appoCountProvider.count, isLogin: projectViewModel.isLogin); List<Widget> myMedicalList = Utils.myMedicalList(projectViewModel: projectViewModel, context: context, count: appoCountProvider.count, isLogin: projectViewModel.isLogin);
print(myMedicalList);
return BaseView<MedicalViewModel>( return BaseView<MedicalViewModel>(
onModelReady: (model) => model.getAppointmentHistory(), onModelReady: (model) => model.getAppointmentHistory(),
builder: (_, model, widget1) => AppScaffold( builder: (_, model, widget1) => AppScaffold(
@ -47,25 +46,6 @@ class _MedicalProfilePageState extends State<MedicalProfilePageNew> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
// Container(
// width: double.infinity,
// height: 210,
// decoration: containerBottomRightRadiusWithGradientBorder(0, darkColor: Color(0xFFF2B353E), lightColor: Color(0xFFF2B353E)),
// child: Stack(
// children: <Widget>[
// if (model.isLogin)
// ListView.builder(
// itemBuilder: (context, index) => TimeLineWidget(
// isUp: index % 2 == 1,
// appoitmentAllHistoryResul: model.appoitmentAllHistoryResultList[index],
// ),
// itemCount: model.appoitmentAllHistoryResultList.length,
// scrollDirection: Axis.horizontal,
// reverse: projectViewModel.isArabic,
// ),
// ],
// ),
// ),
TimeLineView(model.isLogin, projectViewModel.isArabic, model.appoitmentAllHistoryResultList), TimeLineView(model.isLogin, projectViewModel.isArabic, model.appoitmentAllHistoryResultList),
SizedBox( SizedBox(
height: 20, height: 20,
@ -101,14 +81,6 @@ class _MedicalProfilePageState extends State<MedicalProfilePageNew> {
shrinkWrap: true, shrinkWrap: true,
primary: false, primary: false,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
// gridDelegate:
// SliverGridDelegateWithFixedCrossAxisCount(
// crossAxisCount: 3,
// childAspectRatio: MediaQuery.of(context)
// .size
// .width /
// (MediaQuery.of(context).size.height / 2.20),
// ),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12),
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
itemCount: myMedicalList.length, itemCount: myMedicalList.length,

@ -124,7 +124,6 @@ class _syncHealthDataButtonState extends State<syncHealthDataButton> {
counter++; counter++;
totalHeartRate += element['Value']; totalHeartRate += element['Value'];
} else if (element['MedCategoryID'] == 4) { } else if (element['MedCategoryID'] == 4) {
print("sleeeeep");
sleepDataList.add(new healthData( sleepDataList.add(new healthData(
MedCategoryID: 4, MedSubCategoryID: element['MedSubCategoryID'], MachineDate: DateUtil.convertDateToString(date), Value: element['Value'], TransactionsListID: TransactionsListID++)); MedCategoryID: 4, MedSubCategoryID: element['MedSubCategoryID'], MachineDate: DateUtil.convertDateToString(date), Value: element['Value'], TransactionsListID: TransactionsListID++));

@ -37,7 +37,6 @@ class _ClinicPackagesPageState extends State<ClinicPackagesPage> with AfterLayou
if (viewModel.service.customer != null) { if (viewModel.service.customer != null) {
var request = AddProductToCartRequestModel(product_id: product.id, customer_id: viewModel.service.customer.id); var request = AddProductToCartRequestModel(product_id: product.id, customer_id: viewModel.service.customer.id);
await viewModel.service.addProductToCart(request, context: context).then((response) { await viewModel.service.addProductToCart(request, context: context).then((response) {
// appScaffold.appBar.badgeUpdater(viewModel.service.cartItemCount);
}).catchError((error) { }).catchError((error) {
utils.Utils.showErrorToast(error); utils.Utils.showErrorToast(error);
}); });

@ -284,7 +284,7 @@ class _PackagesCartPageState extends State<PackagesCartPage> with AfterLayoutMix
var subTitle = "Order# ${value.data.customOrderNumber}"; var subTitle = "Order# ${value.data.customOrderNumber}";
Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context) => PackageOrderCompletedPage(heading: heading, title: title, subTitle: subTitle))); Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context) => PackageOrderCompletedPage(heading: heading, title: title, subTitle: subTitle)));
}).catchError((error) { }).catchError((error) {
debugPrint(error); print(error);
}); });
} }

@ -1,18 +1,17 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/compare-list.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:carousel_slider/carousel_slider.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/compare-list.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
int counter = 0; int counter = 0;
dynamic languageID; dynamic languageID;
class ComparePage extends StatefulWidget { class ComparePage extends StatefulWidget {
@override @override
_ComparePageState createState() => _ComparePageState(); _ComparePageState createState() => _ComparePageState();
@ -23,6 +22,7 @@ class _ComparePageState extends State<ComparePage> {
getLanguageID() async { getLanguageID() async {
languageID = await sharedPref.getString(APP_LANGUAGE); languageID = await sharedPref.getString(APP_LANGUAGE);
} }
void initState() { void initState() {
getLanguageID(); getLanguageID();
super.initState(); super.initState();
@ -68,8 +68,8 @@ class compareList extends StatelessWidget {
), ),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Text(TranslationBase.of(context).noData, child: Text(
// 'There is no data', TranslationBase.of(context).noData,
style: TextStyle(fontSize: 30), style: TextStyle(fontSize: 30),
), ),
) )
@ -77,27 +77,11 @@ class compareList extends StatelessWidget {
), ),
), ),
) )
: CarouselSlider( : Container(
options: CarouselOptions( margin: EdgeInsets.only(top: 12.0),
height: 800.0, width: double.infinity,
viewportFraction: 0.87, height: MediaQuery.of(context).size.height,
enableInfiniteScroll: false), child: slideDetail(productItem),
items: productItem.map((i) {
return Builder(
builder: (BuildContext context) {
return Padding(
padding: const EdgeInsets.only(top: 8),
child: Container(
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(horizontal: 10.0),
child: productItem.length != 0
? slideDetail(productItem)
: Container(),
),
);
},
);
}).toList(),
); );
} }
} }
@ -147,8 +131,7 @@ class _slideDetailState extends State<slideDetail> {
icon: Icon(FontAwesomeIcons.trashAlt, size: 15), icon: Icon(FontAwesomeIcons.trashAlt, size: 15),
onPressed: () { onPressed: () {
setState(() { setState(() {
Provider.of<CompareList>(context, listen: false) Provider.of<CompareList>(context, listen: false).deleteItem(widget.data[index].id);
.deleteItem(widget.data[index].id);
}); });
}, },
), ),
@ -173,53 +156,42 @@ class _slideDetailState extends State<slideDetail> {
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child:Align( child: Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: projectViewModel.isArabic ? TextSpan( text: projectViewModel.isArabic
text: widget.data[index].namen, ? TextSpan(
style: TextStyle( text: widget.data[index].namen,
fontWeight: FontWeight.bold, style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
color: Colors.black, )
fontSize: 13), : TextSpan(
) text: widget.data[index].name,
: TextSpan( style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
text: widget.data[index].name, ),
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
),
), ),
), ),
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ? child: projectViewModel.isArabic
Align( ? Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: "SAR ${widget.data[index].price.toString()}", text: "SAR ${widget.data[index].price.toString()}",
style: TextStyle( style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
color: Colors.black54, ),
fontSize: 15, ),
fontWeight: FontWeight.bold), )
), : Align(
), alignment: Alignment.topLeft,
): child: RichText(
Align( text: TextSpan(
alignment: Alignment.topLeft, text: "SAR ${widget.data[index].price.toString()}",
child: RichText( style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
text: TextSpan( ),
text: "SAR ${widget.data[index].price.toString()}", ),
style: TextStyle( ),
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
),
),
),
), ),
Padding( Padding(
padding: EdgeInsets.only(top: 8.0), padding: EdgeInsets.only(top: 8.0),
@ -230,63 +202,43 @@ class _slideDetailState extends State<slideDetail> {
), ),
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ? child: projectViewModel.isArabic
Align( ? Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ? widget.data[index].specifications[0].nameN : "",
widget.data[index].specifications[0].nameN :"", style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
style: TextStyle( )),
fontWeight: FontWeight.bold, )
color: Colors.black, : Align(
fontSize: 13), alignment: Alignment.topLeft,
) child: RichText(
), text: TextSpan(
): Align( text: widget.data[index].specifications != null ? widget.data[index].specifications[0].name : "",
alignment: Alignment.topLeft, style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
child: RichText( )),
text: TextSpan( )),
text: widget.data[index].specifications != null ?
widget.data[index].specifications[0].name :"",
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
)
),
)
),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ? child: projectViewModel.isArabic
Align( ? Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text:TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ? widget.data[index].specifications[0].defaultValuen : "",
widget.data[index].specifications[0].defaultValuen:"", style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
style: TextStyle( )),
color: Colors.black54, )
fontSize: 15, : Align(
fontWeight: FontWeight.bold), alignment: Alignment.topLeft,
) child: RichText(
), text: TextSpan(
):Align( text: widget.data[index].specifications != null ? widget.data[index].specifications[0].defaultValue : "",
alignment: Alignment.topLeft, style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
child: RichText( )),
text:TextSpan( )),
text: widget.data[index].specifications != null ?
widget.data[index].specifications[0].defaultValue:"",
style: TextStyle(
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
)
),
)
),
Padding( Padding(
padding: EdgeInsets.only(top: 8.0), padding: EdgeInsets.only(top: 8.0),
child: Container( child: Container(
@ -297,62 +249,42 @@ class _slideDetailState extends State<slideDetail> {
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ? child: projectViewModel.isArabic
Align( ? Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ? widget.data[index].specifications[1].nameN : "",
widget.data[index].specifications[1].nameN :"", style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
style: TextStyle( )),
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
)
),
): Align(
alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[1].name :"",
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
) )
), : Align(
) alignment: Alignment.topLeft,
), child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[1].name : "",
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
)),
)),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ? child: projectViewModel.isArabic
Align( ? Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text:TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ? widget.data[index].specifications[1].defaultValuen : "",
widget.data[index].specifications[1].defaultValuen:"", style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
style: TextStyle( )),
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
)
),
):Align(
alignment: Alignment.topLeft,
child: RichText(
text:TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[1].defaultValue:"",
style: TextStyle(
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
) )
), : Align(
) alignment: Alignment.topLeft,
), child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[1].defaultValue : "",
style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
)),
)),
Padding( Padding(
padding: EdgeInsets.only(top: 8.0), padding: EdgeInsets.only(top: 8.0),
child: Container( child: Container(
@ -363,62 +295,42 @@ class _slideDetailState extends State<slideDetail> {
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ? child: projectViewModel.isArabic
Align( ? Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ? widget.data[index].specifications[2].nameN : "",
widget.data[index].specifications[2].nameN :"", style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
style: TextStyle( )),
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
)
),
): Align(
alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[2].name :"",
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
) )
), : Align(
) alignment: Alignment.topLeft,
), child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[2].name : "",
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
)),
)),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ? child: projectViewModel.isArabic
Align( ? Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text:TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ? widget.data[index].specifications[2].defaultValuen : "",
widget.data[index].specifications[2].defaultValuen:"", style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
style: TextStyle( )),
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
)
),
):Align(
alignment: Alignment.topLeft,
child: RichText(
text:TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[2].defaultValue:"",
style: TextStyle(
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
) )
), : Align(
) alignment: Alignment.topLeft,
), child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[2].defaultValue : "",
style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
)),
)),
Padding( Padding(
padding: EdgeInsets.only(top: 8.0), padding: EdgeInsets.only(top: 8.0),
child: Container( child: Container(
@ -429,62 +341,42 @@ class _slideDetailState extends State<slideDetail> {
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ? child: projectViewModel.isArabic
Align( ? Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ? widget.data[index].specifications[3].nameN : "",
widget.data[index].specifications[3].nameN :"", style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
style: TextStyle( )),
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
)
),
): Align(
alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[3].name :"",
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
) )
), : Align(
) alignment: Alignment.topLeft,
), child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[3].name : "",
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
)),
)),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ? child: projectViewModel.isArabic
Align( ? Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text:TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ? widget.data[index].specifications[3].defaultValuen : "",
widget.data[index].specifications[3].defaultValuen:"", style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
style: TextStyle( )),
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
)
),
):Align(
alignment: Alignment.topLeft,
child: RichText(
text:TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[3].defaultValue:"",
style: TextStyle(
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
) )
), : Align(
) alignment: Alignment.topLeft,
), child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[3].defaultValue : "",
style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
)),
)),
Padding( Padding(
padding: EdgeInsets.only(top: 8.0), padding: EdgeInsets.only(top: 8.0),
child: Container( child: Container(
@ -495,62 +387,42 @@ class _slideDetailState extends State<slideDetail> {
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ? child: projectViewModel.isArabic
Align( ? Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ? widget.data[index].specifications[4].nameN : "",
widget.data[index].specifications[4].nameN :"", style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
style: TextStyle( )),
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
)
),
): Align(
alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[4].name :"",
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
) )
), : Align(
) alignment: Alignment.topLeft,
), child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[4].name : "",
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
)),
)),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ? child: projectViewModel.isArabic
Align( ? Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text:TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ? widget.data[index].specifications[4].defaultValuen : "",
widget.data[index].specifications[4].defaultValuen:"", style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
style: TextStyle( )),
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
)
),
):Align(
alignment: Alignment.topLeft,
child: RichText(
text:TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[4].defaultValue:"",
style: TextStyle(
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
) )
), : Align(
) alignment: Alignment.topLeft,
), child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[4].defaultValue : "",
style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
)),
)),
Padding( Padding(
padding: EdgeInsets.only(top: 8.0), padding: EdgeInsets.only(top: 8.0),
child: Container( child: Container(
@ -561,63 +433,42 @@ class _slideDetailState extends State<slideDetail> {
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ? child: projectViewModel.isArabic
Align( ? Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ? widget.data[index].specifications[5].nameN : "",
widget.data[index].specifications[5].nameN :"", style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
style: TextStyle( )),
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
)
),
): Align(
alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[5].name :"",
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
) )
), : Align(
) alignment: Alignment.topLeft,
), child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[5].name : "",
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
)),
)),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ? child: projectViewModel.isArabic
Align( ? Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text:TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ? widget.data[index].specifications[5].defaultValuen : "",
widget.data[index].specifications[5].defaultValuen:"", style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
style: TextStyle( )),
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
)
),
):Align(
alignment: Alignment.topLeft,
child: RichText(
text:TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[5].defaultValue:"",
style: TextStyle(
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
) )
), : Align(
) alignment: Alignment.topLeft,
), child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[5].defaultValue : "",
style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
)),
)),
], ],
), ),
), ),
@ -628,15 +479,3 @@ class _slideDetailState extends State<slideDetail> {
); );
} }
} }
String returnString(data) {
for (int i = 0; i < data.length; i++) {
print(data[i]);
// if(data[i] == null){
// if(counter == i){
//
// }
// }
}
return "ENAD HILAL";
}

@ -24,6 +24,9 @@ class LakumActivationVidaPage extends StatelessWidget {
isShowAppBar: true, isShowAppBar: true,
isPharmacy: true, isPharmacy: true,
isShowDecPage: false, isShowDecPage: false,
showPharmacyCart: false,
showHomeAppBarIcon: false,
isBottomBar: false,
backgroundColor: Colors.white, backgroundColor: Colors.white,
baseViewModel: model, baseViewModel: model,
body: Container( body: Container(

@ -18,8 +18,7 @@ class LacumTransferPage extends StatefulWidget {
} }
class _LacumTransferPageState extends State<LacumTransferPage> { class _LacumTransferPageState extends State<LacumTransferPage> {
TextEditingController _beneficieryAccountController = TextEditingController _beneficieryAccountController = new TextEditingController();
new TextEditingController();
TextEditingController _transferPointsController = new TextEditingController(); TextEditingController _transferPointsController = new TextEditingController();
@override @override
@ -34,8 +33,7 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
final mediaQuery = MediaQuery.of(context); final mediaQuery = MediaQuery.of(context);
return BaseView<LacumTranferViewModel>( return BaseView<LacumTranferViewModel>(
onModelReady: (model) => model.setLakumData( onModelReady: (model) => model.setLakumData(widget.lacumInformation, widget.lacumGroupInformation),
widget.lacumInformation, widget.lacumGroupInformation),
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
appBarTitle: "${TranslationBase.of(context).lakumTransfer}", appBarTitle: "${TranslationBase.of(context).lakumTransfer}",
isShowAppBar: true, isShowAppBar: true,
@ -50,8 +48,7 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
width: double.infinity, width: double.infinity,
child: SingleChildScrollView( child: SingleChildScrollView(
child: SizedBox( child: SizedBox(
height: height: mediaQuery.size.height - 58 - mediaQuery.padding.top,
mediaQuery.size.height - 58 - mediaQuery.padding.top,
child: Padding( child: Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
child: Column( child: Column(
@ -65,23 +62,20 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
Container( Container(
height: 100, height: 100,
width: mediaQuery.size.width / 2 - 26, width: mediaQuery.size.width / 2 - 26,
padding: EdgeInsets.only( padding: EdgeInsets.only(top: 12, left: 8, right: 8, bottom: 4),
top: 12, left: 8, right: 8, bottom: 4),
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
border: Border.fromBorderSide(BorderSide( border: Border.fromBorderSide(BorderSide(
color: Color(0xffe1e1e1), color: Color(0xffe1e1e1),
width: 0.4, width: 0.4,
)), )),
color: Colors.green color: Colors.green
//(0xff6294ed), //(0xff6294ed),
), ),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(
@ -99,13 +93,10 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
), ),
Expanded( Expanded(
child: Container( child: Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(vertical: 8),
vertical: 8),
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.end,
MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.end,
children: [ children: [
Texts( Texts(
"${model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalance}", "${model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalance}",
@ -126,8 +117,7 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
Container( Container(
height: 100, height: 100,
width: mediaQuery.size.width / 2 - 26, width: mediaQuery.size.width / 2 - 26,
padding: EdgeInsets.only( padding: EdgeInsets.only(top: 12, left: 8, right: 8, bottom: 4),
top: 12, left: 8, right: 8, bottom: 4),
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
@ -138,10 +128,8 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
color: Color(0xff339933), color: Color(0xff339933),
), ),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(
@ -159,13 +147,10 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
), ),
Expanded( Expanded(
child: Container( child: Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(vertical: 8),
vertical: 8),
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.end,
MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.end,
children: [ children: [
Texts( Texts(
"${model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount}", "${model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount}",
@ -199,47 +184,34 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
margin: EdgeInsets.only(top: 4), margin: EdgeInsets.only(top: 4),
child: BorderedButton( child: BorderedButton(
TranslationBase.of(context).checkBeneficiary, TranslationBase.of(context).checkBeneficiary,
backgroundColor: backgroundColor: _beneficieryAccountController.text.isNotEmpty ? Color(0xff60686b) : Color(0xffb0b4b5),
_beneficieryAccountController.text != ""
? Color(0xff60686b)
: Color(0xffb0b4b5),
textColor: Colors.white, textColor: Colors.white,
fontSize: 16, fontSize: 16,
hPadding: 8, hPadding: 8,
vPadding: 12, vPadding: 12,
handler: handler: _beneficieryAccountController.text.isNotEmpty
_beneficieryAccountController.text != "" ? () {
? () { model.getLacumGroupDataBuAccountId(_beneficieryAccountController.text);
model.getLacumGroupDataBuAccountId( }
_beneficieryAccountController : () {},
.text);
}
: (){},
), ),
), ),
(model.lacumReceiverInformation != null && (model.lacumReceiverInformation != null && model.lacumReceiverInformation.lakumInquiryInformationObjVersion != null)
model.lacumReceiverInformation
.lakumInquiryInformationObjVersion !=
null)
? Container( ? Container(
margin: EdgeInsets.only(top: 8), margin: EdgeInsets.only(top: 8),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).beneficiaryName,
.beneficiaryName,
color: Colors.black, color: Colors.black,
), ),
Padding( Padding(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(horizontal: 8),
horizontal: 8),
child: TextField( child: TextField(
enabled: false, enabled: false,
decoration: new InputDecoration( decoration: new InputDecoration(
hintText: hintText: "${model.lacumReceiverInformation.lakumInquiryInformationObjVersion.memberName}",
"${model.lacumReceiverInformation.lakumInquiryInformationObjVersion.memberName}",
hintStyle: TextStyle( hintStyle: TextStyle(
fontSize: 16, fontSize: 16,
color: Colors.grey.shade600, color: Colors.grey.shade600,
@ -259,11 +231,9 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
color: Colors.black, color: Colors.black,
), ),
Padding( Padding(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(horizontal: 8),
horizontal: 8),
child: TextField( child: TextField(
controller: controller: _transferPointsController,
_transferPointsController,
decoration: new InputDecoration( decoration: new InputDecoration(
focusColor: Colors.green, focusColor: Colors.green,
hintStyle: TextStyle( hintStyle: TextStyle(
@ -282,10 +252,7 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
: Container() : Container()
], ],
), ),
if (model.lacumReceiverInformation != null && if (model.lacumReceiverInformation != null && model.lacumReceiverInformation.lakumInquiryInformationObjVersion != null)
model.lacumReceiverInformation
.lakumInquiryInformationObjVersion !=
null)
Container( Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
child: BorderedButton( child: BorderedButton(
@ -298,14 +265,9 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
vPadding: 16, vPadding: 16,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
handler: () { handler: () {
model model.transferYaHalaLoyaltyPoints(_transferPointsController.text).then((status) => {
.transferYaHalaLoyaltyPoints( {Navigator.pop(context)}
_transferPointsController.text) });
.then((status) => {
if (status == 200)
{Navigator.pop(context, "")}
// back to previous page
});
}, },
), ),
) )

@ -28,13 +28,11 @@ class LakumMainPage extends StatelessWidget {
return BaseView<LacumViewModel>( return BaseView<LacumViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
await model.getLacumData(); await model.getLacumData();
if (model.lacumInformation.yahalaAccountNo == 0 || if (model.lacumInformation.yahalaAccountNo == 0 || model.lacumInformation.yahalaAccountNo == null) {
model.lacumInformation.yahalaAccountNo == null) {
navigateToLakumRegister(context); navigateToLakumRegister(context);
} else { } else {
if (model.lacumInformation.status == "Hold") { if (model.lacumInformation.status == "Hold") {
Navigator.pushReplacement( Navigator.pushReplacement(context, FadePage(page: LakumActivationVidaPage()));
context, FadePage(page: LakumActivationVidaPage()));
} }
} }
}, },
@ -53,10 +51,7 @@ class LakumMainPage extends StatelessWidget {
body: Container( body: Container(
width: double.infinity, width: double.infinity,
child: SingleChildScrollView( child: SingleChildScrollView(
child: (model.lacumGroupInformation != null && child: (model.lacumGroupInformation != null && model.lacumGroupInformation.lakumInquiryInformationObjVersion != null)
model.lacumGroupInformation
.lakumInquiryInformationObjVersion !=
null)
? Column( ? Column(
children: [ children: [
Stack( Stack(
@ -70,11 +65,7 @@ class LakumMainPage extends StatelessWidget {
SizedBox( SizedBox(
height: mediaQuery.size.height * 0.02, height: mediaQuery.size.height * 0.02,
), ),
Container( Container(width: mediaQuery.size.width * 1, height: mediaQuery.size.width * .6, child: LakumBannerWidget(model, mediaQuery, true)),
width: mediaQuery.size.width * 1,
height: mediaQuery.size.width * .6,
child: LakumBannerWidget(
model, mediaQuery, true)),
], ],
) )
], ],
@ -88,43 +79,17 @@ class LakumMainPage extends StatelessWidget {
), ),
Container( Container(
height: 110, height: 110,
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(horizontal: 16, vertical: 12.0),
horizontal: 16, vertical: 12.0),
child: ListView( child: ListView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
children: <Widget>[ children: <Widget>[
LacumPointsWidget( LacumPointsWidget(mediaQuery, 1, TranslationBase.of(context).balance, model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount,
mediaQuery, model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalance, null),
1,
TranslationBase.of(context).balance,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.pointsBalanceAmount,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.pointsBalance,
null),
SizedBox( SizedBox(
width: 8, width: 8,
), ),
LacumPointsWidget( LacumPointsWidget(mediaQuery, 2, TranslationBase.of(context).gained, model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount,
mediaQuery, model.lacumGroupInformation.lakumInquiryInformationObjVersion.gainedPoints, model.lacumGroupInformation.lakumInquiryInformationObjVersion.gainedPointsAmountPerYear),
2,
TranslationBase.of(context).gained,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.pointsBalanceAmount,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.gainedPoints,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.gainedPointsAmountPerYear),
SizedBox( SizedBox(
width: 8, width: 8,
), ),
@ -132,40 +97,16 @@ class LakumMainPage extends StatelessWidget {
mediaQuery, mediaQuery,
3, 3,
TranslationBase.of(context).consumed, TranslationBase.of(context).consumed,
model model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmount != null
.lacumGroupInformation ? num.parse(model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmount)
.lakumInquiryInformationObjVersion
.consumedPointsAmount !=
null
? int.parse(model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.consumedPointsAmount)
: 0, : 0,
model model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPoints,
.lacumGroupInformation model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmountPerYear),
.lakumInquiryInformationObjVersion
.consumedPoints,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.consumedPointsAmountPerYear),
SizedBox( SizedBox(
width: 8, width: 8,
), ),
LacumPointsWidget( LacumPointsWidget(mediaQuery, 4, TranslationBase.of(context).transferred, 0, model.lacumGroupInformation.lakumInquiryInformationObjVersion.transferPoints,
mediaQuery, model.lacumGroupInformation.lakumInquiryInformationObjVersion.transferPointsAmountPerYear),
4,
TranslationBase.of(context).transferred,
0,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.transferPoints,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.transferPointsAmountPerYear),
], ],
), ),
), ),
@ -189,8 +130,7 @@ class LakumMainPage extends StatelessWidget {
), ),
), ),
Container( Container(
margin: margin: EdgeInsets.symmetric(vertical: 16, horizontal: 8),
EdgeInsets.symmetric(vertical: 16, horizontal: 8),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -226,45 +166,39 @@ class LakumMainPage extends StatelessWidget {
// fontSize: 14, // fontSize: 14,
// ), // ),
Container( Container(
margin: margin: EdgeInsets.symmetric(vertical: 16, horizontal: 8),
EdgeInsets.symmetric(vertical: 16, horizontal: 8), child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
child: Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Image.asset(
children: [ "assets/images/pharmacy_module/lakum/waiting_gained_icon.png",
Image.asset( fit: BoxFit.fill,
"assets/images/pharmacy_module/lakum/waiting_gained_icon.png", width: 20,
fit: BoxFit.fill, height: 25,
width: 20,
height: 25,
),
Padding(
padding:
EdgeInsets.symmetric(horizontal: 8),
child: Texts(
TranslationBase.of(context)
.Waitinggained,
// "Waiting gained",
fontSize: 14,
),
)
],
),
Texts(
"${model.lacumGroupInformation.lakumInquiryInformationObjVersion.waitingPoints} ${TranslationBase.of(context).lakumPoint}",
fontWeight: FontWeight.bold,
fontSize: 14,
), ),
])), Padding(
padding: EdgeInsets.symmetric(horizontal: 8),
child: Texts(
TranslationBase.of(context).Waitinggained,
// "Waiting gained",
fontSize: 14,
),
)
],
),
Texts(
"${model.lacumGroupInformation.lakumInquiryInformationObjVersion.waitingPoints} ${TranslationBase.of(context).lakumPoint}",
fontWeight: FontWeight.bold,
fontSize: 14,
),
])),
// Texts( // Texts(
// "${model.lacumGroupInformation.lakumInquiryInformationObjVersion.waitingPoints} Points", // "${model.lacumGroupInformation.lakumInquiryInformationObjVersion.waitingPoints} Points",
// fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
// fontSize: 14, // fontSize: 14,
// ), // ),
Container( Container(
margin: margin: EdgeInsets.symmetric(vertical: 16, horizontal: 8),
EdgeInsets.symmetric(vertical: 16, horizontal: 8),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -317,11 +251,7 @@ class LakumMainPage extends StatelessWidget {
} }
navigateToLakumRegister(BuildContext context) { navigateToLakumRegister(BuildContext context) {
Navigator.pushReplacement( Navigator.pushReplacement(context, FadePage(page: LakumRegistrationPage(projectViewModel.user.patientIdentificationNo)));
context,
FadePage(
page: LakumRegistrationPage(
projectViewModel.user.patientIdentificationNo)));
} }
} }
@ -331,12 +261,7 @@ List<Widget> _buildAppBarICons(BuildContext context, LacumViewModel model) {
icon: Icon(Icons.settings), icon: Icon(Icons.settings),
color: Colors.white, color: Colors.white,
onPressed: () { onPressed: () {
Navigator.push( Navigator.push(context, FadePage(page: LakumSettingPage(model.lacumInformation, model.lacumGroupInformation))).then((result) => {model.getLacumGroupData()});
context,
FadePage(
page: LakumSettingPage(
model.lacumInformation, model.lacumGroupInformation)))
.then((result) => {model.getLacumGroupData()});
}, },
), ),
]; ];
@ -402,13 +327,9 @@ class LakumHomeButtons extends StatelessWidget {
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () { onTap: () {
print("Lacum transfer click"); Navigator.push(context, FadePage(page: LacumTransferPage(model.lacumInformation, model.lacumGroupInformation))).then((result) {
Navigator.push( model.getLacumGroupData();
context, });
FadePage(
page: LacumTransferPage(model.lacumInformation,
model.lacumGroupInformation)))
.then((result) => {model.getLacumGroupData()});
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric(horizontal: 8), padding: EdgeInsets.symmetric(horizontal: 8),
@ -460,8 +381,7 @@ class LacumPointsWidget extends StatelessWidget {
Color titleColor; Color titleColor;
final List<PointsAmountPerYear> pointsAmountPerYear; final List<PointsAmountPerYear> pointsAmountPerYear;
LacumPointsWidget(this.mediaQuery, this.pointType, this.title, this.riyal, LacumPointsWidget(this.mediaQuery, this.pointType, this.title, this.riyal, this.point, this.pointsAmountPerYear) {
this.point, this.pointsAmountPerYear) {
if (pointType == 1) { if (pointType == 1) {
titleColor = Color(0xffefefef); titleColor = Color(0xffefefef);
} else if (pointType == 2) { } else if (pointType == 2) {
@ -480,11 +400,9 @@ class LacumPointsWidget extends StatelessWidget {
onTap: () { onTap: () {
if (pointType != 1) { if (pointType != 1) {
if (pointsAmountPerYear != null && pointsAmountPerYear.length > 0) { if (pointsAmountPerYear != null && pointsAmountPerYear.length > 0) {
Navigator.push(context, Navigator.push(context, FadePage(page: LakumPointsYearPage(pointsAmountPerYear)));
FadePage(page: LakumPointsYearPage(pointsAmountPerYear)));
} else { } else {
AppToast.showErrorToast( AppToast.showErrorToast(message: TranslationBase.of(context).lakumMsg);
message: TranslationBase.of(context).lakumMsg);
// show snackBar No Details Points are there // show snackBar No Details Points are there
} }
} }

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/PointsAmountPerMonth.
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/lacum-viewmodel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/lacum-viewmodel.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/lakum-point-table-row-widget.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/lakum-point-table-row-widget.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -26,9 +27,13 @@ class _LakumPointsMonthPageState extends State<LakumPointMonthPage> {
return BaseView<LacumViewModel>( return BaseView<LacumViewModel>(
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
title: TranslationBase.of(context).LakumPoint, appBarTitle: TranslationBase.of(context).LakumPoint,
isShowAppBar: true, isShowAppBar: true,
isPharmacy: true,
showPharmacyCart: false,
isShowDecPage: false, isShowDecPage: false,
showHomeAppBarIcon: false,
isBottomBar: true,
backgroundColor: Colors.white, backgroundColor: Colors.white,
baseViewModel: model, baseViewModel: model,
body: Container( body: Container(
@ -50,16 +55,14 @@ class _LakumPointsMonthPageState extends State<LakumPointMonthPage> {
children: [ children: [
Container( Container(
height: mediaQuery.size.height * 0.06, height: mediaQuery.size.height * 0.06,
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(vertical: 16, horizontal: 24),
vertical: 16, horizontal: 24),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Texts( Texts(
TranslationBase.of(context).month, TranslationBase.of(context).month,
@ -78,15 +81,12 @@ class _LakumPointsMonthPageState extends State<LakumPointMonthPage> {
Expanded( Expanded(
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceEvenly,
MainAxisAlignment.spaceEvenly,
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.end,
MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [ children: [
Texts( Texts(
TranslationBase.of(context).point, TranslationBase.of(context).point,
@ -110,10 +110,8 @@ class _LakumPointsMonthPageState extends State<LakumPointMonthPage> {
), ),
Expanded( Expanded(
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.end,
MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [ children: [
Texts( Texts(
TranslationBase.of(context).riyal, TranslationBase.of(context).riyal,
@ -143,16 +141,14 @@ class _LakumPointsMonthPageState extends State<LakumPointMonthPage> {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
LakumPointTableRowWidget(true, "DAY", 0, 0, null, 0), LakumPointTableRowWidget(true, "DATE", 0, 0, null, 0),
...List.generate( ...List.generate(
widget.pointsAmountPerMonth.pointsAmountPerday.length, widget.pointsAmountPerMonth.pointsAmountPerday.length,
(index) => LakumPointTableRowWidget( (index) => LakumPointTableRowWidget(
false, false,
widget.pointsAmountPerMonth.pointsAmountPerday[index].day, DateUtil.getWeekDayMonthDayYearDateFormatted(DateUtil.convertStringToDate(widget.pointsAmountPerMonth.pointsAmountPerday[index].transationDate), "en"),
widget.pointsAmountPerMonth.pointsAmountPerday[index] widget.pointsAmountPerMonth.pointsAmountPerday[index].pointsPerDay,
.pointsPerDay, widget.pointsAmountPerMonth.pointsAmountPerday[index].amountPerDay,
widget.pointsAmountPerMonth.pointsAmountPerday[index]
.amountPerDay,
() { () {
setState(() { setState(() {
if (widget.expandedItemIndex == index) { if (widget.expandedItemIndex == index) {
@ -167,22 +163,11 @@ class _LakumPointsMonthPageState extends State<LakumPointMonthPage> {
collapsed: Column( collapsed: Column(
children: [ children: [
...List.generate( ...List.generate(
widget.pointsAmountPerMonth.pointsAmountPerday[index] widget.pointsAmountPerMonth.pointsAmountPerday[index].pointsDetails.length,
.pointsDetails.length,
(index) => DayPointsDetailWidget( (index) => DayPointsDetailWidget(
widget widget.pointsAmountPerMonth.pointsAmountPerday[index].pointsDetails[index].subTransactionTypeDescription,
.pointsAmountPerMonth widget.pointsAmountPerMonth.pointsAmountPerday[index].pointsDetails[index].purchasePoints,
.pointsAmountPerday[index] widget.pointsAmountPerMonth.pointsAmountPerday[index].pointsDetails[index].amount),
.pointsDetails[index]
.subTransactionTypeDescription,
widget
.pointsAmountPerMonth
.pointsAmountPerday[index]
.pointsDetails[index].purchasePoints,
widget
.pointsAmountPerMonth
.pointsAmountPerday[index]
.pointsDetails[index].amount),
), ),
], ],
), ),
@ -199,8 +184,8 @@ class _LakumPointsMonthPageState extends State<LakumPointMonthPage> {
class DayPointsDetailWidget extends StatelessWidget { class DayPointsDetailWidget extends StatelessWidget {
final String rowTitle; final String rowTitle;
final double points; final num points;
final double riyal; final num riyal;
DayPointsDetailWidget(this.rowTitle, this.points, this.riyal); DayPointsDetailWidget(this.rowTitle, this.points, this.riyal);
@ -237,7 +222,6 @@ class DayPointsDetailWidget extends StatelessWidget {
), ),
)), )),
Expanded( Expanded(
child: Container( child: Container(
child: Texts( child: Texts(
"$points", "$points",

@ -27,9 +27,13 @@ class _LakumPointsYearPageState extends State<LakumPointsYearPage> {
return BaseView<LacumViewModel>( return BaseView<LacumViewModel>(
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
title: TranslationBase.of(context).LakumPoint, appBarTitle: TranslationBase.of(context).LakumPoint,
isShowAppBar: true, isShowAppBar: true,
isPharmacy: true,
showPharmacyCart: false,
isShowDecPage: false, isShowDecPage: false,
showHomeAppBarIcon: false,
isBottomBar: true,
backgroundColor: Colors.white, backgroundColor: Colors.white,
baseViewModel: model, baseViewModel: model,
body: Container( body: Container(
@ -103,6 +107,7 @@ class LacumPointsYearWidget extends StatelessWidget {
child: Container( child: Container(
width: mediaQuery.size.width / 2 - 16, width: mediaQuery.size.width / 2 - 16,
padding: EdgeInsets.only(top: 12, left: 8, right: 8, bottom: 4), padding: EdgeInsets.only(top: 12, left: 8, right: 8, bottom: 4),
margin: EdgeInsets.only(right: 8.0),
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
@ -175,7 +180,7 @@ class LacumPointsYearWidget extends StatelessWidget {
children: [ children: [
Texts(TranslationBase.of(context).sar, Texts(TranslationBase.of(context).sar,
// "RIYAL", // "RIYAL",
fontSize: 13, fontSize: 12,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: isSelected ? Colors.white : Colors.black, color: isSelected ? Colors.white : Colors.black,
), ),

@ -5,8 +5,8 @@ import 'package:flutter/material.dart';
class LakumPointTableRowWidget extends StatefulWidget { class LakumPointTableRowWidget extends StatefulWidget {
final bool isTableTitle; // true : title , false: row final bool isTableTitle; // true : title , false: row
final String rowTitle; final String rowTitle;
final double points; final num points;
final double riyal; final num riyal;
final Function onTap; final Function onTap;
final int rowIndex; final int rowIndex;
final Widget collapsed; final Widget collapsed;

@ -158,8 +158,6 @@ class _PharmacyAddressesState extends State<PharmacyAddressesPage> {
_navigateToPaymentOption(model) { _navigateToPaymentOption(model) {
if (widget.isUpdate) { if (widget.isUpdate) {
print("sfsf");
widget.orderPreviewViewModel.paymentCheckoutData.address = Addresses.fromJson(model.addresses[model.selectedAddressIndex].toJson()); widget.orderPreviewViewModel.paymentCheckoutData.address = Addresses.fromJson(model.addresses[model.selectedAddressIndex].toJson());
widget.changeMainState(); widget.changeMainState();
Navigator.pop(context); Navigator.pop(context);

@ -63,8 +63,6 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
customerId = custID; customerId = custID;
customerGUID = custGUID; customerGUID = custGUID;
}); });
print("customer Id is" + customerId);
print("customer GUID is" + customerGUID);
return customerId; return customerId;
} }
@ -74,8 +72,6 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
user = AuthenticatedUser.fromJson(userData); user = AuthenticatedUser.fromJson(userData);
setState(() { setState(() {
firstName = user.firstName.toString(); firstName = user.firstName.toString();
print("this is user" + user.firstName.toString());
print("this is user" + user.firstNameN.toString());
}); });
} else { } else {
if (userData == null) { if (userData == null) {

@ -134,20 +134,20 @@ class Signaling {
void registerPeerConnectionListeners() { void registerPeerConnectionListeners() {
peerConnection.onIceCandidate = (RTCIceCandidate candidate){ peerConnection.onIceCandidate = (RTCIceCandidate candidate){
print(json.encode(candidate.toMap())); // print(json.encode(candidate.toMap()));
signalR.addIceCandidate(json.encode(candidate.toMap())); signalR.addIceCandidate(json.encode(candidate.toMap()));
}; };
peerConnection?.onIceGatheringState = (RTCIceGatheringState state) { peerConnection?.onIceGatheringState = (RTCIceGatheringState state) {
print('ICE gathering state changed: $state'); // print('ICE gathering state changed: $state');
}; };
peerConnection?.onConnectionState = (RTCPeerConnectionState state) { peerConnection?.onConnectionState = (RTCPeerConnectionState state) {
print('Connection state change: $state ${state.index}'); // print('Connection state change: $state ${state.index}');
}; };
peerConnection?.onSignalingState = (RTCSignalingState state) { peerConnection?.onSignalingState = (RTCSignalingState state) {
print('Signaling state change: $state'); // print('Signaling state change: $state');
}; };
} }
} }

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/material.dart';
class CancelOrderService extends BaseService{ class CancelOrderService extends BaseService{

@ -28,8 +28,6 @@ class ReviewService extends BaseService {
_reviewList.clear(); _reviewList.clear();
response['reviews'].forEach((item) { response['reviews'].forEach((item) {
_reviewList.add(Review.fromJson(item)); _reviewList.add(Review.fromJson(item));
print (response);
print (item['reviewText']);
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;

@ -50,7 +50,7 @@
// await Future.delayed(Duration(seconds: 2)); // await Future.delayed(Duration(seconds: 2));
// _registerIsolatePort(); // _registerIsolatePort();
// _registerGeofences().then((value) { // _registerGeofences().then((value) {
// debugPrint(value.toString()); // print(value.toString());
// if(_testTrigger) { // if(_testTrigger) {
// var events = [GeofenceEvent.enter,GeofenceEvent.exit]; // var events = [GeofenceEvent.enter,GeofenceEvent.exit];
// events.shuffle(); // events.shuffle();
@ -91,9 +91,9 @@
// break; // break;
// } // }
// await Future.delayed(Duration(milliseconds: 100)); // await Future.delayed(Duration(milliseconds: 100));
// debugPrint("Geofence: ${zone.description} registered"); // print("Geofence: ${zone.description} registered");
// } else { // } else {
// debugPrint("Geofence: ${zone.description} registered"); // print("Geofence: ${zone.description} registered");
// } // }
// } // }
// } // }

@ -318,9 +318,6 @@ class DateUtil {
/// [dateTime] convert DateTime to date formatted /// [dateTime] convert DateTime to date formatted
static String getWeekDayMonthDayYearDateFormatted( static String getWeekDayMonthDayYearDateFormatted(
DateTime dateTime, String lang) { DateTime dateTime, String lang) {
// print(dateTime);
// print(dateTime.weekday);
// print(dateTime.weekday.getDayOfWeekEnumValue.value);
if (dateTime != null) if (dateTime != null)
return lang == 'en' return lang == 'en'
? getWeekDayEnglish(dateTime.weekday) + ? getWeekDayEnglish(dateTime.weekday) +

@ -83,7 +83,7 @@ class LocationUtils {
callBack(LatLng(location.latitude, location.longitude)); callBack(LatLng(location.latitude, location.longitude));
setLocation(Position(latitude: location.latitude, longitude: location.longitude, altitude: location.altitude)); setLocation(Position(latitude: location.latitude, longitude: location.longitude, altitude: location.altitude));
}, onLocationAvailability: (locationAvailability) { }, onLocationAvailability: (locationAvailability) {
debugPrint("onLocationAvailability: $locationAvailability"); print("onLocationAvailability: $locationAvailability");
})); }));
}).catchError((error) { }).catchError((error) {
if (error.code == "LOCATION_SETTINGS_NOT_AVAILABLE") { if (error.code == "LOCATION_SETTINGS_NOT_AVAILABLE") {

@ -31,9 +31,6 @@ Future<dynamic> backgroundMessageHandler(dynamic message) async{
_incomingCall(message_.data); _incomingCall(message_.data);
return; return;
} }
print("Background message is received, sending local notification.");
h_push.Push.localNotification({ h_push.Push.localNotification({
h_push.HMSLocalNotificationAttr.TITLE: 'Background Message', h_push.HMSLocalNotificationAttr.TITLE: 'Background Message',
h_push.HMSLocalNotificationAttr.MESSAGE: "By: BackgroundMessageHandler" h_push.HMSLocalNotificationAttr.MESSAGE: "By: BackgroundMessageHandler"
@ -155,7 +152,6 @@ class PushNotificationHandler{
newMessage(RemoteMessage remoteMessage){ newMessage(RemoteMessage remoteMessage){
print('RemoteMessage.data:: ${remoteMessage.data}');
if(remoteMessage.data['is_call'] == 'true' || remoteMessage.data['is_call'] == true) if(remoteMessage.data['is_call'] == 'true' || remoteMessage.data['is_call'] == true)
_incomingCall(remoteMessage.data); _incomingCall(remoteMessage.data);

@ -12,6 +12,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrders.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart';
@ -68,10 +69,8 @@ class Utils {
/// Check The Internet Connection /// Check The Internet Connection
static Future<bool> checkConnection() async { static Future<bool> checkConnection() async {
ConnectivityResult connectivityResult = ConnectivityResult connectivityResult = await (Connectivity().checkConnectivity());
await (Connectivity().checkConnectivity()); if ((connectivityResult == ConnectivityResult.mobile) || (connectivityResult == ConnectivityResult.wifi)) {
if ((connectivityResult == ConnectivityResult.mobile) ||
(connectivityResult == ConnectivityResult.wifi)) {
return true; return true;
} else { } else {
return false; return false;
@ -135,19 +134,11 @@ class Utils {
} }
static String getAppointmentTransID(int projectID, int clinicID, int appoNo) { static String getAppointmentTransID(int projectID, int clinicID, int appoNo) {
return projectID.toString() + return projectID.toString() + '-' + clinicID.toString() + '-' + appoNo.toString();
'-' +
clinicID.toString() +
'-' +
appoNo.toString();
} }
static String getAdvancePaymentTransID(int projectID, int fileNumber) { static String getAdvancePaymentTransID(int projectID, int fileNumber) {
return projectID.toString() + return projectID.toString() + '-' + fileNumber.toString() + '-' + DateTime.now().millisecondsSinceEpoch.toString();
'-' +
fileNumber.toString() +
'-' +
DateTime.now().millisecondsSinceEpoch.toString();
} }
bool validateIDBox(String value, type) { bool validateIDBox(String value, type) {
@ -207,22 +198,14 @@ class Utils {
} }
static validEmail(email) { static validEmail(email) {
return RegExp( return RegExp(r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+").hasMatch(email);
r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+")
.hasMatch(email);
} }
static List<Widget> myMedicalList( static List<Widget> myMedicalList({ProjectViewModel projectViewModel, BuildContext context, bool isLogin, count}) {
{ProjectViewModel projectViewModel,
BuildContext context,
bool isLogin,
count}) {
List<Widget> medical = List(); List<Widget> medical = List();
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(5) onTap: () => projectViewModel.havePrivilege(5) ? Navigator.push(context, FadePage(page: MyAppointments())) : null,
? Navigator.push(context, FadePage(page: MyAppointments()))
: null,
child: isLogin child: isLogin
? Stack(children: [ ? Stack(children: [
Container( Container(
@ -249,11 +232,7 @@ class Utils {
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(
padding: EdgeInsets.all(2.0), padding: EdgeInsets.all(2.0),
child: Text(count.toString(), child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)),
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 12.0)),
), ),
), ),
) )
@ -271,11 +250,7 @@ class Utils {
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(
padding: EdgeInsets.all(2.0), padding: EdgeInsets.all(2.0),
child: Text(count.toString(), child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)),
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 12.0)),
), ),
), ),
) )
@ -302,9 +277,7 @@ class Utils {
} }
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(7) onTap: () => projectViewModel.havePrivilege(7) ? Navigator.push(context, FadePage(page: RadiologyHomePage())) : null,
? Navigator.push(context, FadePage(page: RadiologyHomePage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).radiology, title: TranslationBase.of(context).radiology,
imagePath: 'radiology.svg', imagePath: 'radiology.svg',
@ -314,9 +287,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(12) onTap: () => projectViewModel.havePrivilege(12) ? Navigator.push(context, FadePage(page: HomePrescriptionsPage())) : null,
? Navigator.push(context, FadePage(page: HomePrescriptionsPage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).medicines, title: TranslationBase.of(context).medicines,
imagePath: 'medicine_prescription.svg', imagePath: 'medicine_prescription.svg',
@ -342,8 +313,7 @@ class Utils {
medical.add(InkWell( medical.add(InkWell(
onTap: () { onTap: () {
if (projectViewModel.havePrivilege(48)) if (projectViewModel.havePrivilege(48)) Navigator.push(context, FadePage(page: ActiveMedicationsPage()));
Navigator.push(context, FadePage(page: ActiveMedicationsPage()));
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).myMedical, title: TranslationBase.of(context).myMedical,
@ -362,17 +332,12 @@ class Utils {
), ),
) )
: null, : null,
child: MedicalProfileItem( child:
title: TranslationBase.of(context).myDoctor, MedicalProfileItem(title: TranslationBase.of(context).myDoctor, imagePath: 'my_doc.svg', subTitle: TranslationBase.of(context).myDoctorSubtitle, isEnable: projectViewModel.havePrivilege(6)),
imagePath: 'my_doc.svg',
subTitle: TranslationBase.of(context).myDoctorSubtitle,
isEnable: projectViewModel.havePrivilege(6)),
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(14) onTap: () => projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: MyInvoices())) : null,
? Navigator.push(context, FadePage(page: MyInvoices()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).invoicesList, title: TranslationBase.of(context).invoicesList,
imagePath: 'invoice_list.svg', imagePath: 'invoice_list.svg',
@ -382,9 +347,18 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(14) onTap: () => projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: AnicllaryOrders())) : null,
? Navigator.push(context, FadePage(page: EyeMeasurementsPage())) child: MedicalProfileItem(
: null, title: TranslationBase.of(context).anicllaryOrders,
imagePath: 'assets/images/al-habib_online_payment_service_icon.png',
isPngImage: true,
subTitle: TranslationBase.of(context).myInvoice,
isEnable: projectViewModel.havePrivilege(14),
),
));
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: EyeMeasurementsPage())) : null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).eye, title: TranslationBase.of(context).eye,
imagePath: 'eye_measurement.svg', imagePath: 'eye_measurement.svg',
@ -394,9 +368,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(22) onTap: () => projectViewModel.havePrivilege(22) ? Navigator.push(context, FadePage(page: InsuranceCard())) : null,
? Navigator.push(context, FadePage(page: InsuranceCard()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).insurance, title: TranslationBase.of(context).insurance,
imagePath: 'insurance_card.svg', imagePath: 'insurance_card.svg',
@ -417,9 +389,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(18) onTap: () => projectViewModel.havePrivilege(18) ? Navigator.push(context, FadePage(page: InsuranceApproval())) : null,
? Navigator.push(context, FadePage(page: InsuranceApproval()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).insuranceApproval, title: TranslationBase.of(context).insuranceApproval,
imagePath: 'insurance_approval.svg', imagePath: 'insurance_approval.svg',
@ -429,9 +399,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(23) onTap: () => projectViewModel.havePrivilege(23) ? Navigator.push(context, FadePage(page: AllergiesPage())) : null,
? Navigator.push(context, FadePage(page: AllergiesPage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).allergies, title: TranslationBase.of(context).allergies,
imagePath: 'allergies_diagnosed.svg', imagePath: 'allergies_diagnosed.svg',
@ -441,9 +409,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(26) onTap: () => projectViewModel.havePrivilege(26) ? Navigator.push(context, FadePage(page: MyVaccines())) : null,
? Navigator.push(context, FadePage(page: MyVaccines()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).myVaccines, title: TranslationBase.of(context).myVaccines,
imagePath: 'vaccine_list.svg', imagePath: 'vaccine_list.svg',
@ -453,9 +419,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(20) onTap: () => projectViewModel.havePrivilege(20) ? Navigator.push(context, FadePage(page: HomeReportPage())) : null,
? Navigator.push(context, FadePage(page: HomeReportPage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).medical, title: TranslationBase.of(context).medical,
imagePath: 'medical_report.svg', imagePath: 'medical_report.svg',
@ -465,9 +429,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(19) onTap: () => projectViewModel.havePrivilege(19) ? Navigator.push(context, FadePage(page: MonthlyReportsPage())) : null,
? Navigator.push(context, FadePage(page: MonthlyReportsPage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).monthly, title: TranslationBase.of(context).monthly,
imagePath: 'monthly_report.svg', imagePath: 'monthly_report.svg',
@ -477,9 +439,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(16) onTap: () => projectViewModel.havePrivilege(16) ? Navigator.push(context, FadePage(page: PatientSickLeavePage())) : null,
? Navigator.push(context, FadePage(page: PatientSickLeavePage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).sick, title: TranslationBase.of(context).sick,
imagePath: 'sick_leave.svg', imagePath: 'sick_leave.svg',
@ -489,9 +449,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(47) onTap: () => projectViewModel.havePrivilege(47) ? Navigator.push(context, FadePage(page: MyBalancePage())) : null,
? Navigator.push(context, FadePage(page: MyBalancePage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).myBalance, title: TranslationBase.of(context).myBalance,
imagePath: 'balance_credit.svg', imagePath: 'balance_credit.svg',
@ -508,9 +466,7 @@ class Utils {
// )); // ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(24) onTap: () => projectViewModel.havePrivilege(24) ? Navigator.push(context, FadePage(page: MyTrackers())) : null,
? Navigator.push(context, FadePage(page: MyTrackers()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).myTrackers, title: TranslationBase.of(context).myTrackers,
imagePath: 'tracker.svg', imagePath: 'tracker.svg',
@ -520,9 +476,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(30) onTap: () => projectViewModel.havePrivilege(30) ? Navigator.push(context, FadePage(page: SmartWatchInstructions())) : null,
? Navigator.push(context, FadePage(page: SmartWatchInstructions()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).smartWatchesSubtitle, title: TranslationBase.of(context).smartWatchesSubtitle,
imagePath: 'smart_watch.svg', imagePath: 'smart_watch.svg',
@ -532,14 +486,9 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(28) onTap: () => projectViewModel.havePrivilege(28) ? Navigator.push(context, FadePage(page: AskDoctorHomPage())) : null,
? Navigator.push(context, FadePage(page: AskDoctorHomPage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).askYourSubtitle, title: TranslationBase.of(context).askYourSubtitle, imagePath: 'ask_doctor.svg', subTitle: TranslationBase.of(context).askYour, isEnable: projectViewModel.havePrivilege(28)),
imagePath: 'ask_doctor.svg',
subTitle: TranslationBase.of(context).askYour,
isEnable: projectViewModel.havePrivilege(28)),
)); ));
if (projectViewModel.havePrivilege(32) || true) { if (projectViewModel.havePrivilege(32) || true) {
@ -549,18 +498,13 @@ class Utils {
if (projectViewModel.isLogin && userData_ != null) { if (projectViewModel.isLogin && userData_ != null) {
String patientID = userData_.patientID.toString(); String patientID = userData_.patientID.toString();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
projectViewModel projectViewModel.platformBridge().connectHMGInternetWifi(patientID).then((value) => {GifLoaderDialogUtils.hideDialog(context)}).catchError((err) {
.platformBridge()
.connectHMGInternetWifi(patientID)
.then((value) => {GifLoaderDialogUtils.hideDialog(context)})
.catchError((err) {
print(err.toString()); print(err.toString());
}); });
} else { } else {
AlertDialogBox( AlertDialogBox(
context: context, context: context,
confirmMessage: confirmMessage: "Please login with your account first to use this feature",
"Please login with your account first to use this feature",
okText: "OK", okText: "OK",
okFunction: () { okFunction: () {
AlertDialogBox.closeAlertDialog(context); AlertDialogBox.closeAlertDialog(context);
@ -577,9 +521,7 @@ class Utils {
} }
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(40) onTap: () => projectViewModel.havePrivilege(40) ? launch('whatsapp://send?phone=18885521858&text=') : null,
? launch('whatsapp://send?phone=18885521858&text=')
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).chatbot, title: TranslationBase.of(context).chatbot,
imagePath: 'chatbot.svg', imagePath: 'chatbot.svg',
@ -591,17 +533,11 @@ class Utils {
return medical; return medical;
} }
static List<Widget> myMedicalListHomePage( static List<Widget> myMedicalListHomePage({ProjectViewModel projectViewModel, BuildContext context, bool isLogin, count}) {
{ProjectViewModel projectViewModel,
BuildContext context,
bool isLogin,
count}) {
List<Widget> medical = List(); List<Widget> medical = List();
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(5) onTap: () => projectViewModel.havePrivilege(5) ? Navigator.push(context, FadePage(page: MyAppointments())) : null,
? Navigator.push(context, FadePage(page: MyAppointments()))
: null,
child: isLogin child: isLogin
? Stack(children: [ ? Stack(children: [
MedicalProfileItem( MedicalProfileItem(
@ -624,11 +560,7 @@ class Utils {
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(
padding: EdgeInsets.all(2.0), padding: EdgeInsets.all(2.0),
child: Text(count.toString(), child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)),
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 12.0)),
), ),
), ),
) )
@ -646,11 +578,7 @@ class Utils {
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(
padding: EdgeInsets.all(2.0), padding: EdgeInsets.all(2.0),
child: Text(count.toString(), child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)),
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 12.0)),
), ),
), ),
) )
@ -677,9 +605,7 @@ class Utils {
} }
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(7) onTap: () => projectViewModel.havePrivilege(7) ? Navigator.push(context, FadePage(page: RadiologyHomePage())) : null,
? Navigator.push(context, FadePage(page: RadiologyHomePage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).radiology, title: TranslationBase.of(context).radiology,
imagePath: 'radiology.svg', imagePath: 'radiology.svg',
@ -689,9 +615,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(12) onTap: () => projectViewModel.havePrivilege(12) ? Navigator.push(context, FadePage(page: HomePrescriptionsPage())) : null,
? Navigator.push(context, FadePage(page: HomePrescriptionsPage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).medicines, title: TranslationBase.of(context).medicines,
imagePath: 'medicine_prescription.svg', imagePath: 'medicine_prescription.svg',
@ -709,24 +633,19 @@ class Utils {
), ),
) )
: null, : null,
child: MedicalProfileItem( child:
title: TranslationBase.of(context).myDoctor, MedicalProfileItem(title: TranslationBase.of(context).myDoctor, imagePath: 'my_doc.svg', subTitle: TranslationBase.of(context).myDoctorSubtitle, isEnable: projectViewModel.havePrivilege(6)),
imagePath: 'my_doc.svg',
subTitle: TranslationBase.of(context).myDoctorSubtitle,
isEnable: projectViewModel.havePrivilege(6)),
)); ));
return medical; return medical;
} }
static Widget loadNetworkImage( static Widget loadNetworkImage({@required String url, BoxFit fitting = BoxFit.cover}) {
{@required String url, BoxFit fitting = BoxFit.cover}) {
return CachedNetworkImage( return CachedNetworkImage(
placeholderFadeInDuration: Duration(milliseconds: 250), placeholderFadeInDuration: Duration(milliseconds: 250),
fit: fitting, fit: fitting,
imageUrl: url, imageUrl: url,
placeholder: (context, url) => placeholder: (context, url) => Container(child: Center(child: CircularProgressIndicator())),
Container(child: Center(child: CircularProgressIndicator())),
errorWidget: (context, url, error) { errorWidget: (context, url, error) {
return Icon( return Icon(
Icons.error, Icons.error,
@ -744,11 +663,7 @@ class Utils {
} }
static navigateToCartPage() { static navigateToCartPage() {
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(locator<NavigationService>().navigatorKey.currentContext, MaterialPageRoute(builder: (context) => LandingPagePharmacy(currentTab: 3)), (Route<dynamic> r) => false);
locator<NavigationService>().navigatorKey.currentContext,
MaterialPageRoute(
builder: (context) => LandingPagePharmacy(currentTab: 3)),
(Route<dynamic> r) => false);
} }
static Widget tableColumnTitle(String text, {bool showDivider = true}) { static Widget tableColumnTitle(String text, {bool showDivider = true}) {
@ -759,12 +674,7 @@ class Utils {
SizedBox(height: 6), SizedBox(height: 6),
Text( Text(
text, text,
style: TextStyle( style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12),
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.48,
height: 18 / 12),
), ),
SizedBox(height: 5), SizedBox(height: 5),
if (showDivider) if (showDivider)
@ -777,27 +687,16 @@ class Utils {
); );
} }
static Widget tableColumnValue(String text, static Widget tableColumnValue(String text, {bool isLast = false, bool isCapitable = true, ProjectViewModel mProjectViewModel}) {
{bool isLast = false, ProjectViewModel projectViewModel = mProjectViewModel ?? Provider.of(AppGlobal.context);
bool isCapitable = true,
ProjectViewModel mProjectViewModel}) {
ProjectViewModel projectViewModel =
mProjectViewModel ?? Provider.of(AppGlobal.context);
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
SizedBox(height: 12), SizedBox(height: 12),
Text( Text(
isCapitable && !projectViewModel.isArabic isCapitable && !projectViewModel.isArabic ? text.toLowerCase().capitalizeFirstofEach : text,
? text.toLowerCase().capitalizeFirstofEach style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
: text,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xff575757),
letterSpacing: -0.4,
height: 16 / 10),
), ),
SizedBox(height: 12), SizedBox(height: 12),
if (!isLast) if (!isLast)
@ -810,8 +709,7 @@ class Utils {
); );
} }
static Widget tableColumnValueWithUnderLine(String text, static Widget tableColumnValueWithUnderLine(String text, {bool isLast = false, bool isCapitable = true}) {
{bool isLast = false, bool isCapitable = true}) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -822,13 +720,7 @@ class Utils {
isCapitable ? text.toLowerCase().capitalizeFirstofEach : text, isCapitable ? text.toLowerCase().capitalizeFirstofEach : text,
maxLines: 1, maxLines: 1,
minFontSize: 6, minFontSize: 6,
style: TextStyle( style: TextStyle(decoration: TextDecoration.underline, fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xffD02127), letterSpacing: -0.48, height: 18 / 12),
decoration: TextDecoration.underline,
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xffD02127),
letterSpacing: -0.48,
height: 18 / 12),
), ),
SizedBox(height: 10), SizedBox(height: 10),
if (!isLast) if (!isLast)
@ -842,13 +734,7 @@ class Utils {
} }
} }
Widget applyShadow( Widget applyShadow({Color color = Colors.grey, double shadowOpacity = 0.5, double spreadRadius = 2, double blurRadius = 7, Offset offset = const Offset(2, 2), @required Widget child}) {
{Color color = Colors.grey,
double shadowOpacity = 0.5,
double spreadRadius = 2,
double blurRadius = 7,
Offset offset = const Offset(2, 2),
@required Widget child}) {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
boxShadow: [ boxShadow: [
@ -865,8 +751,7 @@ Widget applyShadow(
} }
Future<AuthenticatedUser> userData() async { Future<AuthenticatedUser> userData() async {
var userData = AuthenticatedUser.fromJson( var userData = AuthenticatedUser.fromJson(await AppSharedPreferences().getObject(MAIN_USER));
await AppSharedPreferences().getObject(MAIN_USER));
return userData; return userData;
} }
@ -880,12 +765,9 @@ extension IndexedIterable<E> on Iterable<E> {
openAppStore({String androidPackageName, String iOSAppID}) async { openAppStore({String androidPackageName, String iOSAppID}) async {
if (Platform.isAndroid) { if (Platform.isAndroid) {
assert(!(androidPackageName == null), assert(!(androidPackageName == null), "Should have valid value in androidPackageName parameter");
"Should have valid value in androidPackageName parameter"); if ((await FlutterHmsGmsAvailability.isGmsAvailable)) launch("market://details?id=com.ejada.hmg");
if ((await FlutterHmsGmsAvailability.isGmsAvailable)) if ((await FlutterHmsGmsAvailability.isHmsAvailable)) launch("appmarket://details?id=com.ejada.hmg");
launch("market://details?id=com.ejada.hmg");
if ((await FlutterHmsGmsAvailability.isHmsAvailable))
launch("appmarket://details?id=com.ejada.hmg");
} else if (Platform.isIOS) { } else if (Platform.isIOS) {
assert((iOSAppID == null), "Should have valid value in iOSAppID parameter"); assert((iOSAppID == null), "Should have valid value in iOSAppID parameter");
launch("https://itunes.apple.com/kr/app/apple-store/$iOSAppID)"); launch("https://itunes.apple.com/kr/app/apple-store/$iOSAppID)");
@ -911,11 +793,7 @@ String labelFrom({@required String className}) {
extension StringExtension on String { extension StringExtension on String {
String capitalize() { String capitalize() {
return this.splitMapJoin(RegExp(r'\w+'), return this.splitMapJoin(RegExp(r'\w+'), onMatch: (m) => '${m.group(0)}'.substring(0, 1).toUpperCase() + '${m.group(0)}'.substring(1).toLowerCase(), onNonMatch: (n) => ' ');
onMatch: (m) =>
'${m.group(0)}'.substring(0, 1).toUpperCase() +
'${m.group(0)}'.substring(1).toLowerCase(),
onNonMatch: (n) => ' ');
} }
} }

@ -101,7 +101,7 @@ class MyInAppBrowser extends InAppBrowser {
// @override // @override
// Future<ShouldOverrideUrlLoadingAction> shouldOverrideUrlLoading(ShouldOverrideUrlLoadingRequest shouldOverrideUrlLoadingRequest) async { // Future<ShouldOverrideUrlLoadingAction> shouldOverrideUrlLoading(ShouldOverrideUrlLoadingRequest shouldOverrideUrlLoadingRequest) async {
// var url = shouldOverrideUrlLoadingRequest.url; // var url = shouldOverrideUrlLoadingRequest.url;
// debugPrint("redirecting/overriding to: $url"); // print("redirecting/overriding to: $url");
// //
// if (paymentType == _PAYMENT_TYPE.PACKAGES && [PACKAGES_PAYMENT_SUCCESS_URL, PACKAGES_PAYMENT_FAIL_URL].contains(url)) { // if (paymentType == _PAYMENT_TYPE.PACKAGES && [PACKAGES_PAYMENT_SUCCESS_URL, PACKAGES_PAYMENT_FAIL_URL].contains(url)) {
// isPaymentDone = (url == PACKAGES_PAYMENT_SUCCESS_URL); // isPaymentDone = (url == PACKAGES_PAYMENT_SUCCESS_URL);

Loading…
Cancel
Save