greeting_card
aamir-csol 2 months ago
parent ba8908d4eb
commit a958257ce9

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 1.2 MiB

@ -643,5 +643,6 @@
"faRequest": "طلب التخلص من FA",
"showMore": "عرض المزيد",
"buyerDetails": "تفاصيل المشتري",
"parkingQr": "وقوف السيارات QR"
"parkingQr": "وقوف السيارات QR",
"startNow": "ابدأ الآن"
}

@ -641,5 +641,6 @@
"faRequest": "FA Disposal Request",
"showMore": "Show More",
"buyerDetails": "Buyer Details",
"parkingQr": "Parking QR"
"parkingQr": "Parking QR",
"startNow": "Start Now"
}

@ -656,7 +656,8 @@ class CodegenLoader extends AssetLoader{
"faRequest": "طلب التخلص من FA",
"showMore": "عرض المزيد",
"buyerDetails": "تفاصيل المشتري",
"parkingQr": "وقوف السيارات QR"
"parkingQr": "وقوف السيارات QR",
"startNow": "ابدأ الآن"
};
static const Map<String,dynamic> _en_US = {
"mohemm": "Mohemm",
@ -1300,7 +1301,8 @@ static const Map<String,dynamic> _en_US = {
"faRequest": "FA Disposal Request",
"showMore": "Show More",
"buyerDetails": "Buyer Details",
"parkingQr": "Parking QR"
"parkingQr": "Parking QR",
"startNow": "Start Now"
};
static const Map<String, Map<String,dynamic>> mapLocales = {"ar_SA": _ar_SA, "en_US": _en_US};
}

@ -629,5 +629,6 @@ abstract class LocaleKeys {
static const showMore = 'showMore';
static const buyerDetails = 'buyerDetails';
static const parkingQr = 'parkingQr';
static const startNow = 'startNow';
}

@ -68,6 +68,7 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
bool isOffersLoading = true;
List<OffersListModel> getOffersList = [];
bool isGreetingCardsLoading = true;
bool isDisplayEidGreetings = false;
List<GetGreetingCardsModelResponseElement>? greetingCardsList;
@ -119,6 +120,8 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
getMenuEntriesList = null;
isOffersLoading = true;
getOffersList = [];
isGreetingCardsLoading = true;
isDisplayEidGreetings = false;
drawerMenuItemList = [
DrawerMenuItem("assets/images/drawer/my_profile.svg", LocaleKeys.myProfile.tr(), AppRoutes.profile),
@ -312,22 +315,23 @@ class DashboardProviderModel with ChangeNotifier, DiagnosticableTreeMixin {
}
void fetchGreetingCards() async {
isGreetingCardsLoading = true;
notifyListeners();
try {
GetGreetingCardsModelResponse? response = await DashboardApiClient().getGreetingCards();
greetingCardsList = response?.getGreetingCardsModelResponse ?? [];
// Check if there are any active greeting cards
if (greetingCardsList != null && greetingCardsList!.isNotEmpty) {
isDisplayEidGreetings = greetingCardsList!.any((card) => card.isActive == true);
} else {
isDisplayEidGreetings = false;
}
isGreetingCardsLoading = false;
notifyListeners();
} catch (ex) {
logger.wtf(ex);
isDisplayEidGreetings = false;
greetingCardsList = [];
isGreetingCardsLoading = false;
notifyListeners();
}
}

@ -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';
@ -284,9 +283,7 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
});
},
),
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("assets/images/announcements.svg", matchTextDirection: true).onPress(() async {
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),
if (data.isDisplayEidGreetings) ...[
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
Consumer<DashboardProviderModel>(
builder: (BuildContext context, DashboardProviderModel model, Widget? child) {
if (model.isGreetingCardsLoading) {
return const GreetingCardShimmer();
} else if (model.isDisplayEidGreetings) {
return Column(
children: [
Directionality(
textDirection: AppState().isArabic(context) ? ui.TextDirection.rtl : ui.TextDirection.ltr,
child: Container(
height: 100,
decoration: BoxDecoration(
color: const Color(0xFFFAF4E7),
border: Border.all(width: 2, color: const Color(0xFFE7E7E7)),
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(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.start,
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: 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);
// }),
// ],
// ),
// ),
SvgPicture.asset("assets/images/greeting.svg", width: 65, height: 81),
const SizedBox(width: 10),
Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(
children: [
Text(
AppState().isArabic(context) ? model.greetingCardsList!.first.descriptionAr ?? '' : model.greetingCardsList!.first.descriptionEn ?? '',
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: 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),
if (isDisplayMazaya) ...[
Column(
@ -954,16 +914,9 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
}
Widget eventActivityWidget(BuildContext context) {
return (context
.watch<DashboardProviderModel>()
.isEventLoadingLoading)
return (context.watch<DashboardProviderModel>().isEventLoadingLoading)
? 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 SizedBox();
}

@ -92,7 +92,7 @@ class ServicesWidget extends StatelessWidget {
aspectRatio: 105 / 105,
child:
data.isServicesMenusLoading
? ServicesMenuShimmer()
? const ServicesMenuShimmer()
: Container(
decoration: BoxDecoration(
color: Colors.white,
@ -266,7 +266,6 @@ class ServicesWidget extends StatelessWidget {
await pro.fetchTicketAccuralBalance(context, DateTime.now());
pro.ticketHistoryTransactionList = await EITApiClient().getEITTransactions("HMG_TICKET_ITENARY_HR_EIT_SS", isCompleteList: true);
Utils.hideLoading(context);
// Here Need Work
Navigator.push(context, MaterialPageRoute(builder: (BuildContext context) => TicketDetailedScreen(url: url, jwtToken: ssoToken.data!.accessToken)));
@ -311,7 +310,7 @@ class ServicesWidget extends StatelessWidget {
padding: const EdgeInsets.only(left: 21, right: 21, top: 13, bottom: 13),
scrollDirection: Axis.horizontal,
itemBuilder: (cxt, index) {
return AspectRatio(aspectRatio: 105 / 105, child: ServicesMenuShimmer());
return AspectRatio(aspectRatio: 105 / 105, child: const ServicesMenuShimmer());
},
separatorBuilder: (cxt, index) => 9.width,
itemCount: 4,

@ -8,6 +8,8 @@ import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:shimmer/shimmer.dart';
class GetAttendanceTrackingShimmer extends StatelessWidget {
const GetAttendanceTrackingShimmer({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
@ -85,6 +87,8 @@ class GetAttendanceTrackingShimmer extends StatelessWidget {
}
class MenuShimmer extends StatelessWidget {
const MenuShimmer({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
@ -122,6 +126,8 @@ class MenuShimmer extends StatelessWidget {
}
class ServicesHeaderShimmer extends StatelessWidget {
const ServicesHeaderShimmer({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Row(
@ -145,6 +151,8 @@ class ServicesHeaderShimmer extends StatelessWidget {
}
class ServicesMenuShimmer extends StatelessWidget {
const ServicesMenuShimmer({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
@ -188,6 +196,75 @@ class ServicesMenuShimmer extends StatelessWidget {
}
}
class GreetingCardShimmer extends StatelessWidget {
const GreetingCardShimmer({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
height: 100,
decoration: BoxDecoration(
color: const Color(0xFFFAF4E7),
border: Border.all(width: 2, color: const Color(0xFFE7E7E7)),
borderRadius: BorderRadius.circular(20),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 65,
height: 81,
decoration: BoxDecoration(
color: Colors.grey[300],
borderRadius: BorderRadius.circular(10),
),
).toShimmer(),
const SizedBox(width: 10),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
width: 150,
height: 16,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(4),
),
).toShimmer(),
const SizedBox(height: 8),
Container(
width: 120,
height: 16,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(4),
),
).toShimmer(),
],
).expanded,
Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
width: 60,
height: 12,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(4),
),
).toShimmer(),
],
),
],
).paddingOnly(left: 8, right: 8, top: 6, bottom: 12),
).paddingOnly(left: 21, right: 21, top: 14, bottom: 14);
}
}
class MarathonBannerShimmer extends StatelessWidget {
const MarathonBannerShimmer({Key? key}) : super(key: key);
@ -305,3 +382,4 @@ class ChatHomeShimmer extends StatelessWidget {
));
}
}

Loading…
Cancel
Save