|
|
|
|
@ -1,7 +1,6 @@
|
|
|
|
|
import 'dart:async';
|
|
|
|
|
import 'dart:io';
|
|
|
|
|
import 'dart:ui' as ui;
|
|
|
|
|
|
|
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter_countdown_timer/flutter_countdown_timer.dart';
|
|
|
|
|
@ -34,6 +33,7 @@ import 'package:mohem_flutter_app/widgets/shimmer/offers_shimmer_widget.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:pull_to_refresh/pull_to_refresh.dart';
|
|
|
|
|
import 'package:signalr_netcore/signalr_client.dart';
|
|
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
|
|
|
|
|
|
late HubConnection chatHubConnection;
|
|
|
|
|
|
|
|
|
|
@ -155,6 +155,7 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
|
|
|
|
|
data.fetchLeaveTicketBalance(context, DateTime.now());
|
|
|
|
|
data.fetchMenuEntries();
|
|
|
|
|
data.fetchEventActivity();
|
|
|
|
|
data.fetchGreetingCards();
|
|
|
|
|
data.getCategoryOffersListAPI(context);
|
|
|
|
|
marathonProvider.getMarathonDetailsFromApi();
|
|
|
|
|
marathonProvider.getMarathonTutorial();
|
|
|
|
|
@ -316,103 +317,103 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
|
|
|
|
|
child: Consumer<DashboardProviderModel>(
|
|
|
|
|
builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
|
|
|
|
|
return (model.isAttendanceTrackingLoading
|
|
|
|
|
? GetAttendanceTrackingShimmer()
|
|
|
|
|
: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.circular(15),
|
|
|
|
|
gradient: const LinearGradient(
|
|
|
|
|
transform: GradientRotation(.46),
|
|
|
|
|
begin: Alignment.topRight,
|
|
|
|
|
end: Alignment.bottomLeft,
|
|
|
|
|
colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: Stack(
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
if (model.isTimeRemainingInSeconds == 0) SvgPicture.asset("assets/images/thumb.svg"),
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
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,
|
|
|
|
|
? GetAttendanceTrackingShimmer()
|
|
|
|
|
: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: BorderRadius.circular(15),
|
|
|
|
|
gradient: const LinearGradient(
|
|
|
|
|
transform: GradientRotation(.46),
|
|
|
|
|
begin: Alignment.topRight,
|
|
|
|
|
end: Alignment.bottomLeft,
|
|
|
|
|
colors: [MyColors.gradiantEndColor, MyColors.gradiantStartColor],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: Stack(
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
if (model.isTimeRemainingInSeconds == 0) SvgPicture.asset("assets/images/thumb.svg"),
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
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: [
|
|
|
|
|
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),
|
|
|
|
|
),
|
|
|
|
|
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),
|
|
|
|
|
),
|
|
|
|
|
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),
|
|
|
|
|
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));
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
).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();
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
@ -424,8 +425,102 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
).paddingOnly(left: 21, right: 21, top: 7, bottom: 21),
|
|
|
|
|
eventActivityWidget(context),
|
|
|
|
|
Consumer<DashboardProviderModel>(
|
|
|
|
|
builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
|
|
|
|
|
if (model.isGreetingCardsLoading) {
|
|
|
|
|
return const GreetingCardShimmer();
|
|
|
|
|
} else if (model.isDisplayEidGreetings && model.greetingCardsList != null && model.greetingCardsList!.isNotEmpty) {
|
|
|
|
|
return SizedBox(
|
|
|
|
|
height: 120,
|
|
|
|
|
child: ListView.separated(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 21),
|
|
|
|
|
itemCount: model.greetingCardsList!.length,
|
|
|
|
|
separatorBuilder: (context, index) => const SizedBox(width: 12),
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
var card = model.greetingCardsList![index];
|
|
|
|
|
return SizedBox(
|
|
|
|
|
width: MediaQuery.of(context).size.width - 42,
|
|
|
|
|
child: Directionality(
|
|
|
|
|
textDirection: AppState().isArabic(context) ? ui.TextDirection.rtl : ui.TextDirection.ltr,
|
|
|
|
|
child: Stack(
|
|
|
|
|
children: [
|
|
|
|
|
Transform.flip(
|
|
|
|
|
flipX: !AppState().isArabic(context),
|
|
|
|
|
child: SvgPicture.network(
|
|
|
|
|
AppState().isArabic(context)
|
|
|
|
|
? (card.backgroundImageUrlAr ?? "http://meena-health-care-1.s3.eu-north-1.amazonaws.com/eid_banner.svg")
|
|
|
|
|
: (card.backgroundImageUrlEn ?? "http://meena-health-care-1.s3.eu-north-1.amazonaws.com/eid_banner.svg"),
|
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
|
placeholderBuilder: (context) => ClipRRect(borderRadius: BorderRadius.circular(18), child: Container(height: 80, color: Colors.white).toShimmer()),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(width: AppState().isArabic(context) ? 10 : 40),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
AppState().isArabic(context) ? card.titleAr ?? '' : card.titleEn ?? '',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: AppState().isArabic(context) ? 20 : 18,
|
|
|
|
|
letterSpacing: -0.2,
|
|
|
|
|
fontFamily: AppState().isArabic(context) ? 'Cairo' : 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
height: 24 / 16,
|
|
|
|
|
color: const Color(0xFF3B3E4F),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 4),
|
|
|
|
|
Text(
|
|
|
|
|
AppState().isArabic(context) ? card.descriptionAr ?? '' : card.descriptionEn ?? '',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: AppState().isArabic(context) ? 16 : 14,
|
|
|
|
|
letterSpacing: -0.2,
|
|
|
|
|
fontFamily: AppState().isArabic(context) ? 'Cairo' : 'Poppins',
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
color: const Color(0xFF3B3E4F),
|
|
|
|
|
),
|
|
|
|
|
maxLines: 2,
|
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
(AppState().isArabic(context)
|
|
|
|
|
? card.buttonTextN!.toText12(isUnderLine: true, color: const Color(0xFF3B3D4A))
|
|
|
|
|
: card.buttonText!.toText12(isUnderLine: true, color: const Color(0xFF3B3D4A)))
|
|
|
|
|
.onPress(() {
|
|
|
|
|
launchUrl(Uri.parse(AppState().isArabic(context) ? card.urlAr! : card.urlEn!));
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
).paddingOnly(bottom: 10, right: 15, left: 15),
|
|
|
|
|
],
|
|
|
|
|
).paddingOnly(left: AppState().isArabic(context) ? 10 : 36, right: AppState().isArabic(context) ? 66 : 10, top: 6, bottom: 40),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
).paddingOnly(bottom: 0);
|
|
|
|
|
} else {
|
|
|
|
|
return const SizedBox();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
// eventActivityWidget(context),
|
|
|
|
|
if (isDisplayMazaya) ...[
|
|
|
|
|
Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
@ -461,70 +556,70 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
|
|
|
|
|
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),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
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: const 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()),
|
|
|
|
|
@ -577,12 +672,10 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
|
|
|
|
|
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)),
|
|
|
|
|
padding: const EdgeInsets.only(left: 8, right: 8),
|
|
|
|
|
decoration: BoxDecoration(color: MyColors.yellowColor, borderRadius: BorderRadius.circular(10)),
|
|
|
|
|
child: LocaleKeys.newString.tr().toText10(isBold: true),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
@ -590,7 +683,7 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
|
|
|
|
|
),
|
|
|
|
|
LocaleKeys.viewAllOffers.tr().toText12(isUnderLine: true).onPress(() {
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.offersAndDiscounts);
|
|
|
|
|
})
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
).paddingOnly(left: 21, right: 21),
|
|
|
|
|
Consumer<DashboardProviderModel>(
|
|
|
|
|
@ -598,59 +691,54 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
|
|
|
|
|
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),
|
|
|
|
|
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: Hero(
|
|
|
|
|
tag: "ItemImage" + data.getOffersList[index].offersDiscountId.toString()!,
|
|
|
|
|
transitionOnUserGestures: true,
|
|
|
|
|
child: Image.network(
|
|
|
|
|
data.getOffersList[index].logo ?? "",
|
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
|
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),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
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),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
separatorBuilder: (BuildContext cxt, int index) => 8.width,
|
|
|
|
|
itemCount: 9,
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
@ -773,28 +861,28 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
|
|
|
|
|
SvgPicture.asset(
|
|
|
|
|
"assets/icons/chat/chat.svg",
|
|
|
|
|
color:
|
|
|
|
|
!checkIfPrivilegedForChat()
|
|
|
|
|
? MyColors.lightGreyE3Color
|
|
|
|
|
: currentIndex == 4
|
|
|
|
|
? MyColors.grey3AColor
|
|
|
|
|
: cProvider.disbaleChatForThisUser
|
|
|
|
|
? MyColors.lightGreyE3Color
|
|
|
|
|
: MyColors.grey98Color,
|
|
|
|
|
!checkIfPrivilegedForChat()
|
|
|
|
|
? MyColors.lightGreyE3Color
|
|
|
|
|
: currentIndex == 4
|
|
|
|
|
? MyColors.grey3AColor
|
|
|
|
|
: cProvider.disbaleChatForThisUser
|
|
|
|
|
? MyColors.lightGreyE3Color
|
|
|
|
|
: MyColors.grey98Color,
|
|
|
|
|
).paddingAll(4),
|
|
|
|
|
Consumer<ChatProviderModel>(
|
|
|
|
|
builder: (BuildContext cxt, ChatProviderModel data, Widget? child) {
|
|
|
|
|
return !checkIfPrivilegedForChat()
|
|
|
|
|
? const SizedBox()
|
|
|
|
|
: Positioned(
|
|
|
|
|
right: 0,
|
|
|
|
|
top: 0,
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: const EdgeInsets.only(left: 4, right: 4),
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
decoration: BoxDecoration(color: cProvider.disbaleChatForThisUser ? MyColors.pinkDarkColor : MyColors.redColor, borderRadius: BorderRadius.circular(17)),
|
|
|
|
|
child: data.chatUConvCounter.toString().toText10(color: Colors.white),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
right: 0,
|
|
|
|
|
top: 0,
|
|
|
|
|
child: Container(
|
|
|
|
|
padding: const EdgeInsets.only(left: 4, right: 4),
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
decoration: BoxDecoration(color: cProvider.disbaleChatForThisUser ? MyColors.pinkDarkColor : MyColors.redColor, borderRadius: BorderRadius.circular(17)),
|
|
|
|
|
child: data.chatUConvCounter.toString().toText10(color: Colors.white),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
|