|
|
|
|
@ -431,86 +431,24 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
|
|
|
|
|
return const GreetingCardShimmer();
|
|
|
|
|
} else if (model.isDisplayEidGreetings && model.greetingCardsList != null && model.greetingCardsList!.isNotEmpty) {
|
|
|
|
|
return SizedBox(
|
|
|
|
|
height: 120,
|
|
|
|
|
height: 140,
|
|
|
|
|
child: ListView.separated(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 21),
|
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 24),
|
|
|
|
|
itemCount: model.greetingCardsList!.length,
|
|
|
|
|
separatorBuilder: (context, index) => const SizedBox(width: 12),
|
|
|
|
|
separatorBuilder: (context, index) => const SizedBox(width: 24),
|
|
|
|
|
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 ?? "https://www.hmg.com/Lists/CS_Greeting_Cards/Attachments/5/CS_Ramadan_26.jpg")
|
|
|
|
|
: (card.backgroundImageUrlEn ?? "https://www.hmg.com/Lists/CS_Greeting_Cards/Attachments/5/CS_Ramadan_26.jpg"),
|
|
|
|
|
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) ? 20 : 50),
|
|
|
|
|
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),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
return SvgPicture.network(
|
|
|
|
|
AppState().isArabic(context)
|
|
|
|
|
? (card.backgroundImageUrlAr ?? "https://www.hmg.com/Lists/CS_Greeting_Cards/Attachments/5/CS_Ramadan_26.jpg")
|
|
|
|
|
: (card.backgroundImageUrlEn ?? "https://www.hmg.com/Lists/CS_Greeting_Cards/Attachments/5/CS_Ramadan_26.jpg"),
|
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
|
placeholderBuilder: (context) => ClipRRect(borderRadius: BorderRadius.circular(18), child: Container(height: 80, color: Colors.white).toShimmer()),
|
|
|
|
|
).onPress(() {
|
|
|
|
|
launchUrl(Uri.parse(AppState().isArabic(context) ? card.urlAr! : card.urlEn!));
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
).paddingOnly(bottom: 0);
|
|
|
|
|
@ -518,8 +456,7 @@ class _DashboardScreenState extends State<DashboardScreen> with WidgetsBindingOb
|
|
|
|
|
return const SizedBox();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
).paddingOnly(bottom: 24),
|
|
|
|
|
// eventActivityWidget(context),
|
|
|
|
|
if (isDisplayMazaya) ...[
|
|
|
|
|
Column(
|
|
|
|
|
|