|
|
|
@ -1,7 +1,6 @@
|
|
|
|
import 'dart:async';
|
|
|
|
import 'dart:async';
|
|
|
|
import 'dart:io';
|
|
|
|
import 'dart:io';
|
|
|
|
import 'dart:ui' as ui;
|
|
|
|
import 'dart:ui' as ui;
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_countdown_timer/flutter_countdown_timer.dart';
|
|
|
|
import 'package:flutter_countdown_timer/flutter_countdown_timer.dart';
|
|
|
|
@ -284,9 +283,7 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Image
|
|
|
|
Image.asset("assets/images/logos/main_mohemm_logo.png", width: 134, height: 28).expanded,
|
|
|
|
.asset("assets/images/logos/main_mohemm_logo.png", width: 134, height: 28)
|
|
|
|
|
|
|
|
.expanded,
|
|
|
|
|
|
|
|
SvgPicture.asset("assets/images/announcements.svg", matchTextDirection: true).onPress(() async {
|
|
|
|
SvgPicture.asset("assets/images/announcements.svg", matchTextDirection: true).onPress(() async {
|
|
|
|
await Navigator.pushNamed(context, AppRoutes.announcements);
|
|
|
|
await Navigator.pushNamed(context, AppRoutes.announcements);
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
@ -426,136 +423,99 @@ 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),
|
|
|
|
if (data.isDisplayEidGreetings) ...[
|
|
|
|
Consumer<DashboardProviderModel>(
|
|
|
|
Column(
|
|
|
|
builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
if (model.isGreetingCardsLoading) {
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
return const GreetingCardShimmer();
|
|
|
|
|
|
|
|
} else if (model.isDisplayEidGreetings) {
|
|
|
|
|
|
|
|
return Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Directionality(
|
|
|
|
Directionality(
|
|
|
|
textDirection: AppState().isArabic(context) ? ui.TextDirection.rtl : ui.TextDirection.ltr,
|
|
|
|
textDirection: AppState().isArabic(context) ? ui.TextDirection.rtl : ui.TextDirection.ltr,
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
height: 100,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
color: const Color(0xFFFAF4E7),
|
|
|
|
|
|
|
|
border: Border.all(width: 2, color: const Color(0xFFE7E7E7)),
|
|
|
|
borderRadius: BorderRadius.circular(20),
|
|
|
|
borderRadius: BorderRadius.circular(20),
|
|
|
|
gradient: const LinearGradient(colors: [Color(0xFFE7E7E7), Color(0xFFE7E7E7)], begin: Alignment.centerLeft, end: Alignment.centerRight),
|
|
|
|
image: const DecorationImage(
|
|
|
|
|
|
|
|
image: NetworkImage(
|
|
|
|
|
|
|
|
"https://dummyimage.com/1200X600/faf4e7/faf4e7.jpg&text=0",
|
|
|
|
|
|
|
|
// AppState().isArabic(context) ? model.greetingCardsList!.first.backgroundImageUrlAr ?? "" : model.greetingCardsList!.first.backgroundImageUrlEn ?? "",
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Padding(
|
|
|
|
|
|
|
|
padding: const EdgeInsets.all(3.0),
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
height: 120,
|
|
|
|
|
|
|
|
decoration: BoxDecoration(color: const Color(0xFFFAF4E7),borderRadius: BorderRadius.circular(17), image: DecorationImage(image: NetworkImage(AppState().isArabic(context) ? data.greetingCardsList!.first.backgroundImageUrlAr ?? "" : data.greetingCardsList!.first.backgroundImageUrlEn ?? ""), fit: BoxFit.cover)),
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
// Expanded(
|
|
|
|
SvgPicture.asset("assets/images/greeting.svg", width: 65, height: 81),
|
|
|
|
// flex: 4,
|
|
|
|
const SizedBox(width: 10),
|
|
|
|
// child: Column(
|
|
|
|
Row(
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
Column(
|
|
|
|
// children: [
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
// Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
// children: [
|
|
|
|
children: [
|
|
|
|
// Expanded(
|
|
|
|
Row(
|
|
|
|
// flex: 2,
|
|
|
|
children: [
|
|
|
|
// child: RichText(
|
|
|
|
Text(
|
|
|
|
// text:
|
|
|
|
AppState().isArabic(context) ? model.greetingCardsList!.first.descriptionAr ?? '' : model.greetingCardsList!.first.descriptionEn ?? '',
|
|
|
|
// AppState().isArabic(context)
|
|
|
|
style: TextStyle(
|
|
|
|
// ? TextSpan(
|
|
|
|
fontSize: AppState().isArabic(context) ? 18 : 16,
|
|
|
|
// children: [
|
|
|
|
letterSpacing: -0.2,
|
|
|
|
// TextSpan(
|
|
|
|
fontFamily: AppState().isArabic(context) ? 'Cairo' : 'Poppins',
|
|
|
|
// text: 'اطلع على مميزات',
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
// style: TextStyle(
|
|
|
|
height: 24 / 16,
|
|
|
|
// fontSize: 16,
|
|
|
|
color: const Color(0xFF3B3E4F),
|
|
|
|
// 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()),
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// 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),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
Row(
|
|
|
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
AppState().isArabic(context) ? model.greetingCardsList!.first.titleAr ?? '' : model.greetingCardsList!.first.titleEn ?? '',
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
fontSize: AppState().isArabic(context) ? 18 : 16,
|
|
|
|
|
|
|
|
letterSpacing: -0.2,
|
|
|
|
|
|
|
|
fontFamily: AppState().isArabic(context) ? 'Cairo' : 'Poppins',
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
|
|
|
height: 24 / 16,
|
|
|
|
|
|
|
|
color: const Color(0xFF3B3E4F),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
).paddingOnly(left: 21, right: 21, top: 0, bottom: 21),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
).paddingOnly(top: 10, bottom: 10).expanded,
|
|
|
|
|
|
|
|
Column(
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
LocaleKeys.startNow.tr().toText12(isUnderLine: true, color: const Color(0xFF3B3D4A)).onPress(() {
|
|
|
|
|
|
|
|
Navigator.pushNamed(context, AppRoutes.offersAndDiscounts);
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
).paddingOnly(left: 8, right: 8, top: 6, bottom: 12),
|
|
|
|
|
|
|
|
).paddingOnly(left: 21, right: 21, top: 14, bottom: 14),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return const SizedBox();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|
|
eventActivityWidget(context),
|
|
|
|
eventActivityWidget(context),
|
|
|
|
if (isDisplayMazaya) ...[
|
|
|
|
if (isDisplayMazaya) ...[
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
@ -954,16 +914,9 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Widget eventActivityWidget(BuildContext context) {
|
|
|
|
Widget eventActivityWidget(BuildContext context) {
|
|
|
|
return (context
|
|
|
|
return (context.watch<DashboardProviderModel>().isEventLoadingLoading)
|
|
|
|
.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
|
|
|
|
: (context.watch<DashboardProviderModel>().eventActivity != null && context.watch<DashboardProviderModel>().eventActivity!.isActive == true)
|
|
|
|
.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();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|