|
|
|
@ -56,6 +56,8 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
|
|
|
|
|
|
|
|
|
|
|
|
int currentIndex = 0;
|
|
|
|
int currentIndex = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool isDisplayMazaya = false;
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
WidgetsBinding.instance.addObserver(this);
|
|
|
|
WidgetsBinding.instance.addObserver(this);
|
|
|
|
@ -149,10 +151,11 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
|
|
|
|
data.fetchAttendanceTracking(context);
|
|
|
|
data.fetchAttendanceTracking(context);
|
|
|
|
data.fetchWorkListCounter(context);
|
|
|
|
data.fetchWorkListCounter(context);
|
|
|
|
data.fetchMissingSwipe(context);
|
|
|
|
data.fetchMissingSwipe(context);
|
|
|
|
|
|
|
|
|
|
|
|
data.fetchLeaveTicketBalance(context, DateTime.now());
|
|
|
|
data.fetchLeaveTicketBalance(context, DateTime.now());
|
|
|
|
data.fetchMenuEntries();
|
|
|
|
data.fetchMenuEntries();
|
|
|
|
data.fetchEventActivity();
|
|
|
|
data.fetchEventActivity();
|
|
|
|
// data.getCategoryOffersListAPI(context);
|
|
|
|
data.getCategoryOffersListAPI(context);
|
|
|
|
marathonProvider.getMarathonDetailsFromApi();
|
|
|
|
marathonProvider.getMarathonDetailsFromApi();
|
|
|
|
marathonProvider.getMarathonTutorial();
|
|
|
|
marathonProvider.getMarathonTutorial();
|
|
|
|
if (isFromInit) {
|
|
|
|
if (isFromInit) {
|
|
|
|
@ -160,6 +163,12 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!cProvider.disbaleChatForThisUser && !isFromInit) checkHubCon();
|
|
|
|
if (!cProvider.disbaleChatForThisUser && !isFromInit) checkHubCon();
|
|
|
|
_refreshController.refreshCompleted();
|
|
|
|
_refreshController.refreshCompleted();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await data.fetchTicketBooking();
|
|
|
|
|
|
|
|
// if (data.ticketBookingResponse != null && !data.ticketBookingResponse!.success) {
|
|
|
|
|
|
|
|
// // data.fetchTicketBalance();
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//continue here
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int ermIndex = 0;
|
|
|
|
int ermIndex = 0;
|
|
|
|
@ -305,103 +314,103 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
|
|
|
|
child: Consumer<DashboardProviderModel>(
|
|
|
|
child: Consumer<DashboardProviderModel>(
|
|
|
|
builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
|
|
|
|
builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
|
|
|
|
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(
|
|
|
|
gradient: const LinearGradient(
|
|
|
|
transform: GradientRotation(.46),
|
|
|
|
transform: GradientRotation(.46),
|
|
|
|
begin: Alignment.topRight,
|
|
|
|
begin: Alignment.topRight,
|
|
|
|
end: Alignment.bottomLeft,
|
|
|
|
end: Alignment.bottomLeft,
|
|
|
|
colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor],
|
|
|
|
colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Stack(
|
|
|
|
child: Stack(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
alignment: Alignment.center,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
if (model.isTimeRemainingInSeconds == 0) SvgPicture.asset("assets/images/thumb.svg"),
|
|
|
|
if (model.isTimeRemainingInSeconds == 0) SvgPicture.asset("assets/images/thumb.svg"),
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
LocaleKeys.markAttendance.tr().toText14(color: Colors.white, isBold: true),
|
|
|
|
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) DateTime.now().toString().split(" ")[0].toText12(color: Colors.white),
|
|
|
|
if (model.isTimeRemainingInSeconds != 0)
|
|
|
|
if (model.isTimeRemainingInSeconds != 0)
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
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(
|
|
|
|
9.height,
|
|
|
|
child: Column(
|
|
|
|
Directionality(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
textDirection: ui.TextDirection.ltr,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
child: CountdownTimer(
|
|
|
|
children: [
|
|
|
|
endTime: model.endTime,
|
|
|
|
LocaleKeys.checkIn.tr().toText12(color: Colors.white),
|
|
|
|
onEnd: null,
|
|
|
|
(model.attendanceTracking!.pSwipeIn == null ? "--:--" : model.attendanceTracking!.pSwipeIn).toString().toText14(
|
|
|
|
endWidget: "00:00:00".toText14(color: Colors.white, isBold: true),
|
|
|
|
color: Colors.white,
|
|
|
|
textStyle: const TextStyle(color: Colors.white, fontSize: 14, letterSpacing: -0.48, fontWeight: FontWeight.bold),
|
|
|
|
isBold: true,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
4.height,
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
).paddingOnly(left: 12, right: 12),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
LocaleKeys.timeLeftToday.tr().toText12(color: Colors.white),
|
|
|
|
margin: EdgeInsets.only(top: AppState().isArabic(context) ? 6 : 0),
|
|
|
|
9.height,
|
|
|
|
width: 45,
|
|
|
|
ClipRRect(
|
|
|
|
height: 45,
|
|
|
|
borderRadius: const BorderRadius.all(Radius.circular(20)),
|
|
|
|
padding: const EdgeInsets.only(left: 10, right: 10),
|
|
|
|
child: LinearProgressIndicator(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
value: model.progress,
|
|
|
|
color: const Color(0xff259EA4),
|
|
|
|
minHeight: 8,
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
valueColor: const AlwaysStoppedAnimation<Color>(Colors.white),
|
|
|
|
bottomRight: AppState().isArabic(context) ? const Radius.circular(0) : const Radius.circular(15),
|
|
|
|
backgroundColor: const Color(0xff196D73),
|
|
|
|
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));
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
).paddingOnly(top: 12, right: 15, left: 12),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
|
|
|
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);
|
|
|
|
),
|
|
|
|
}))
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
).onPress(() {
|
|
|
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.todayAttendance);
|
|
|
|
|
|
|
|
}))
|
|
|
|
.animatedSwither();
|
|
|
|
.animatedSwither();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -414,116 +423,238 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
|
|
|
|
],
|
|
|
|
],
|
|
|
|
).paddingOnly(left: 21, right: 21, top: 7, bottom: 21),
|
|
|
|
).paddingOnly(left: 21, right: 21, top: 7, bottom: 21),
|
|
|
|
eventActivityWidget(context),
|
|
|
|
eventActivityWidget(context),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isDisplayMazaya) ...[
|
|
|
|
|
|
|
|
Column(
|
|
|
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Directionality(
|
|
|
|
|
|
|
|
textDirection: AppState().isArabic(context) ? ui.TextDirection.rtl : ui.TextDirection.ltr,
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(20),
|
|
|
|
|
|
|
|
gradient: const LinearGradient(colors: [Color(0xFF91C481), Color(0xFF7CCED7)], begin: Alignment.centerLeft, end: Alignment.centerRight),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
child: Padding(
|
|
|
|
|
|
|
|
padding: const EdgeInsets.all(3.0), // This creates the border width
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(17), // Slightly less than outer radius
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
flex: 4,
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
flex: 2,
|
|
|
|
|
|
|
|
child: RichText(
|
|
|
|
|
|
|
|
text:
|
|
|
|
|
|
|
|
AppState().isArabic(context)
|
|
|
|
|
|
|
|
? TextSpan(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
TextSpan(
|
|
|
|
|
|
|
|
text: 'اطلع على مميزات',
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
|
|
|
letterSpacing: -0.2,
|
|
|
|
|
|
|
|
fontFamily: AppState().isArabic(context) ? 'Cairo' : 'Poppins',
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
|
|
|
height: 24 / 16,
|
|
|
|
|
|
|
|
color: Color(0xFF5D5E5E),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
TextSpan(
|
|
|
|
|
|
|
|
text: ' مزايا',
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
|
|
|
fontFamily: AppState().isArabic(context) ? 'Cairo' : 'Poppins',
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
|
|
|
letterSpacing: -0.2,
|
|
|
|
|
|
|
|
height: 24 / 16,
|
|
|
|
|
|
|
|
color: MyColors.mazayaRedColor, // Use your MAZAYA red color here if defined, e.g. MyColors.mazayaRed
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
: TextSpan(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
TextSpan(
|
|
|
|
|
|
|
|
text: LocaleKeys.explore.tr() + ' ',
|
|
|
|
|
|
|
|
style: const TextStyle(
|
|
|
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
|
|
|
letterSpacing: -0.2,
|
|
|
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
|
|
|
height: 24 / 16,
|
|
|
|
|
|
|
|
color: Color(0xFF5D5E5E),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
TextSpan(
|
|
|
|
|
|
|
|
text: LocaleKeys.mazaya.tr(),
|
|
|
|
|
|
|
|
style: const TextStyle(
|
|
|
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
|
|
|
letterSpacing: -0.2,
|
|
|
|
|
|
|
|
height: 24 / 16,
|
|
|
|
|
|
|
|
color: MyColors.mazayaRedColor, // 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,
|
|
|
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
|
|
|
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)),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
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.viewallofferMazaya.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),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Directionality(
|
|
|
|
Row(
|
|
|
|
textDirection: AppState().isArabic(context) ? ui.TextDirection.rtl : ui.TextDirection.ltr,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
child: Container(
|
|
|
|
children: [
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
Expanded(
|
|
|
|
borderRadius: BorderRadius.circular(20),
|
|
|
|
child: Column(
|
|
|
|
gradient: const LinearGradient(colors: [Color(0xFF91C481), Color(0xFF7CCED7)], begin: Alignment.centerLeft, end: Alignment.centerRight),
|
|
|
|
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)),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
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(
|
|
|
|
? TextSpan(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
TextSpan(
|
|
|
|
Container(
|
|
|
|
text: 'اطلع على مميزات',
|
|
|
|
width: 73,
|
|
|
|
style: TextStyle(fontSize: 16, letterSpacing: -0.2, fontFamily: AppState().isArabic(context) ? 'Cairo' : 'Poppins', 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,
|
|
|
|
|
|
|
|
fontFamily: AppState().isArabic(context) ? 'Cairo' : 'Poppins',
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
|
|
|
letterSpacing: -0.2,
|
|
|
|
|
|
|
|
height: 24 / 16,
|
|
|
|
|
|
|
|
color: MyColors.mazayaRedColor, // Use your MAZAYA red color here if defined, e.g. MyColors.mazayaRed
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
: TextSpan(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
TextSpan(
|
|
|
|
|
|
|
|
text: LocaleKeys.explore.tr() + ' ',
|
|
|
|
|
|
|
|
style: const TextStyle(fontSize: 16, letterSpacing: -0.2, fontFamily: 'Poppins', fontWeight: FontWeight.w700, height: 24 / 16, color: Color(0xFF5D5E5E)),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
TextSpan(
|
|
|
|
|
|
|
|
text: LocaleKeys.mazaya.tr(),
|
|
|
|
|
|
|
|
style: const TextStyle(
|
|
|
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
|
|
|
fontFamily: 'Poppins',
|
|
|
|
|
|
|
|
letterSpacing: -0.2,
|
|
|
|
|
|
|
|
height: 24 / 16,
|
|
|
|
|
|
|
|
color: MyColors.mazayaRedColor, // 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,
|
|
|
|
|
|
|
|
fontFamily: 'Poppins',fontWeight: FontWeight.w700, height: 24 / 16, color: Color(0xFF5D5E5E)),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
border: Border.all(color: MyColors.lightGreyE3Color, width: 1),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const Expanded(flex: 1, child: SizedBox()),
|
|
|
|
child: ClipRRect(
|
|
|
|
],
|
|
|
|
borderRadius: const BorderRadius.all(
|
|
|
|
),
|
|
|
|
Radius.circular(50),
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
),
|
|
|
|
LocaleKeys.mazayaDesc.tr().toText11(color: const Color(0xFF5D5E5E)),
|
|
|
|
child: Hero(
|
|
|
|
],
|
|
|
|
tag: "ItemImage" + data.getOffersList[index].offersDiscountId.toString()!,
|
|
|
|
),
|
|
|
|
transitionOnUserGestures: true,
|
|
|
|
),
|
|
|
|
child: Image.network(
|
|
|
|
Expanded(
|
|
|
|
data.getOffersList[index].logo ?? "",
|
|
|
|
flex: 2,
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
child: Column(
|
|
|
|
),
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
),
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
),
|
|
|
|
children: [
|
|
|
|
),
|
|
|
|
SvgPicture.asset("assets/icons/mazaya_brand.svg", width: 90, height: 47),
|
|
|
|
4.height,
|
|
|
|
const SizedBox(height: 28),
|
|
|
|
Expanded(
|
|
|
|
LocaleKeys.viewallofferMazaya.tr().toText12(isUnderLine: true, color: const Color(0xFF3B3D4A)).onPress(() {
|
|
|
|
child: AppState().isArabic(context)
|
|
|
|
Navigator.pushNamed(context, AppRoutes.offersAndDiscounts);
|
|
|
|
? data.getOffersList[index].titleAr!.toText12(isCenter: true, maxLine: 1)
|
|
|
|
}),
|
|
|
|
: data.getOffersList[index].titleEn!.toText12(isCenter: true, maxLine: 1),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
],
|
|
|
|
},
|
|
|
|
).paddingOnly(left: 21, right: 21, top: 14, bottom: 14),
|
|
|
|
separatorBuilder: (BuildContext cxt, int index) => 8.width,
|
|
|
|
),
|
|
|
|
itemCount: 9),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
).paddingOnly(left: 21, right: 21, top: 0, bottom: 21),
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
width: double.infinity,
|
|
|
|
width: double.infinity,
|
|
|
|
padding: const EdgeInsets.only(top: 31),
|
|
|
|
padding: const EdgeInsets.only(top: 31),
|
|
|
|
@ -595,7 +726,10 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
|
|
|
|
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(
|
|
|
|
|
|
|
|
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("assets/icons/create_req.svg", color: currentIndex == 1 ? MyColors.grey3AColor : MyColors.grey98Color).paddingAll(4),
|
|
|
|
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(),
|
|
|
|
@ -637,28 +771,28 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
|
|
|
|
SvgPicture.asset(
|
|
|
|
SvgPicture.asset(
|
|
|
|
"assets/icons/chat/chat.svg",
|
|
|
|
"assets/icons/chat/chat.svg",
|
|
|
|
color:
|
|
|
|
color:
|
|
|
|
!checkIfPrivilegedForChat()
|
|
|
|
!checkIfPrivilegedForChat()
|
|
|
|
? MyColors.lightGreyE3Color
|
|
|
|
? MyColors.lightGreyE3Color
|
|
|
|
: currentIndex == 4
|
|
|
|
: 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),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|