Services page changes & API implementation

master
haroon amjad 16 hours ago
parent 1d3683d4b5
commit 65d05ea584

@ -21,8 +21,8 @@ var PACKAGES_ORDERS = '/api/orders';
var PACKAGES_ORDER_HISTORY = '/api/orders/items';
var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// var BASE_URL = 'http://10.50.100.198:2018/';
// var BASE_URL = 'https://uat.hmgwebservices.com/';
var BASE_URL = 'https://hmgwebservices.com/';
var BASE_URL = 'https://uat.hmgwebservices.com/';
// var BASE_URL = 'https://hmgwebservices.com/';
// var BASE_URL = 'http://10.201.204.103/';
// var BASE_URL = 'https://orash.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/';
@ -709,6 +709,9 @@ var GET_PRESCRIPTION_INSTRUCTIONS_PDF = 'Services/ChatBot_Service.svc/REST/Chatb
//PAYFORT
var getPayFortProjectDetails = "Services/PayFort_Serv.svc/REST/GetPayFortProjectDetails";
var addPayFortApplePayResponse = "Services/PayFort_Serv.svc/REST/AddResponse";
var GET_SERVICES_PRICE_LIST = 'Services/OUTPs.svc/REST/GetServicesPriceList';
var payFortEnvironment = FortEnvironment.production;
var applePayMerchantId = "merchant.com.hmgwebservices";
// var payFortEnvironment = FortEnvironment.test;

@ -0,0 +1,54 @@
class ServicesPriceListResponseModel {
int? createdBy;
String? createdOn;
int? editedBy;
String? editedOn;
int? id;
bool? isEnabled;
String? nameAR;
String? nameEN;
num? price;
int? rowID;
ServicesPriceListResponseModel({
this.createdBy,
this.createdOn,
this.editedBy,
this.editedOn,
this.id,
this.isEnabled,
this.nameAR,
this.nameEN,
this.price,
this.rowID,
});
ServicesPriceListResponseModel.fromJson(Map<String, dynamic> json) {
createdBy = json['CreatedBy'];
createdOn = json['CreatedOn'];
editedBy = json['EditedBy'];
editedOn = json['EditedOn'];
id = json['ID'];
isEnabled = json['IsEnabled'];
nameAR = json['NameAR'];
nameEN = json['NameEN'];
price = json['Price'];
rowID = json['RowID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['CreatedBy'] = createdBy;
data['CreatedOn'] = createdOn;
data['EditedBy'] = editedBy;
data['EditedOn'] = editedOn;
data['ID'] = id;
data['IsEnabled'] = isEnabled;
data['NameAR'] = nameAR;
data['NameEN'] = nameEN;
data['Price'] = price;
data['RowID'] = rowID;
return data;
}
}

@ -189,8 +189,8 @@ class BaseAppClient {
// body['IdentificationNo'] = 1023854217;
// body['MobileNo'] = "531940021"; //0560717232
// body['PatientID'] = 2039078; //4609100
// body['TokenID'] = "@dm!n";
body['PatientID'] = 4768663; //4609100
body['TokenID'] = "@dm!n";
// Patient ID: 3027574
// Mobile no.: 0502303285

@ -3,6 +3,7 @@ import 'package:hmg_patient_app/core/model/privilege/HMCProjectListModel.dart';
import 'package:hmg_patient_app/core/model/privilege/PrivilegeModel.dart';
import 'package:hmg_patient_app/core/model/privilege/ProjectDetailListModel.dart';
import 'package:hmg_patient_app/core/model/privilege/VidaPlusProjectListModel.dart';
import 'package:hmg_patient_app/core/model/services_price_list_response_model.dart';
import 'package:hmg_patient_app/core/service/base_service.dart';
import 'package:hmg_patient_app/main.dart';
@ -12,6 +13,8 @@ class PrivilegeService extends BaseService {
List<HMCProjectListModel> hMCProjectListModel = [];
List<ProjectDetailListModel> projectDetailListModel = [];
List<ServicesPriceListResponseModel> servicesPriceList = [];
dynamic hisOffersList;
Future<Map> offerDetailsAPICall() async {
@ -28,6 +31,25 @@ class PrivilegeService extends BaseService {
return Future.value(localRes);
}
Future getServicesPriceList({
String searchKey = "",
int pageIndex = 0,
int pageSize = 0,
}) async {
Map<String, dynamic> request = {"ID": 1, "SearchKey": searchKey, "PageIndex": pageIndex, "PageSize": pageSize, "RowCount": 0, "TokenID": "@dm!n"};
dynamic localRes;
await baseAppClient.post(GET_SERVICES_PRICE_LIST, onSuccess: (response, statusCode) async {
response['getServicesPriceList'].forEach((item) {
servicesPriceList.add(ServicesPriceListResponseModel.fromJson(item));
});
servicesPriceList.removeWhere((element) => element.isEnabled == false);
}, onFailure: (String error, int statusCode) {
localRes = {"error": error};
// throw error;
}, body: request);
}
Future getPrivilege() async {
Map<String, dynamic> body = Map();
body['PatientType'] = 4;

@ -1,6 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:hmg_patient_app/core/service/privilege_service.dart';
import 'package:hmg_patient_app/core/viewModels/project_view_model.dart';
import 'package:hmg_patient_app/locator.dart';
import 'package:hmg_patient_app/theme/colors.dart';
import 'package:hmg_patient_app/uitl/translations_delegate_base.dart';
import 'package:hmg_patient_app/uitl/utils_new.dart';
@ -11,6 +13,7 @@ class ServicesPriceList extends StatelessWidget {
ServicesPriceList({super.key});
ProjectViewModel? projectViewModel;
PrivilegeService _privilegeService = locator<PrivilegeService>();
@override
Widget build(BuildContext context) {
@ -75,262 +78,67 @@ class ServicesPriceList extends StatelessWidget {
height: 1,
color: CustomColors.black,
),
SizedBox(height: 8),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
TranslationBase.of(context).servicePriceList1,
style: TextStyle(
color: CustomColors.textColor,
fontSize: 14,
fontWeight: FontWeight.bold,
letterSpacing: -0.64,
),
),
Row(
children: [
projectViewModel!.isArabic ? Container() : SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16),
mWidth(6),
Text(
"315",
style: TextStyle(
color: CustomColors.textDarkColor,
fontSize: 14,
fontWeight: FontWeight.bold,
letterSpacing: -0.64,
),
),
mWidth(6),
projectViewModel!.isArabic ? SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16) : Container(),
],
),
],
),
SizedBox(height: 16),
Divider(
height: 1,
color: CustomColors.devider,
),
SizedBox(height: 16),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
TranslationBase.of(context).servicePriceList2,
style: TextStyle(
color: CustomColors.textColor,
fontSize: 14,
fontWeight: FontWeight.bold,
letterSpacing: -0.64,
),
),
Row(
children: [
projectViewModel!.isArabic ? Container() : SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16),
mWidth(6),
Text(
"210",
style: TextStyle(
color: CustomColors.textDarkColor,
fontSize: 14,
fontWeight: FontWeight.bold,
letterSpacing: -0.64,
),
),
mWidth(6),
projectViewModel!.isArabic ? SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16) : Container(),
],
),
],
),
SizedBox(height: 16),
Divider(
height: 1,
color: CustomColors.devider,
),
SizedBox(height: 16),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
TranslationBase.of(context).servicePriceList3,
style: TextStyle(
color: CustomColors.textColor,
fontSize: 14,
fontWeight: FontWeight.bold,
letterSpacing: -0.64,
),
),
Row(
children: [
projectViewModel!.isArabic ? Container() : SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16),
mWidth(6),
Text(
"160",
style: TextStyle(
color: CustomColors.textDarkColor,
fontSize: 14,
fontWeight: FontWeight.bold,
letterSpacing: -0.64,
),
),
mWidth(6),
projectViewModel!.isArabic ? SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16) : Container(),
],
),
],
),
SizedBox(height: 16),
Divider(
height: 1,
color: CustomColors.devider,
),
SizedBox(height: 16),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
TranslationBase.of(context).servicePriceList4,
style: TextStyle(
color: CustomColors.textColor,
fontSize: 14,
fontWeight: FontWeight.bold,
letterSpacing: -0.64,
),
),
Row(
children: [
projectViewModel!.isArabic ? Container() : SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16),
mWidth(6),
Text(
"210",
style: TextStyle(
color: CustomColors.textDarkColor,
fontSize: 14,
fontWeight: FontWeight.bold,
letterSpacing: -0.64,
),
),
mWidth(6),
projectViewModel!.isArabic ? SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16) : Container(),
],
),
],
),
SizedBox(height: 16),
Divider(
height: 1,
color: CustomColors.devider,
),
SizedBox(height: 16),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
TranslationBase.of(context).servicePriceList5,
style: TextStyle(
color: CustomColors.textColor,
fontSize: 14,
fontWeight: FontWeight.bold,
letterSpacing: -0.64,
),
),
Row(
children: [
projectViewModel!.isArabic ? Container() : SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16),
mWidth(6),
Text(
"160",
style: TextStyle(
color: CustomColors.textDarkColor,
fontSize: 14,
fontWeight: FontWeight.bold,
letterSpacing: -0.64,
),
),
mWidth(6),
projectViewModel!.isArabic ? SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16) : Container(),
],
),
],
),
SizedBox(height: 16),
Divider(
height: 1,
color: CustomColors.devider,
),
SizedBox(height: 16),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
TranslationBase.of(context).servicePriceList6,
style: TextStyle(
color: CustomColors.textColor,
fontSize: 14,
fontWeight: FontWeight.bold,
letterSpacing: -0.64,
),
),
Row(
children: [
projectViewModel!.isArabic ? Container() : SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16),
mWidth(6),
Text(
"160",
style: TextStyle(
color: CustomColors.textDarkColor,
fontSize: 14,
fontWeight: FontWeight.bold,
letterSpacing: -0.64,
),
ListView.separated(
shrinkWrap: true,
padding: EdgeInsets.zero,
physics: NeverScrollableScrollPhysics(),
itemCount: _privilegeService.servicesPriceList.length,
separatorBuilder: (context, index) =>
Padding(
padding: EdgeInsets.symmetric(vertical: 12),
child: Divider(
height: 1,
color: CustomColors.devider,
),
mWidth(6),
projectViewModel!.isArabic ? SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16) : Container(),
],
),
],
),
SizedBox(height: 16),
Divider(
height: 1,
color: CustomColors.devider,
),
SizedBox(height: 16),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
TranslationBase.of(context).servicePriceList7,
style: TextStyle(
color: CustomColors.textColor,
fontSize: 14,
fontWeight: FontWeight.bold,
letterSpacing: -0.64,
),
),
Row(
itemBuilder: (context, index) {
final service = _privilegeService.servicesPriceList[index];
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
projectViewModel!.isArabic ? Container() : SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16),
mWidth(6),
Text(
"150",
style: TextStyle(
color: CustomColors.textDarkColor,
fontSize: 14,
fontWeight: FontWeight.bold,
letterSpacing: -0.64,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
(projectViewModel!.isArabic ? service.nameAR ?? service.nameEN ?? '' : service.nameEN ?? service.nameAR ?? ''),
style: TextStyle(
color: CustomColors.textColor,
fontSize: 14,
fontWeight: FontWeight.bold,
letterSpacing: -0.64,
),
),
),
Row(
children: [
projectViewModel!.isArabic ? Container() : SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16),
mWidth(6),
Text(
'${service.price ?? 0}',
style: TextStyle(
color: CustomColors.textDarkColor,
fontSize: 14,
fontWeight: FontWeight.bold,
letterSpacing: -0.64,
),
),
mWidth(6),
projectViewModel!.isArabic ? SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16) : Container(),
],
),
],
),
mWidth(6),
projectViewModel!.isArabic ? SvgPicture.asset("assets/images/new/Saudi_Riyal_Symbol.svg", width: 16, height: 16) : Container(),
],
),
],
);
},
),
],
)),
SizedBox(height: 16),
Container(
padding: EdgeInsets.all(16),

@ -51,6 +51,7 @@ class _SplashScreenState extends State<SplashScreen> {
LocalNotification.init(onNotificationClick: (payload) {});
// LocalNotification.getInstance().showNow(title: "Payload", subtitle: "Subtitle", payload: "Payload");
if (!_privilegeService.hasError) {
_privilegeService.getServicesPriceList();
Navigator.of(context).pushReplacement(
MaterialPageRoute(
builder: (BuildContext context) => LandingPage(),

@ -1,8 +1,8 @@
name: hmg_patient_app
description: A new Flutter application.
#version: 4.6.022+1
version: 4.6.0982+40500982
version: 4.6.028+1
#version: 4.6.0982+40500982
environment:
# sdk: ">=3.0.0 <3.13.0"

Loading…
Cancel
Save