finsi lakum points task

merge-update-with-lab-changes
mosazaid 5 years ago
parent 98f660e29b
commit 35d0d3e441

@ -646,7 +646,6 @@ const Map localizedValues = {
"shippingAddresses": {"en": "Shipping Addresses", "ar": "عناوين الشحن"},
"reachUs": {"en": "Reach Us", "ar": "الوصول لنا"},
"ourLocations": {"en": "Our Locations", "ar": "مواقعنا"},
"changeAddress": {"en": "Change Address", "ar": "تغيير العنوان"},
"edit": {"en": "Edit", "ar": "تعديل"},
"delete": {"en": "Delete", "ar": " حذف"},
"addAddress": {"en": "ADD A NEW ADDRESS", "ar": " اضافة عنوان جديد"},
@ -671,14 +670,12 @@ const Map localizedValues = {
"en": "Your reviews help other to choose better product",
"ar": " تقييمك سوف يساعد الأخرين في اختيار المنتج الأفضل"
},
"shippingAddress": {"en": "SHIPPING ADDRESS", "ar": " عنوان الشحن"},
"shippedMethod": {"en": "SHIP BY:", "ar": " الشحن بواسطة:"},
"orderDetail": {"en": "Order Detail", "ar": " تفاصيل الطلب"},
"orderSummary": {"en": "Order Summary", "ar": " تفاصيل المنتج"},
"subtotal": {"en": "Subtotal", "ar": " المجموع"},
"shipping": {"en": "Shipping", "ar": " الشحن"},
"vat": {"en": "VAT (15%)", "ar": "(15%) القيمة المضافة"},
"total": {"en": "TOTAL", "ar": " المجموع الكلي"},
"sar": {"en": "SAR", "ar": " ر.س "},
"payOnline": {"en": "PAY ONLINE", "ar": "اتمام عملية الدفع "},
"cancelOrder": {"en": "CANCEL ORDER", "ar": "الغاء الطلب "},
@ -751,10 +748,6 @@ const Map localizedValues = {
"en": "SEARCH & SCAN FOR MEDICATION",
"ar": "البحث والمسح للأدوية"
},
"shopByBrands": {"en": "Shop By Brands", "ar": "تسوق حسب الماركات"},
"recentlyViewed": {"en": "Recently Viewed", "ar": "شوهدت مؤخرا"},
"bestSellers": {"en": "Best Sellers", "ar": "أفضل البائعين"},
"deleteAllItems": {"en": "Delete All Items", "ar": "حذف كافة العناصر"},
"shopByBrands": {
"en": "Shop By Brands",
"ar": "تسوق حسب الماركات"
@ -799,10 +792,6 @@ const Map localizedValues = {
"en": "Review Order",
"ar": "مراجعة الطلب"
},
"orderSummary": {
"en": "Order Summary",
"ar": "ملخص الطلب"
},
"active": {
"en": "ACTIVE",
"ar": "فعال"
@ -1292,5 +1281,9 @@ const Map localizedValues = {
"en": "The referral request has been submitted successfully, you will be contacted ASAP to complete the process. Referral request no is ",
"ar": " تم إرسال طلب الإحالة بنجاح ، وسيتم الاتصال بك في أسرع وقت ممكن لإكمال العملية. رقم طلب الإحالة"
},
"Year": {"en": "YEAR", "ar": "السنة"},
"Month": {"en": "MONTH", "ar": "الشهر"},
"point": {"en": "POINT", "ar": "النقاط"},
"riyal": {"en": "RIYAL", "ar": "الريال"},
};

@ -27,7 +27,7 @@ class LakumInquiryInformationObjVersion {
int transferPoints;
List<PointsAmountPerYear> transferPointsAmountPerYear;
List<PointsDetails> transferPointsDetails;
double waitingPoints;
int waitingPoints;
int loyalityAmount;
int loyalityPoints;
int purchaseRate;
@ -69,22 +69,32 @@ class LakumInquiryInformationObjVersion {
barCode = json['BarCode'];
consumedPoints = json['ConsumedPoints'];
consumedPointsAmount = json['ConsumedPointsAmount'];
consumedPointsAmountPerYear = json['ConsumedPointsAmountPerYear'];
if (json['ConsumedPointsAmountPerYear'] != null) {
consumedPointsAmountPerYear = new List<PointsAmountPerYear>();
json['ConsumedPointsAmountPerYear'].forEach((v) {
consumedPointsAmountPerYear.add(PointsAmountPerYear.fromJson(v));
});
}
if (json['ConsumedPointsDetails'] != null) {
consumedPointsDetails = new List<Null>();
consumedPointsDetails = new List<PointsDetails>();
json['ConsumedPointsDetails'].forEach((v) {
consumedPointsDetails.add(v);
consumedPointsDetails.add(PointsDetails.fromJson(v));
});
}
createdDate = json['CreatedDate'];
expiredPoints = json['ExpiredPoints'];
expiryDate = json['ExpiryDate'];
gainedPoints = json['GainedPoints'];
gainedPointsAmountPerYear = json['GainedPointsAmountPerYear'];
if (json['GainedPointsAmountPerYear'] != null) {
gainedPointsAmountPerYear = new List<PointsAmountPerYear>();
json['GainedPointsAmountPerYear'].forEach((v) {
gainedPointsAmountPerYear.add(PointsAmountPerYear.fromJson(v));
});
}
if (json['GainedPointsDetails'] != null) {
gainedPointsDetails = new List<Null>();
gainedPointsDetails = new List<PointsDetails>();
json['GainedPointsDetails'].forEach((v) {
gainedPointsDetails.add(v);
gainedPointsDetails.add(PointsDetails.fromJson(v));
});
}
lakumMessageStatus = json['LakumMessageStatus'];
@ -97,11 +107,16 @@ class LakumInquiryInformationObjVersion {
prefLang = json['PrefLang'];
statusCode = json['StatusCode'];
transferPoints = json['TransferPoints'];
transferPointsAmountPerYear = json['TransferPointsAmountPerYear'];
if (json['TransferPointsAmountPerYear'] != null) {
transferPointsAmountPerYear = new List<PointsAmountPerYear>();
json['TransferPointsAmountPerYear'].forEach((v) {
transferPointsAmountPerYear.add(PointsAmountPerYear.fromJson(v));
});
}
if (json['TransferPointsDetails'] != null) {
transferPointsDetails = new List<Null>();
transferPointsDetails = new List<PointsDetails>();
json['TransferPointsDetails'].forEach((v) {
transferPointsDetails.add(v);
transferPointsDetails.add(PointsDetails.fromJson(v));
});
}
waitingPoints = json['WaitingPoints'];
@ -117,7 +132,10 @@ class LakumInquiryInformationObjVersion {
data['BarCode'] = this.barCode;
data['ConsumedPoints'] = this.consumedPoints;
data['ConsumedPointsAmount'] = this.consumedPointsAmount;
data['ConsumedPointsAmountPerYear'] = this.consumedPointsAmountPerYear;
if (this.consumedPointsAmountPerYear != null) {
data['ConsumedPointsAmountPerYear'] =
this.consumedPointsAmountPerYear.map((v) => v).toList();
}
if (this.consumedPointsDetails != null) {
data['ConsumedPointsDetails'] =
this.consumedPointsDetails.map((v) => v).toList();
@ -126,7 +144,10 @@ class LakumInquiryInformationObjVersion {
data['ExpiredPoints'] = this.expiredPoints;
data['ExpiryDate'] = this.expiryDate;
data['GainedPoints'] = this.gainedPoints;
data['GainedPointsAmountPerYear'] = this.gainedPointsAmountPerYear;
if (this.gainedPointsAmountPerYear != null) {
data['GainedPointsAmountPerYear'] =
this.gainedPointsAmountPerYear.map((v) => v).toList();
}
if (this.gainedPointsDetails != null) {
data['GainedPointsDetails'] =
this.gainedPointsDetails.map((v) => v).toList();
@ -141,7 +162,10 @@ class LakumInquiryInformationObjVersion {
data['PrefLang'] = this.prefLang;
data['StatusCode'] = this.statusCode;
data['TransferPoints'] = this.transferPoints;
data['TransferPointsAmountPerYear'] = this.transferPointsAmountPerYear;
if (this.transferPointsAmountPerYear != null) {
data['TransferPointsAmountPerYear'] =
this.transferPointsAmountPerYear.map((v) => v).toList();
}
if (this.transferPointsDetails != null) {
data['TransferPointsDetails'] =
this.transferPointsDetails.map((v) => v).toList();

@ -1,9 +1,9 @@
import 'PointsAmountPerMonth.dart';
class PointsAmountPerYear {
double amountPerYear;
int amountPerYear;
List<PointsAmountPerMonth> pointsAmountPerMonth;
double pointsPerYear;
int pointsPerYear;
int year;
PointsAmountPerYear(

@ -12,15 +12,15 @@ class PointsDetails {
PointsDetails(
{this.accNumber,
this.accountStatus,
this.amount,
this.lineItemNo,
this.operationType,
this.points,
this.purchasePoints,
this.subTransactionType,
this.subTransactionTypeDescription,
this.transactionDate});
this.accountStatus,
this.amount,
this.lineItemNo,
this.operationType,
this.points,
this.purchasePoints,
this.subTransactionType,
this.subTransactionTypeDescription,
this.transactionDate});
PointsDetails.fromJson(Map<String, dynamic> json) {
accNumber = json['AccNumber'];
@ -29,7 +29,12 @@ class PointsDetails {
lineItemNo = json['LineItemNo'];
operationType = json['OperationType'];
points = json['Points'];
purchasePoints = json['PurchasePoints'];
var purchasePoints = json['PurchasePoints'];
if(purchasePoints is int){
this.purchasePoints = (purchasePoints).roundToDouble();
}else {
this.purchasePoints = purchasePoints;
}
subTransactionType = json['SubTransactionType'];
subTransactionTypeDescription = json['SubTransactionTypeDescription'];
transactionDate = json['TransactionDate'];
@ -49,4 +54,4 @@ class PointsDetails {
data['TransactionDate'] = this.transactionDate;
return data;
}
}
}

@ -39,6 +39,7 @@ class LacumService extends BaseService{
Map<String, dynamic> body = Map();
body['IdentificationNo'] = user.patientIdentificationNo;
body['AccountNumber'] = "${lacumInformation.yahalaAccountNo}";
body['IsDetailsRequired'] = true;
try {
await baseAppClient.post(GET_LACUM_GROUP_INFORMATION,

@ -12,21 +12,18 @@ class LacumRegistrationViewModel extends LacumViewModel {
ListUserAgreement get listUserAgreement => _lacumService.listUserAgreement;
Future<int> checkLacumAccountActivation(String patientIdentificationNo) async {
Future checkLacumAccountActivation(String patientIdentificationNo) async {
setState(ViewState.Busy);
await _lacumService.getLacumAccountInformationById(patientIdentificationNo);
if (_lacumService.hasError) {
error = _lacumService.error;
setState(ViewState.Error);
return 404;
} else {
if(_lacumService.lacumInformation.yahalaAccountNo != 0){
error = "The account has already been activated";
setState(ViewState.Error);
return 404;
} else {
setState(ViewState.Idle);
return 200;
}
}
}

@ -489,7 +489,7 @@ class _HomePageState extends State<HomePage> {
),
DashboardItem(
onTap: () => Navigator.push(
context, FadePage(page: OrderPage())),
context, FadePage(page: PharmacyPage())),
child: Center(
child: Padding(

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/lacum-registration-viewModel.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -71,8 +72,8 @@ class LakumActivationVidaPage extends StatelessWidget {
model
.checkLacumAccountActivation(
_identificationNumberController.text)
.then((status) => {
if (status == 200)
.then((_) => {
if (model.state == ViewState.Idle)
{
Navigator.push(
context,

@ -81,7 +81,7 @@ class _LakumSettingPageState extends State<LakumSettingPage> {
children: [
Container(
height: mediaQuery.size.height * 0.15,
color: Colors.grey.shade700,
color: Colors.green,
),
Column(
children: [

@ -24,6 +24,7 @@ class LakumMainPage extends StatelessWidget {
builder: (_, model, wi) => AppScaffold(
title: "Lakum",
isShowAppBar: true,
isPharmacy: true,
isShowDecPage: false,
backgroundColor: Colors.white,
baseViewModel: model,
@ -42,7 +43,7 @@ class LakumMainPage extends StatelessWidget {
children: [
Container(
height: mediaQuery.size.height * 0.15,
color: Colors.grey.shade700,
color: Colors.green,
),
Column(
children: [

@ -0,0 +1,270 @@
import 'package:diplomaticquarterapp/core/model/pharmacies/PointsAmountPerMonth.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/lacum-viewmodel.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/lakum-point-table-row-widget.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class LakumPointMonthPage extends StatefulWidget {
final PointsAmountPerMonth pointsAmountPerMonth;
final int year;
int expandedItemIndex = -1;
LakumPointMonthPage(this.pointsAmountPerMonth, this.year);
@override
_LakumPointsMonthPageState createState() => _LakumPointsMonthPageState();
}
class _LakumPointsMonthPageState extends State<LakumPointMonthPage> {
@override
Widget build(BuildContext context) {
final mediaQuery = MediaQuery.of(context);
return BaseView<LacumViewModel>(
builder: (_, model, wi) => AppScaffold(
title: "Lakum points",
isShowAppBar: true,
isShowDecPage: false,
backgroundColor: Colors.white,
baseViewModel: model,
body: Container(
width: double.infinity,
child: SingleChildScrollView(
child: Column(
children: [
Container(
height: mediaQuery.size.height * 0.25,
child: Stack(
children: [
Image.asset(
"assets/images/pharmacy_module/lakum/lakum_card_front_bg.png",
fit: BoxFit.fill,
width: mediaQuery.size.width * 1.0,
),
Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
height: mediaQuery.size.height * 0.06,
margin: EdgeInsets.symmetric(
vertical: 16, horizontal: 24),
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).month,
color: Colors.grey.shade600,
fontSize: 16,
),
Texts(
"${widget.pointsAmountPerMonth.month}, ${widget.year}",
color: Colors.grey.shade700,
fontWeight: FontWeight.bold,
fontSize: 16,
),
],
),
),
Expanded(
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
children: [
Expanded(
child: Column(
mainAxisAlignment:
MainAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Texts(
TranslationBase.of(context).point,
color: Colors.grey.shade600,
fontSize: 16,
),
Texts(
"${widget.pointsAmountPerMonth.pointsPerMonth}",
color: Colors.grey.shade700,
fontWeight: FontWeight.bold,
fontSize: 16,
),
],
),
),
SizedBox(
child: Container(
color: Colors.grey,
),
width: 1,
),
Expanded(
child: Column(
mainAxisAlignment:
MainAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Texts(
TranslationBase.of(context).riyal,
color: Colors.grey.shade600,
fontSize: 16,
),
Texts(
"${widget.pointsAmountPerMonth.amountPerMonth}",
color: Colors.grey.shade700,
fontWeight: FontWeight.bold,
fontSize: 16,
),
],
),
),
],
),
),
],
),
),
],
),
],
),
),
SizedBox(
height: 10,
),
LakumPointTableRowWidget(true, "DAY", 0, 0, null, 0),
...List.generate(
widget.pointsAmountPerMonth.pointsAmountPerday.length,
(index) => LakumPointTableRowWidget(
false,
widget.pointsAmountPerMonth.pointsAmountPerday[index].day,
widget.pointsAmountPerMonth.pointsAmountPerday[index]
.pointsPerDay,
widget.pointsAmountPerMonth.pointsAmountPerday[index]
.amountPerDay,
() {
setState(() {
if (widget.expandedItemIndex == index) {
widget.expandedItemIndex = -1;
} else {
widget.expandedItemIndex = index;
}
});
},
index,
expandFlag: widget.expandedItemIndex == index,
collapsed: Column(
children: [
...List.generate(
widget.pointsAmountPerMonth.pointsAmountPerday[index]
.pointsDetails.length,
(index) => DayPointsDetailWidget(
widget
.pointsAmountPerMonth
.pointsAmountPerday[index]
.pointsDetails[index]
.subTransactionTypeDescription,
widget
.pointsAmountPerMonth
.pointsAmountPerday[index]
.pointsDetails[index].purchasePoints,
widget
.pointsAmountPerMonth
.pointsAmountPerday[index]
.pointsDetails[index].amount),
),
],
),
),
),
],
),
),
),
),
);
}
}
class DayPointsDetailWidget extends StatelessWidget {
final String rowTitle;
final double points;
final double riyal;
DayPointsDetailWidget(this.rowTitle, this.points, this.riyal);
@override
Widget build(BuildContext context) {
return Container(
color: Color(0xffe4e4e4),
padding: EdgeInsets.symmetric(vertical: 0, horizontal: 12),
child: Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(vertical: 8),
child: Row(
children: [
Expanded(
child: Container(
child: Column(
children: [
Texts(
"TYPE",
fontSize: 12,
fontWeight: FontWeight.bold,
),
SizedBox(
height: 4,
),
Texts(
rowTitle,
fontSize: 14,
fontWeight: FontWeight.normal,
),
],
crossAxisAlignment: CrossAxisAlignment.start,
),
)),
Expanded(
child: Container(
child: Texts(
"$points",
fontSize: 14,
fontWeight: FontWeight.normal,
),
)),
Expanded(
child: Container(
child: Texts(
"$riyal",
fontSize: 14,
fontWeight: FontWeight.normal,
),
)),
Expanded(child: Container()),
],
),
),
const Divider(
color: Color(0xFFD6D6D6),
height: 1,
thickness: 1,
indent: 0,
endIndent: 0,
),
],
),
);
}
}

@ -4,8 +4,11 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/lakum-point-table-row-widget.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'lakum-points-month-page.dart';
class LakumPointsYearPage extends StatefulWidget {
final List<PointsAmountPerYear> pointsAmountPerYear;
int selectedIndexYear = 0;
@ -35,7 +38,7 @@ class _LakumPointsYearPageState extends State<LakumPointsYearPage> {
children: [
Container(
height: 100,
margin: EdgeInsets.symmetric(horizontal: 16),
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: ListView(
scrollDirection: Axis.horizontal,
children: <Widget>[
@ -53,21 +56,25 @@ class _LakumPointsYearPageState extends State<LakumPointsYearPage> {
),
),
SizedBox(
height: 10,
height: 0,
),
LakumPointTableRowWidget(true, "MONTH", 0, 0, null, 0),
...List.generate(
widget.pointsAmountPerYear[widget.selectedIndexYear]
.pointsAmountPerMonth.length,
(index) => LakumPointTableRowWidget(
true,
false,
widget.pointsAmountPerYear[widget.selectedIndexYear]
.pointsAmountPerMonth[index].month,
widget.pointsAmountPerYear[widget.selectedIndexYear]
.pointsAmountPerMonth[index].pointsPerMonth,
widget.pointsAmountPerYear[widget.selectedIndexYear]
.pointsAmountPerMonth[index].amountPerMonth,
(){},
(){
Navigator.push(context,
FadePage(page: LakumPointMonthPage(widget.pointsAmountPerYear[widget.selectedIndexYear]
.pointsAmountPerMonth[index], widget.pointsAmountPerYear[widget.selectedIndexYear].year)));
},
index),
),
],
@ -163,7 +170,7 @@ class LacumPointsYearWidget extends StatelessWidget {
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Texts(
"RIYAL",

@ -126,19 +126,21 @@ class ProductTileItem extends StatelessWidget {
),
Row(
children: [
StarRating(
totalAverage: item.approvedTotalReviews > 0
? (item.approvedRatingSum.toDouble() /
item.approvedTotalReviews.toDouble())
.toDouble()
: 0,
forceStars: true),
Texts(
Expanded(
child: StarRating(
totalAverage: item.approvedTotalReviews > 0
? (item.approvedRatingSum.toDouble() /
item.approvedTotalReviews.toDouble())
.toDouble()
: 0,
forceStars: true),
),
/*Texts(
"(${item.approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
)
),*/
],
),
],

@ -1,4 +1,7 @@
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/points-expandable-notifier.dart';
import 'package:expandable/expandable.dart';
import 'package:flutter/material.dart';
class LakumPointTableRowWidget extends StatefulWidget {
@ -8,9 +11,12 @@ class LakumPointTableRowWidget extends StatefulWidget {
final double riyal;
final Function onTap;
final int rowIndex;
final Widget collapsed;
final bool expandFlag;
LakumPointTableRowWidget(this.isTableTitle, this.rowTitle, this.points,
this.riyal, this.onTap, this.rowIndex);
this.riyal, this.onTap, this.rowIndex,
{this.collapsed, this.expandFlag = false});
@override
_LakumPointTableRowWidgetState createState() =>
@ -20,60 +26,90 @@ class LakumPointTableRowWidget extends StatefulWidget {
class _LakumPointTableRowWidgetState extends State<LakumPointTableRowWidget> {
@override
Widget build(BuildContext context) {
bool isEven = widget.rowIndex % 2 == 0;
return InkWell(
onTap: widget.onTap,
child: Container(
color: isEven ? Color(0xffefefef) : Colors.white,
child: Column(
children: [
Row(
children: [
Expanded(
child: Container(
child: Texts(
widget.rowTitle,
fontSize: 14,
fontWeight: widget.isTableTitle
? FontWeight.bold
: FontWeight.normal,
),
)),
Expanded(
child: Container(
child: Texts(
widget.isTableTitle ? "POINTS" : widget.points,
fontSize: 14,
fontWeight: widget.isTableTitle
? FontWeight.bold
: FontWeight.normal,
),
)),
Expanded(
child: Container(
child: Texts(
widget.isTableTitle ? "RIYAL" : widget.riyal,
fontSize: 14,
fontWeight: widget.isTableTitle
? FontWeight.bold
: FontWeight.normal,
),
)),
Expanded(
child: widget.isTableTitle
? Container()
: Icon(Icons.arrow_forward_ios)),
],
),
const Divider(
color: Color(0xFFD6D6D6),
height: 1,
thickness: 2,
indent: 0,
endIndent: 0,
),
],
),
child: Column(
children: <Widget>[
Column(
children: [
widget.collapsed != null
? PointsExpandableNotifier(
headerWidget: buildPointRowBody(),
// bodyWidget: widget.collapsed != null ? widget.collapsed : null,
bodyWidget: widget.collapsed,
isExpand: widget.expandFlag,
)
: buildPointRowBody(),
],
),
const Divider(
color: Color(0xFFD6D6D6),
height: 1,
thickness: 1,
indent: 0,
endIndent: 0,
),
],
),
);
}
Widget buildPointRowBody() {
bool isEven = widget.rowIndex % 2 == 0;
return Container(
padding: EdgeInsets.symmetric(vertical: 12, horizontal: 12),
color: widget.expandFlag ? Color(0xffe4e4e4) : isEven && !widget.isTableTitle ? Color(0xffefefef) : Colors.white,
child: Column(
children: [
Row(
children: [
Expanded(
child: Container(
child: Texts(
widget.rowTitle,
fontSize: 14,
fontWeight:
widget.isTableTitle ? FontWeight.bold : FontWeight.normal,
),
)),
Expanded(
child: Container(
child: Texts(
widget.isTableTitle ? "POINTS" : "${widget.points}",
fontSize: 14,
fontWeight:
widget.isTableTitle ? FontWeight.bold : FontWeight.normal,
),
)),
Expanded(
child: Container(
child: Texts(
widget.isTableTitle ? "RIYAL" : "${widget.riyal}",
fontSize: 14,
fontWeight:
widget.isTableTitle ? FontWeight.bold : FontWeight.normal,
),
)),
Expanded(
child: widget.isTableTitle
? Container()
: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Icon(
widget.collapsed == null
? Icons.keyboard_arrow_right
: widget.expandFlag
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down,
size: 25,
color: Colors.grey.shade700,
),
],
)),
],
),
],
),
);
}

@ -710,8 +710,6 @@ String get fileno => localizedValues['fileno'][locale.languageCode];
String get reachUs => localizedValues['reachUs'][locale.languageCode];
String get ourLocations =>
localizedValues['ourLocations'][locale.languageCode];
String get changeAddress =>
localizedValues['changeAddress'][locale.languageCode];
String get edit => localizedValues['edit'][locale.languageCode];
String get delete => localizedValues['delete'][locale.languageCode];
String get addAddress => localizedValues['addAddress'][locale.languageCode];
@ -732,13 +730,9 @@ String get fileno => localizedValues['fileno'][locale.languageCode];
localizedValues['reviewShared'][locale.languageCode];
String get reviewComment =>
localizedValues['reviewComment'][locale.languageCode];
String get shippingAddress =>
localizedValues['shippingAddress'][locale.languageCode];
String get shippedMethod =>
localizedValues['shippedMethod'][locale.languageCode];
String get orderDetail => localizedValues['orderDetail'][locale.languageCode];
String get orderSummary =>
localizedValues['orderSummary'][locale.languageCode];
String get subtotal => localizedValues['subtotal'][locale.languageCode];
String get shipping => localizedValues['shipping'][locale.languageCode];
String get vat => localizedValues['vat'][locale.languageCode];
@ -787,7 +781,6 @@ String get fileno => localizedValues['fileno'][locale.languageCode];
localizedValues['recentlyViewed'][locale.languageCode];
String get bestSellers => localizedValues['bestSellers'][locale.languageCode];
String get deleteAllItems => localizedValues['deleteAllItems'][locale.languageCode];
String get total => localizedValues['total'][locale.languageCode];
String get selectAddress => localizedValues['selectAddress'][locale.languageCode];
String get shippingAddress => localizedValues['shippingAddress'][locale.languageCode];
String get changeAddress => localizedValues['changeAddress'][locale.languageCode];
@ -984,7 +977,10 @@ String get fileno => localizedValues['fileno'][locale.languageCode];
String get addedChild => localizedValues['added-child'][locale.languageCode];
String get appUpdate => localizedValues['appUpdate'][locale.languageCode];
String get ereferralSaveSuccess => localizedValues['ereferralSaveSuccess'][locale.languageCode];
String get year => localizedValues['Year'][locale.languageCode];
String get month => localizedValues['Month'][locale.languageCode];
String get point => localizedValues['point'][locale.languageCode];
String get riyal => localizedValues['riyal'][locale.languageCode];
}

@ -77,9 +77,14 @@ class AppScaffold extends StatelessWidget {
PreferredSizeWidget appBar;
if (this.appBarWidget == null) {
PreferredSizeWidget appBarWidget =
// buildAppBar(context, appBarTitle, appBarIcons, isShowAppBar);
AppBarWidget(appBarTitle, appBarIcons, isShowAppBar);
PreferredSizeWidget appBarWidget = AppBarWidget(
appBarTitle,
appBarIcons,
isShowAppBar,
isPharmacy: isPharmacy,
isShowDecPage: isShowDecPage,
image: image,
);
appBar = preferredSize == 0
? appBarWidget
: PreferredSize(
@ -92,71 +97,7 @@ class AppScaffold extends StatelessWidget {
return Scaffold(
backgroundColor:
backgroundColor ?? Theme.of(context).scaffoldBackgroundColor,
appBar: isShowAppBar
? AppBar(
elevation: 0,
backgroundColor: isPharmacy
? Colors.green
: Theme.of(context).appBarTheme.color,
textTheme: TextTheme(
headline6:
TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
),
title: Texts(
authenticatedUserObject.isLogin || !isShowDecPage
? appBarTitle.toUpperCase()
: TranslationBase.of(context).serviceInformationTitle,
color: Colors.white,
bold: true,
),
leading: Builder(
builder: (BuildContext context) {
return ArrowBack();
},
),
centerTitle: true,
actions: <Widget>[
isPharmacy
? IconButton(
icon: Icon(Icons.shopping_cart),
color: Colors.white,
onPressed: () {
Navigator.of(context)
.popUntil(ModalRoute.withName('/'));
})
: Container(),
image != null
? InkWell(
onTap: () => Navigator.push(
context,
FadePage(
page: InsuranceUpdate(),
),
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
image,
height: SizeConfig.heightMultiplier * 5,
width: SizeConfig.heightMultiplier * 5,
color: Colors.white,
),
),
)
: IconButton(
icon: Icon(FontAwesomeIcons.home),
color: Colors.white,
onPressed: () {
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(
builder: (context) => LandingPage()),
(Route<dynamic> r) => false);
},
),
],
)
: null,
appBar: appBar,
body: (!Provider.of<ProjectViewModel>(context, listen: false).isLogin &&
isShowDecPage)
? NotAutPage(
@ -197,8 +138,12 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
final String appBarTitle;
final List<Widget> appBarIcons;
final bool isShowAppBar;
final bool isPharmacy;
final bool isShowDecPage;
final String image;
AppBarWidget(this.appBarTitle, this.appBarIcons, this.isShowAppBar);
AppBarWidget(this.appBarTitle, this.appBarIcons, this.isShowAppBar,
{this.isPharmacy = true, this.isShowDecPage = true, this.image});
@override
Widget build(BuildContext context) {
@ -209,14 +154,19 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
return isShowAppBar
? AppBar(
elevation: 0,
backgroundColor: Theme.of(context).appBarTheme.color,
backgroundColor:
isPharmacy ? Colors.green : Theme.of(context).appBarTheme.color,
textTheme: TextTheme(
headline6:
TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
),
title: Text(authenticatedUserObject.isLogin
? appBarTitle.toUpperCase()
: TranslationBase.of(context).serviceInformationTitle),
title: Texts(
authenticatedUserObject.isLogin || !isShowDecPage
? appBarTitle.toUpperCase()
: TranslationBase.of(context).serviceInformationTitle,
color: Colors.white,
bold: true,
),
leading: Builder(
builder: (BuildContext context) {
return ArrowBack();
@ -224,16 +174,44 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
),
centerTitle: true,
actions: <Widget>[
IconButton(
icon: Icon(FontAwesomeIcons.home),
color: Colors.white,
onPressed: () {
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(builder: (context) => LandingPage()),
(Route<dynamic> r) => false);
},
),
isPharmacy
? IconButton(
icon: Icon(Icons.shopping_cart),
color: Colors.white,
onPressed: () {
Navigator.of(context)
.popUntil(ModalRoute.withName('/'));
})
: Container(),
image != null
? InkWell(
onTap: () => Navigator.push(
context,
FadePage(
page: InsuranceUpdate(),
),
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset(
image,
height: SizeConfig.heightMultiplier * 5,
width: SizeConfig.heightMultiplier * 5,
color: Colors.white,
),
),
)
: IconButton(
icon: Icon(FontAwesomeIcons.home),
color: Colors.white,
onPressed: () {
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(
builder: (context) => LandingPage()),
(Route<dynamic> r) => false);
},
),
if (appBarIcons != null) ...appBarIcons
],
)

@ -0,0 +1,77 @@
import 'package:expandable/expandable.dart';
import 'package:flutter/material.dart';
class PointsExpandableNotifier extends StatefulWidget {
final Widget headerWidget;
final Widget bodyWidget;
final Widget collapsed;
final bool isExpand;
bool expandFlag = false;
var controller = new ExpandableController();
PointsExpandableNotifier(
{this.headerWidget, this.bodyWidget, this.collapsed, this.isExpand});
@override
_PointsExpandableNotifierState createState() =>
_PointsExpandableNotifierState();
}
class _PointsExpandableNotifierState extends State<PointsExpandableNotifier> {
@override
Widget build(BuildContext context) {
setState(() {
if (widget.isExpand == true) {
widget.expandFlag = widget.isExpand;
widget.controller.expanded = true;
}
});
return ExpandableNotifier(
child: Padding(
padding: const EdgeInsets.only(left: 0, right: 0),
child: Column(
children: <Widget>[
SizedBox(
child: widget.headerWidget,
),
ScrollOnExpand(
scrollOnExpand: true,
scrollOnCollapse: false,
child: ExpandablePanel(
theme: const ExpandableThemeData(
headerAlignment: ExpandablePanelHeaderAlignment.center,
tapBodyToCollapse: true,
),
// header: widget.headerWidget,
/*
// setState(() {
// widget.expandFlag = !widget.expandFlag;
// if (widget.expandFlag == true) {
// widget.controller.expanded = true;
// } else {
// widget.controller.expanded = false;
// }
// });
*/
collapsed: Container(),
expanded: widget.bodyWidget,
builder: (_, collapsed, expanded) {
return Padding(
padding: EdgeInsets.only(left: 0, right: 0, bottom: 0),
child: Expandable(
controller: widget.controller,
collapsed: collapsed,
expanded: expanded,
theme: const ExpandableThemeData(crossFadePoint: 0),
),
);
},
),
),
],
),
),
);
}
}
Loading…
Cancel
Save