|
|
|
@ -176,10 +176,11 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
|
|
|
|
if (list[ermIndex].notificationType == "Survey") {
|
|
|
|
if (list[ermIndex].notificationType == "Survey") {
|
|
|
|
await Navigator.pushNamed(context, AppRoutes.survey, arguments: response.mohemmItgResponseItem!.result!.data!.first);
|
|
|
|
await Navigator.pushNamed(context, AppRoutes.survey, arguments: response.mohemmItgResponseItem!.result!.data!.first);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
await Navigator.pushNamed(context, AppRoutes.advertisement, arguments: {
|
|
|
|
await Navigator.pushNamed(
|
|
|
|
"masterId": list[ermIndex].notificationMasterId,
|
|
|
|
context,
|
|
|
|
"advertisement": response.mohemmItgResponseItem!.result!.data!.first.advertisement,
|
|
|
|
AppRoutes.advertisement,
|
|
|
|
});
|
|
|
|
arguments: {"masterId": list[ermIndex].notificationMasterId, "advertisement": response.mohemmItgResponseItem!.result!.data!.first.advertisement},
|
|
|
|
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ermIndex++;
|
|
|
|
ermIndex++;
|
|
|
|
@ -242,53 +243,44 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Builder(builder: (BuildContext context) {
|
|
|
|
Builder(
|
|
|
|
return Row(
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
return Row(
|
|
|
|
children: [
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
Image.memory(
|
|
|
|
children: [
|
|
|
|
Utils.dataFromBase64String(
|
|
|
|
Image.memory(
|
|
|
|
AppState().memberInformationList!.eMPLOYEEIMAGE ?? "",
|
|
|
|
Utils.dataFromBase64String(AppState().memberInformationList!.eMPLOYEEIMAGE ?? ""),
|
|
|
|
),
|
|
|
|
errorBuilder: (BuildContext context, Object error, StackTrace? stackTrace) {
|
|
|
|
errorBuilder: (BuildContext context, Object error, StackTrace? stackTrace) {
|
|
|
|
return SvgPicture.asset("assets/images/user.svg", height: 34, width: 34);
|
|
|
|
return SvgPicture.asset(
|
|
|
|
},
|
|
|
|
"assets/images/user.svg",
|
|
|
|
width: 34,
|
|
|
|
height: 34,
|
|
|
|
height: 34,
|
|
|
|
width: 34,
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
);
|
|
|
|
).circle(50),
|
|
|
|
},
|
|
|
|
// CircularAvatar(
|
|
|
|
width: 34,
|
|
|
|
// width: 34,
|
|
|
|
height: 34,
|
|
|
|
// height: 34,
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
// url: "https://cdn4.iconfinder.com/data/icons/professions-2-2/151/89-512.png",
|
|
|
|
).circle(50),
|
|
|
|
// ),
|
|
|
|
// CircularAvatar(
|
|
|
|
8.width,
|
|
|
|
// width: 34,
|
|
|
|
SvgPicture.asset("assets/images/side_nav.svg"),
|
|
|
|
// height: 34,
|
|
|
|
],
|
|
|
|
// url: "https://cdn4.iconfinder.com/data/icons/professions-2-2/151/89-512.png",
|
|
|
|
).onPress(() {
|
|
|
|
// ),
|
|
|
|
_scaffoldState.currentState!.openDrawer();
|
|
|
|
8.width,
|
|
|
|
});
|
|
|
|
SvgPicture.asset("assets/images/side_nav.svg"),
|
|
|
|
},
|
|
|
|
],
|
|
|
|
),
|
|
|
|
).onPress(() {
|
|
|
|
|
|
|
|
_scaffoldState.currentState!.openDrawer();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
Image.asset("assets/images/logos/main_mohemm_logo.png", width: 134, height: 28).expanded,
|
|
|
|
Image.asset("assets/images/logos/main_mohemm_logo.png", width: 134, height: 28).expanded,
|
|
|
|
SvgPicture.asset(
|
|
|
|
SvgPicture.asset("assets/images/announcements.svg", matchTextDirection: true).onPress(() async {
|
|
|
|
"assets/images/announcements.svg",
|
|
|
|
|
|
|
|
matchTextDirection: true,
|
|
|
|
|
|
|
|
).onPress(() async {
|
|
|
|
|
|
|
|
await Navigator.pushNamed(context, AppRoutes.announcements);
|
|
|
|
await Navigator.pushNamed(context, AppRoutes.announcements);
|
|
|
|
})
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
).paddingOnly(left: 21, right: 21, top: 48, bottom: 7),
|
|
|
|
).paddingOnly(left: 21, right: 21, top: 48, bottom: 7),
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: SmartRefresher(
|
|
|
|
child: SmartRefresher(
|
|
|
|
enablePullDown: true,
|
|
|
|
enablePullDown: true,
|
|
|
|
enablePullUp: false,
|
|
|
|
enablePullUp: false,
|
|
|
|
header: const MaterialClassicHeader(
|
|
|
|
header: const MaterialClassicHeader(color: MyColors.gradiantEndColor),
|
|
|
|
color: MyColors.gradiantEndColor,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
controller: _refreshController,
|
|
|
|
controller: _refreshController,
|
|
|
|
onRefresh: () {
|
|
|
|
onRefresh: () {
|
|
|
|
_onRefresh(false);
|
|
|
|
_onRefresh(false);
|
|
|
|
@ -312,220 +304,328 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
|
|
|
|
return (model.isAttendanceTrackingLoading
|
|
|
|
return (model.isAttendanceTrackingLoading
|
|
|
|
? GetAttendanceTrackingShimmer()
|
|
|
|
? GetAttendanceTrackingShimmer()
|
|
|
|
: Container(
|
|
|
|
: Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(15),
|
|
|
|
borderRadius: BorderRadius.circular(15),
|
|
|
|
gradient: const LinearGradient(transform: GradientRotation(.46), begin: Alignment.topRight, end: Alignment.bottomLeft, colors: [
|
|
|
|
gradient: const LinearGradient(
|
|
|
|
MyColors.gradiantEndColor,
|
|
|
|
transform: GradientRotation(.46),
|
|
|
|
MyColors.gradiantStartColor,
|
|
|
|
begin: Alignment.topRight,
|
|
|
|
]),
|
|
|
|
end: Alignment.bottomLeft,
|
|
|
|
|
|
|
|
colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Stack(
|
|
|
|
),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Stack(
|
|
|
|
children: [
|
|
|
|
alignment: Alignment.center,
|
|
|
|
if (model.isTimeRemainingInSeconds == 0) SvgPicture.asset("assets/images/thumb.svg"),
|
|
|
|
children: [
|
|
|
|
Column(
|
|
|
|
if (model.isTimeRemainingInSeconds == 0) SvgPicture.asset("assets/images/thumb.svg"),
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
Column(
|
|
|
|
children: [
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
Expanded(
|
|
|
|
children: [
|
|
|
|
child: Column(
|
|
|
|
Expanded(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: [
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
LocaleKeys.markAttendance.tr().toText14(color: Colors.white, isBold: true),
|
|
|
|
|
|
|
|
if (model.isTimeRemainingInSeconds == 0) DateTime.now().toString().split(" ")[0].toText12(color: Colors.white),
|
|
|
|
|
|
|
|
if (model.isTimeRemainingInSeconds != 0)
|
|
|
|
|
|
|
|
Column(
|
|
|
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
9.height,
|
|
|
|
|
|
|
|
Directionality(
|
|
|
|
|
|
|
|
textDirection: ui.TextDirection.ltr,
|
|
|
|
|
|
|
|
child: CountdownTimer(
|
|
|
|
|
|
|
|
endTime: model.endTime,
|
|
|
|
|
|
|
|
onEnd: null,
|
|
|
|
|
|
|
|
endWidget: "00:00:00".toText14(color: Colors.white, isBold: true),
|
|
|
|
|
|
|
|
textStyle: const TextStyle(color: Colors.white, fontSize: 14, letterSpacing: -0.48, fontWeight: FontWeight.bold),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
LocaleKeys.timeLeftToday.tr().toText12(color: Colors.white),
|
|
|
|
|
|
|
|
9.height,
|
|
|
|
|
|
|
|
ClipRRect(
|
|
|
|
|
|
|
|
borderRadius: const BorderRadius.all(Radius.circular(20)),
|
|
|
|
|
|
|
|
child: LinearProgressIndicator(
|
|
|
|
|
|
|
|
value: model.progress,
|
|
|
|
|
|
|
|
minHeight: 8,
|
|
|
|
|
|
|
|
valueColor: const AlwaysStoppedAnimation<Color>(Colors.white),
|
|
|
|
|
|
|
|
backgroundColor: const Color(0xff196D73),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
).paddingOnly(top: 12, right: 15, left: 12),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
LocaleKeys.markAttendance.tr().toText14(color: Colors.white, isBold: true),
|
|
|
|
child: Column(
|
|
|
|
if (model.isTimeRemainingInSeconds == 0) DateTime.now().toString().split(" ")[0].toText12(color: Colors.white),
|
|
|
|
|
|
|
|
if (model.isTimeRemainingInSeconds != 0)
|
|
|
|
|
|
|
|
Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
LocaleKeys.checkIn.tr().toText12(color: Colors.white),
|
|
|
|
9.height,
|
|
|
|
(model.attendanceTracking!.pSwipeIn == null ? "--:--" : model.attendanceTracking!.pSwipeIn)
|
|
|
|
Directionality(
|
|
|
|
.toString()
|
|
|
|
textDirection: ui.TextDirection.ltr,
|
|
|
|
.toText14(color: Colors.white, isBold: true),
|
|
|
|
child: CountdownTimer(
|
|
|
|
4.height,
|
|
|
|
endTime: model.endTime,
|
|
|
|
|
|
|
|
onEnd: null,
|
|
|
|
|
|
|
|
endWidget: "00:00:00".toText14(color: Colors.white, isBold: true),
|
|
|
|
|
|
|
|
textStyle: const TextStyle(color: Colors.white, fontSize: 14, letterSpacing: -0.48, fontWeight: FontWeight.bold),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
LocaleKeys.timeLeftToday.tr().toText12(color: Colors.white),
|
|
|
|
|
|
|
|
9.height,
|
|
|
|
|
|
|
|
ClipRRect(
|
|
|
|
|
|
|
|
borderRadius: const BorderRadius.all(Radius.circular(20)),
|
|
|
|
|
|
|
|
child: LinearProgressIndicator(
|
|
|
|
|
|
|
|
value: model.progress,
|
|
|
|
|
|
|
|
minHeight: 8,
|
|
|
|
|
|
|
|
valueColor: const AlwaysStoppedAnimation<Color>(Colors.white),
|
|
|
|
|
|
|
|
backgroundColor: const Color(0xff196D73),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
).paddingOnly(left: 12, right: 12),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
margin: EdgeInsets.only(top: AppState().isArabic(context) ? 6 : 0),
|
|
|
|
|
|
|
|
width: 45,
|
|
|
|
|
|
|
|
height: 45,
|
|
|
|
|
|
|
|
padding: const EdgeInsets.only(left: 10, right: 10),
|
|
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
color: Color(0xff259EA4),
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
|
|
|
|
bottomRight: AppState().isArabic(context) ? Radius.circular(0) : Radius.circular(15),
|
|
|
|
|
|
|
|
bottomLeft: AppState().isArabic(context) ? Radius.circular(15) : Radius.circular(0),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: SvgPicture.asset(model.isTimeRemainingInSeconds == 0 ? "assets/images/biometrics.svg" : "assets/images/biometrics.svg"),
|
|
|
|
|
|
|
|
).onPress(() {
|
|
|
|
|
|
|
|
showMyBottomSheet(
|
|
|
|
|
|
|
|
context,
|
|
|
|
|
|
|
|
callBackFunc: () {},
|
|
|
|
|
|
|
|
child: MarkAttendanceWidget(model, isFromDashboard: true),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
).paddingOnly(top: 12, right: 15, left: 12),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Row(
|
|
|
|
],
|
|
|
|
children: [
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
).onPress(
|
|
|
|
child: Column(
|
|
|
|
() {
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
Navigator.pushNamed(context, AppRoutes.todayAttendance);
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
},
|
|
|
|
children: [
|
|
|
|
))
|
|
|
|
LocaleKeys.checkIn.tr().toText12(color: Colors.white),
|
|
|
|
|
|
|
|
(model.attendanceTracking!.pSwipeIn == null ? "--:--" : model.attendanceTracking!.pSwipeIn).toString().toText14(
|
|
|
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
|
|
isBold: true,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
4.height,
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
).paddingOnly(left: 12, right: 12),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
margin: EdgeInsets.only(top: AppState().isArabic(context) ? 6 : 0),
|
|
|
|
|
|
|
|
width: 45,
|
|
|
|
|
|
|
|
height: 45,
|
|
|
|
|
|
|
|
padding: const EdgeInsets.only(left: 10, right: 10),
|
|
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
color: const Color(0xff259EA4),
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
|
|
|
|
bottomRight: AppState().isArabic(context) ? const Radius.circular(0) : const Radius.circular(15),
|
|
|
|
|
|
|
|
bottomLeft: AppState().isArabic(context) ? const Radius.circular(15) : const Radius.circular(0),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
child: SvgPicture.asset(model.isTimeRemainingInSeconds == 0 ? "assets/images/biometrics.svg" : "assets/images/biometrics.svg"),
|
|
|
|
|
|
|
|
).onPress(() {
|
|
|
|
|
|
|
|
showMyBottomSheet(context, callBackFunc: () {}, child: MarkAttendanceWidget(model, isFromDashboard: true));
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
).onPress(() {
|
|
|
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.todayAttendance);
|
|
|
|
|
|
|
|
}))
|
|
|
|
.animatedSwither();
|
|
|
|
.animatedSwither();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
9.width,
|
|
|
|
9.width,
|
|
|
|
Expanded(
|
|
|
|
Expanded(child: MenusWidget()),
|
|
|
|
child: MenusWidget(),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
).paddingOnly(left: 21, right: 21, top: 7, bottom: 21),
|
|
|
|
).paddingOnly(left: 21, right: 21, top: 7, bottom: 21),
|
|
|
|
eventActivityWidget(context),
|
|
|
|
eventActivityWidget(context),
|
|
|
|
Consumer<DashboardProviderModel>(builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
|
|
|
|
Consumer<DashboardProviderModel>(
|
|
|
|
if (!model.isOffersLoading && model.getOffersList.isEmpty) {
|
|
|
|
builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
|
|
|
|
return const SizedBox();
|
|
|
|
if (!model.isOffersLoading && model.getOffersList.isEmpty) {
|
|
|
|
}
|
|
|
|
return const SizedBox();
|
|
|
|
return Column(
|
|
|
|
}
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
return Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: [
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
Directionality(
|
|
|
|
children: [
|
|
|
|
textDirection: AppState().isArabic(context) ? ui.TextDirection.rtl : ui.TextDirection.ltr,
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
child: Column(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
borderRadius: BorderRadius.circular(20),
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
gradient: const LinearGradient(colors: [Color(0xFF91C481), Color(0xFF7CCED7)], begin: Alignment.centerLeft, end: Alignment.centerRight),
|
|
|
|
children: [
|
|
|
|
|
|
|
|
LocaleKeys.offers.tr().toText12(),
|
|
|
|
|
|
|
|
Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
LocaleKeys.discounts.tr().toText24(isBold: true),
|
|
|
|
|
|
|
|
6.width,
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
padding: const EdgeInsets.only(left: 8, right: 8),
|
|
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
color: MyColors.yellowColor,
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(10),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
child: LocaleKeys.newString.tr().toText10(isBold: true)),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Padding(
|
|
|
|
LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() {
|
|
|
|
padding: const EdgeInsets.all(3.0), // This creates the border width
|
|
|
|
Navigator.pushNamed(context, AppRoutes.offersAndDiscounts);
|
|
|
|
child: Container(
|
|
|
|
})
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
],
|
|
|
|
color: Colors.white,
|
|
|
|
).paddingOnly(left: 21, right: 21),
|
|
|
|
borderRadius: BorderRadius.circular(17), // Slightly less than outer radius
|
|
|
|
Consumer<DashboardProviderModel>(
|
|
|
|
),
|
|
|
|
builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
|
|
|
|
child: Row(
|
|
|
|
return SizedBox(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
height: 103 + 33,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
child: ListView.separated(
|
|
|
|
children: [
|
|
|
|
shrinkWrap: true,
|
|
|
|
Expanded(
|
|
|
|
physics: const BouncingScrollPhysics(),
|
|
|
|
flex: 4,
|
|
|
|
padding: const EdgeInsets.only(left: 21, right: 21, top: 13),
|
|
|
|
child: Column(
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
itemBuilder: (BuildContext cxt, int index) {
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
return model.isOffersLoading
|
|
|
|
children: [
|
|
|
|
? const OffersShimmerWidget()
|
|
|
|
Row(
|
|
|
|
: InkWell(
|
|
|
|
children: [
|
|
|
|
onTap: () {
|
|
|
|
Expanded(
|
|
|
|
navigateToDetails(data.getOffersList[index]);
|
|
|
|
flex: 2,
|
|
|
|
},
|
|
|
|
child: RichText(
|
|
|
|
child: SizedBox(
|
|
|
|
text:
|
|
|
|
width: 73,
|
|
|
|
AppState().isArabic(context)
|
|
|
|
child: Column(
|
|
|
|
? const TextSpan(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
TextSpan(
|
|
|
|
Container(
|
|
|
|
text: 'اطلع على مميزات',
|
|
|
|
width: 73,
|
|
|
|
style: TextStyle(fontSize: 16, letterSpacing: -0.2, fontWeight: FontWeight.w700, height: 24 / 16, color: Color(0xFF5D5E5E)),
|
|
|
|
height: 73,
|
|
|
|
),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
TextSpan(
|
|
|
|
color: Colors.white,
|
|
|
|
text: ' مزايا',
|
|
|
|
borderRadius: const BorderRadius.all(
|
|
|
|
style: TextStyle(
|
|
|
|
Radius.circular(100),
|
|
|
|
fontSize: 16,
|
|
|
|
),
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
border: Border.all(color: MyColors.lightGreyE3Color, width: 1),
|
|
|
|
letterSpacing: -0.2,
|
|
|
|
),
|
|
|
|
height: 24 / 16,
|
|
|
|
child: ClipRRect(
|
|
|
|
color: Color(0xFFED1C2B), // Use your MAZAYA red color here if defined, e.g. MyColors.mazayaRed
|
|
|
|
borderRadius: const BorderRadius.all(
|
|
|
|
),
|
|
|
|
Radius.circular(50),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
child: Hero(
|
|
|
|
)
|
|
|
|
tag: "ItemImage" + data.getOffersList[index].offersDiscountId.toString()!,
|
|
|
|
: TextSpan(
|
|
|
|
transitionOnUserGestures: true,
|
|
|
|
children: [
|
|
|
|
child: Image.network(
|
|
|
|
TextSpan(
|
|
|
|
data.getOffersList[index].logo ?? "",
|
|
|
|
text: LocaleKeys.explore.tr() + ' ',
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
style: const TextStyle(fontSize: 16, letterSpacing: -0.2, fontWeight: FontWeight.w700, height: 24 / 16, color: Color(0xFF5D5E5E)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
TextSpan(
|
|
|
|
),
|
|
|
|
text: LocaleKeys.mazaya.tr(),
|
|
|
|
),
|
|
|
|
style: const TextStyle(
|
|
|
|
4.height,
|
|
|
|
fontSize: 16,
|
|
|
|
Expanded(
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
child: AppState().isArabic(context)
|
|
|
|
letterSpacing: -0.2,
|
|
|
|
? data.getOffersList[index].titleAr!.toText12(isCenter: true, maxLine: 1)
|
|
|
|
height: 24 / 16,
|
|
|
|
: data.getOffersList[index].titleEn!.toText12(isCenter: true, maxLine: 1),
|
|
|
|
color: Color(0xFFED1C2B), // Use your MAZAYA red color here if defined, e.g. MyColors.mazayaRed
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
TextSpan(
|
|
|
|
|
|
|
|
text: ' ' + LocaleKeys.benefits.tr(),
|
|
|
|
|
|
|
|
style: const TextStyle(fontSize: 16, letterSpacing: -0.2, fontWeight: FontWeight.w700, height: 24 / 16, color: Color(0xFF5D5E5E)),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const Expanded(flex: 1, child: SizedBox()),
|
|
|
|
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
},
|
|
|
|
LocaleKeys.mazayaDesc.tr().toText11(color: const Color(0xFF5D5E5E)),
|
|
|
|
separatorBuilder: (BuildContext cxt, int index) => 8.width,
|
|
|
|
],
|
|
|
|
itemCount: 9),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
),
|
|
|
|
},
|
|
|
|
Expanded(
|
|
|
|
),
|
|
|
|
flex: 2,
|
|
|
|
],
|
|
|
|
child: Column(
|
|
|
|
);
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
}),
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
SvgPicture.asset("assets/icons/mazaya_brand.svg", width: 90, height: 47),
|
|
|
|
|
|
|
|
const SizedBox(height: 28),
|
|
|
|
|
|
|
|
LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true, color: const Color(0xFF3B3D4A)).onPress(() {
|
|
|
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.offersAndDiscounts);
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
).paddingOnly(left: 21, right: 21, top: 14, bottom: 14),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
).paddingOnly(left: 21, right: 21, top: 0, bottom: 21),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Container(
|
|
|
|
|
|
|
|
// height: 121,
|
|
|
|
|
|
|
|
// decoration: BoxDecoration(
|
|
|
|
|
|
|
|
// borderRadius: BorderRadius.circular(12),
|
|
|
|
|
|
|
|
// border: Border.all(width: 3, color: Colors.red),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// child: Padding(padding: const EdgeInsets.all(4.0), child: Container(decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white))),
|
|
|
|
|
|
|
|
// ).paddingOnly(left: 21, right: 21, bottom: 21),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Row(
|
|
|
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
|
|
|
// children: [
|
|
|
|
|
|
|
|
// Expanded(
|
|
|
|
|
|
|
|
// child: Column(
|
|
|
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
// mainAxisSize: MainAxisSize.min,
|
|
|
|
|
|
|
|
// children: [
|
|
|
|
|
|
|
|
// LocaleKeys.offers.tr().toText12(),
|
|
|
|
|
|
|
|
// Row(
|
|
|
|
|
|
|
|
// children: [
|
|
|
|
|
|
|
|
// LocaleKeys.discounts.tr().toText24(isBold: true),
|
|
|
|
|
|
|
|
// 6.width,
|
|
|
|
|
|
|
|
// Container(
|
|
|
|
|
|
|
|
// padding: const EdgeInsets.only(left: 8, right: 8),
|
|
|
|
|
|
|
|
// decoration: BoxDecoration(
|
|
|
|
|
|
|
|
// color: MyColors.yellowColor,
|
|
|
|
|
|
|
|
// borderRadius: BorderRadius.circular(10),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// child: LocaleKeys.newString.tr().toText10(isBold: true)),
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() {
|
|
|
|
|
|
|
|
// Navigator.pushNamed(context, AppRoutes.offersAndDiscounts);
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// ).paddingOnly(left: 21, right: 21),
|
|
|
|
|
|
|
|
// Consumer<DashboardProviderModel>(
|
|
|
|
|
|
|
|
// builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
|
|
|
|
|
|
|
|
// return SizedBox(
|
|
|
|
|
|
|
|
// height: 103 + 33,
|
|
|
|
|
|
|
|
// child: ListView.separated(
|
|
|
|
|
|
|
|
// shrinkWrap: true,
|
|
|
|
|
|
|
|
// physics: const BouncingScrollPhysics(),
|
|
|
|
|
|
|
|
// padding: const EdgeInsets.only(left: 21, right: 21, top: 13),
|
|
|
|
|
|
|
|
// scrollDirection: Axis.horizontal,
|
|
|
|
|
|
|
|
// itemBuilder: (BuildContext cxt, int index) {
|
|
|
|
|
|
|
|
// return model.isOffersLoading
|
|
|
|
|
|
|
|
// ? const OffersShimmerWidget()
|
|
|
|
|
|
|
|
// : InkWell(
|
|
|
|
|
|
|
|
// onTap: () {
|
|
|
|
|
|
|
|
// navigateToDetails(data.getOffersList[index]);
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// child: SizedBox(
|
|
|
|
|
|
|
|
// width: 73,
|
|
|
|
|
|
|
|
// child: Column(
|
|
|
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
|
|
|
// children: [
|
|
|
|
|
|
|
|
// Container(
|
|
|
|
|
|
|
|
// width: 73,
|
|
|
|
|
|
|
|
// height: 73,
|
|
|
|
|
|
|
|
// decoration: BoxDecoration(
|
|
|
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
|
|
|
// borderRadius: const BorderRadius.all(
|
|
|
|
|
|
|
|
// Radius.circular(100),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// border: Border.all(color: MyColors.lightGreyE3Color, width: 1),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// child: ClipRRect(
|
|
|
|
|
|
|
|
// borderRadius: const BorderRadius.all(
|
|
|
|
|
|
|
|
// Radius.circular(50),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// child: Hero(
|
|
|
|
|
|
|
|
// tag: "ItemImage" + data.getOffersList[index].offersDiscountId.toString()!,
|
|
|
|
|
|
|
|
// transitionOnUserGestures: true,
|
|
|
|
|
|
|
|
// child: Image.network(
|
|
|
|
|
|
|
|
// data.getOffersList[index].logo ?? "",
|
|
|
|
|
|
|
|
// fit: BoxFit.contain,
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// 4.height,
|
|
|
|
|
|
|
|
// Expanded(
|
|
|
|
|
|
|
|
// child: AppState().isArabic(context)
|
|
|
|
|
|
|
|
// ? data.getOffersList[index].titleAr!.toText12(isCenter: true, maxLine: 1)
|
|
|
|
|
|
|
|
// : data.getOffersList[index].titleEn!.toText12(isCenter: true, maxLine: 1),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// separatorBuilder: (BuildContext cxt, int index) => 8.width,
|
|
|
|
|
|
|
|
// itemCount: 9),
|
|
|
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
width: double.infinity,
|
|
|
|
width: double.infinity,
|
|
|
|
padding: const EdgeInsets.only(top: 31),
|
|
|
|
padding: const EdgeInsets.only(top: 31),
|
|
|
|
@ -589,38 +689,24 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
drawer: SafeArea(
|
|
|
|
drawer: SafeArea(child: AppDrawer(onLanguageChange: _onRefresh)),
|
|
|
|
child: AppDrawer(onLanguageChange: _onRefresh),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
bottomNavigationBar: SizedBox(
|
|
|
|
bottomNavigationBar: SizedBox(
|
|
|
|
height: Platform.isAndroid ? 70 : 100,
|
|
|
|
height: Platform.isAndroid ? 70 : 100,
|
|
|
|
child: BottomNavigationBar(
|
|
|
|
child: BottomNavigationBar(
|
|
|
|
items: <BottomNavigationBarItem>[
|
|
|
|
items: <BottomNavigationBarItem>[
|
|
|
|
|
|
|
|
BottomNavigationBarItem(icon: SvgPicture.asset("assets/icons/home.svg", color: currentIndex == 0 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4), label: LocaleKeys.home.tr()),
|
|
|
|
BottomNavigationBarItem(
|
|
|
|
BottomNavigationBarItem(
|
|
|
|
icon: SvgPicture.asset(
|
|
|
|
icon: SvgPicture.asset("assets/icons/create_req.svg", color: currentIndex == 1 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4),
|
|
|
|
"assets/icons/home.svg",
|
|
|
|
|
|
|
|
color: currentIndex == 0 ? MyColors.grey3AColor : MyColors.grey98Color,
|
|
|
|
|
|
|
|
).paddingAll(4),
|
|
|
|
|
|
|
|
label: LocaleKeys.home.tr(),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
BottomNavigationBarItem(
|
|
|
|
|
|
|
|
icon: SvgPicture.asset(
|
|
|
|
|
|
|
|
"assets/icons/create_req.svg",
|
|
|
|
|
|
|
|
color: currentIndex == 1 ? MyColors.grey3AColor : MyColors.grey98Color,
|
|
|
|
|
|
|
|
).paddingAll(4),
|
|
|
|
|
|
|
|
label: LocaleKeys.mowadhafhiRequest.tr(),
|
|
|
|
label: LocaleKeys.mowadhafhiRequest.tr(),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
BottomNavigationBarItem(
|
|
|
|
BottomNavigationBarItem(
|
|
|
|
icon: Stack(
|
|
|
|
icon: Stack(
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
SvgPicture.asset(
|
|
|
|
SvgPicture.asset("assets/icons/work_list.svg", color: currentIndex == 2 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4),
|
|
|
|
"assets/icons/work_list.svg",
|
|
|
|
|
|
|
|
color: currentIndex == 2 ? MyColors.grey3AColor : MyColors.grey98Color,
|
|
|
|
|
|
|
|
).paddingAll(4),
|
|
|
|
|
|
|
|
Consumer<DashboardProviderModel>(
|
|
|
|
Consumer<DashboardProviderModel>(
|
|
|
|
builder: (BuildContext cxt, DashboardProviderModel data, Widget? child) {
|
|
|
|
builder: (BuildContext cxt, DashboardProviderModel data, Widget? child) {
|
|
|
|
if (data.workListCounter == 0) {
|
|
|
|
if (data.workListCounter == 0) {
|
|
|
|
@ -643,10 +729,7 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
|
|
|
|
label: LocaleKeys.workList.tr(),
|
|
|
|
label: LocaleKeys.workList.tr(),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
BottomNavigationBarItem(
|
|
|
|
BottomNavigationBarItem(
|
|
|
|
icon: SvgPicture.asset(
|
|
|
|
icon: SvgPicture.asset("assets/icons/item_for_sale.svg", color: currentIndex == 3 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4),
|
|
|
|
"assets/icons/item_for_sale.svg",
|
|
|
|
|
|
|
|
color: currentIndex == 3 ? MyColors.grey3AColor : MyColors.grey98Color,
|
|
|
|
|
|
|
|
).paddingAll(4),
|
|
|
|
|
|
|
|
label: LocaleKeys.itemsForSale.tr(),
|
|
|
|
label: LocaleKeys.itemsForSale.tr(),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
BottomNavigationBarItem(
|
|
|
|
BottomNavigationBarItem(
|
|
|
|
@ -655,28 +738,29 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
SvgPicture.asset(
|
|
|
|
SvgPicture.asset(
|
|
|
|
"assets/icons/chat/chat.svg",
|
|
|
|
"assets/icons/chat/chat.svg",
|
|
|
|
color: !checkIfPrivilegedForChat()
|
|
|
|
color:
|
|
|
|
? MyColors.lightGreyE3Color
|
|
|
|
!checkIfPrivilegedForChat()
|
|
|
|
: currentIndex == 4
|
|
|
|
? MyColors.lightGreyE3Color
|
|
|
|
|
|
|
|
: currentIndex == 4
|
|
|
|
? MyColors.grey3AColor
|
|
|
|
? MyColors.grey3AColor
|
|
|
|
: cProvider.disbaleChatForThisUser
|
|
|
|
: cProvider.disbaleChatForThisUser
|
|
|
|
? MyColors.lightGreyE3Color
|
|
|
|
? MyColors.lightGreyE3Color
|
|
|
|
: MyColors.grey98Color,
|
|
|
|
: MyColors.grey98Color,
|
|
|
|
).paddingAll(4),
|
|
|
|
).paddingAll(4),
|
|
|
|
Consumer<ChatProviderModel>(
|
|
|
|
Consumer<ChatProviderModel>(
|
|
|
|
builder: (BuildContext cxt, ChatProviderModel data, Widget? child) {
|
|
|
|
builder: (BuildContext cxt, ChatProviderModel data, Widget? child) {
|
|
|
|
return !checkIfPrivilegedForChat()
|
|
|
|
return !checkIfPrivilegedForChat()
|
|
|
|
? const SizedBox()
|
|
|
|
? const SizedBox()
|
|
|
|
: Positioned(
|
|
|
|
: Positioned(
|
|
|
|
right: 0,
|
|
|
|
right: 0,
|
|
|
|
top: 0,
|
|
|
|
top: 0,
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
padding: const EdgeInsets.only(left: 4, right: 4),
|
|
|
|
padding: const EdgeInsets.only(left: 4, right: 4),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
alignment: Alignment.center,
|
|
|
|
decoration: BoxDecoration(color: cProvider.disbaleChatForThisUser ? MyColors.pinkDarkColor : MyColors.redColor, borderRadius: BorderRadius.circular(17)),
|
|
|
|
decoration: BoxDecoration(color: cProvider.disbaleChatForThisUser ? MyColors.pinkDarkColor : MyColors.redColor, borderRadius: BorderRadius.circular(17)),
|
|
|
|
child: data.chatUConvCounter.toString().toText10(color: Colors.white),
|
|
|
|
child: data.chatUConvCounter.toString().toText10(color: Colors.white),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
@ -714,8 +798,8 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
|
|
|
|
return (context.watch<DashboardProviderModel>().isEventLoadingLoading)
|
|
|
|
return (context.watch<DashboardProviderModel>().isEventLoadingLoading)
|
|
|
|
? const MarathonBannerShimmer().paddingOnly(left: 21, right: 21, bottom: 21, top: 0)
|
|
|
|
? const MarathonBannerShimmer().paddingOnly(left: 21, right: 21, bottom: 21, top: 0)
|
|
|
|
: (context.watch<DashboardProviderModel>().eventActivity != null && context.watch<DashboardProviderModel>().eventActivity!.isActive == true)
|
|
|
|
: (context.watch<DashboardProviderModel>().eventActivity != null && context.watch<DashboardProviderModel>().eventActivity!.isActive == true)
|
|
|
|
? const EventActivityBanner().paddingOnly(left: 21, right: 21, bottom: 21, top: 0)
|
|
|
|
? const EventActivityBanner().paddingOnly(left: 21, right: 21, bottom: 21, top: 0)
|
|
|
|
: const SizedBox();
|
|
|
|
: const SizedBox();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void navigateToDetails(OffersListModel offersListModelObj) {
|
|
|
|
void navigateToDetails(OffersListModel offersListModelObj) {
|
|
|
|
|