|  |  |  | @ -3,9 +3,13 @@ import 'dart:convert'; | 
		
	
		
			
				|  |  |  |  | import 'package:flutter/material.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:flutter_html/flutter_html.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/api/pending_transactions_api_client.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/app_state/app_state.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/classes/colors.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/classes/utils.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/extensions/int_extensions.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/models/get_announcement_details.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/widgets/app_bar_widget.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:url_launcher/url_launcher.dart'; | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  | class AnnouncementDetails extends StatefulWidget { | 
		
	
		
			
				|  |  |  |  |   const AnnouncementDetails({Key? key}) : super(key: key); | 
		
	
	
		
			
				
					|  |  |  | @ -36,59 +40,68 @@ class _AnnouncementDetailsState extends State<AnnouncementDetails> { | 
		
	
		
			
				|  |  |  |  |         title: "Announcements", | 
		
	
		
			
				|  |  |  |  |       ), | 
		
	
		
			
				|  |  |  |  |       body: SingleChildScrollView( | 
		
	
		
			
				|  |  |  |  |         child: Container( | 
		
	
		
			
				|  |  |  |  |           width: double.infinity, | 
		
	
		
			
				|  |  |  |  |           padding: const EdgeInsets.all(10.0), | 
		
	
		
			
				|  |  |  |  |           margin: const EdgeInsets.all(12.0), | 
		
	
		
			
				|  |  |  |  |           decoration: BoxDecoration( | 
		
	
		
			
				|  |  |  |  |             color: Colors.white, | 
		
	
		
			
				|  |  |  |  |             borderRadius: BorderRadius.circular(10), | 
		
	
		
			
				|  |  |  |  |             boxShadow: [ | 
		
	
		
			
				|  |  |  |  |               BoxShadow( | 
		
	
		
			
				|  |  |  |  |                 color: const Color(0xff000000).withOpacity(.05), | 
		
	
		
			
				|  |  |  |  |                 blurRadius: 26, | 
		
	
		
			
				|  |  |  |  |                 offset: const Offset(0, -3), | 
		
	
		
			
				|  |  |  |  |               ), | 
		
	
		
			
				|  |  |  |  |             ], | 
		
	
		
			
				|  |  |  |  |           ), | 
		
	
		
			
				|  |  |  |  |           child: Column( | 
		
	
		
			
				|  |  |  |  |             crossAxisAlignment: CrossAxisAlignment.start, | 
		
	
		
			
				|  |  |  |  |             mainAxisSize: MainAxisSize.min, | 
		
	
		
			
				|  |  |  |  |             children: [ | 
		
	
		
			
				|  |  |  |  |               SizedBox( | 
		
	
		
			
				|  |  |  |  |         child: getAnnouncementDetailsObj != null | 
		
	
		
			
				|  |  |  |  |             ? Container( | 
		
	
		
			
				|  |  |  |  |                 width: double.infinity, | 
		
	
		
			
				|  |  |  |  |                 height: 150.0, | 
		
	
		
			
				|  |  |  |  |                 child: ClipRRect( | 
		
	
		
			
				|  |  |  |  |                 padding: const EdgeInsets.all(10.0), | 
		
	
		
			
				|  |  |  |  |                 margin: const EdgeInsets.all(12.0), | 
		
	
		
			
				|  |  |  |  |                 decoration: BoxDecoration( | 
		
	
		
			
				|  |  |  |  |                   color: Colors.white, | 
		
	
		
			
				|  |  |  |  |                   borderRadius: BorderRadius.circular(10), | 
		
	
		
			
				|  |  |  |  |                   child: Image.memory( | 
		
	
		
			
				|  |  |  |  |                     base64Decode(Utils.getBase64FromJpeg(getAnnouncementDetailsObj?.bannerImage)), | 
		
	
		
			
				|  |  |  |  |                     fit: BoxFit.cover, | 
		
	
		
			
				|  |  |  |  |                   ), | 
		
	
		
			
				|  |  |  |  |                   boxShadow: [ | 
		
	
		
			
				|  |  |  |  |                     BoxShadow( | 
		
	
		
			
				|  |  |  |  |                       color: const Color(0xff000000).withOpacity(.05), | 
		
	
		
			
				|  |  |  |  |                       blurRadius: 26, | 
		
	
		
			
				|  |  |  |  |                       offset: const Offset(0, -3), | 
		
	
		
			
				|  |  |  |  |                     ), | 
		
	
		
			
				|  |  |  |  |                   ], | 
		
	
		
			
				|  |  |  |  |                 ), | 
		
	
		
			
				|  |  |  |  |               ), | 
		
	
		
			
				|  |  |  |  |               Container( | 
		
	
		
			
				|  |  |  |  |                 margin: const EdgeInsets.only(top: 12.0), | 
		
	
		
			
				|  |  |  |  |                 child: Html( | 
		
	
		
			
				|  |  |  |  |                   data: getAnnouncementDetailsObj?.bodyEN, | 
		
	
		
			
				|  |  |  |  |                 child: Column( | 
		
	
		
			
				|  |  |  |  |                   crossAxisAlignment: CrossAxisAlignment.start, | 
		
	
		
			
				|  |  |  |  |                   mainAxisSize: MainAxisSize.min, | 
		
	
		
			
				|  |  |  |  |                   children: [ | 
		
	
		
			
				|  |  |  |  |                     12.height, | 
		
	
		
			
				|  |  |  |  |                     AppState().isArabic(context) | 
		
	
		
			
				|  |  |  |  |                         ? Text(getAnnouncementDetailsObj?.titleAR ?? "", style: const TextStyle(color: MyColors.darkTextColor, fontSize: 16, letterSpacing: -0.64, fontWeight: FontWeight.w600)) | 
		
	
		
			
				|  |  |  |  |                         : Text(getAnnouncementDetailsObj?.titleEN ?? "", style: const TextStyle(color: MyColors.darkTextColor, fontSize: 16, letterSpacing: -0.64, fontWeight: FontWeight.w600)), | 
		
	
		
			
				|  |  |  |  |                     12.height, | 
		
	
		
			
				|  |  |  |  |                     SizedBox( | 
		
	
		
			
				|  |  |  |  |                       width: double.infinity, | 
		
	
		
			
				|  |  |  |  |                       height: 150.0, | 
		
	
		
			
				|  |  |  |  |                       child: ClipRRect( | 
		
	
		
			
				|  |  |  |  |                         borderRadius: BorderRadius.circular(10), | 
		
	
		
			
				|  |  |  |  |                         child: Image.memory( | 
		
	
		
			
				|  |  |  |  |                           base64Decode(Utils.getBase64FromJpeg(getAnnouncementDetailsObj?.bannerImage)), | 
		
	
		
			
				|  |  |  |  |                           fit: BoxFit.cover, | 
		
	
		
			
				|  |  |  |  |                         ), | 
		
	
		
			
				|  |  |  |  |                       ), | 
		
	
		
			
				|  |  |  |  |                     ), | 
		
	
		
			
				|  |  |  |  |                     Container( | 
		
	
		
			
				|  |  |  |  |                       margin: const EdgeInsets.only(top: 12.0), | 
		
	
		
			
				|  |  |  |  |                       child: Html( | 
		
	
		
			
				|  |  |  |  |                           data: AppState().isArabic(context) ? getAnnouncementDetailsObj?.bodyAR : getAnnouncementDetailsObj?.bodyEN ?? "", | 
		
	
		
			
				|  |  |  |  |                           onLinkTap: (String? url, RenderContext context, Map<String, String> attributes, _) { | 
		
	
		
			
				|  |  |  |  |                             launchUrl(Uri.parse(url!)); | 
		
	
		
			
				|  |  |  |  |                           }), | 
		
	
		
			
				|  |  |  |  |                     ), | 
		
	
		
			
				|  |  |  |  |                   ], | 
		
	
		
			
				|  |  |  |  |                 ), | 
		
	
		
			
				|  |  |  |  |               ), | 
		
	
		
			
				|  |  |  |  |             ], | 
		
	
		
			
				|  |  |  |  |           ), | 
		
	
		
			
				|  |  |  |  |         ), | 
		
	
		
			
				|  |  |  |  |               ) | 
		
	
		
			
				|  |  |  |  |             : Utils.getNoDataWidget(context), | 
		
	
		
			
				|  |  |  |  |       ), | 
		
	
		
			
				|  |  |  |  |     ); | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   getRequestID() { | 
		
	
		
			
				|  |  |  |  |   getRequestID() async { | 
		
	
		
			
				|  |  |  |  |     if (currentPageNo == 0) { | 
		
	
		
			
				|  |  |  |  |       final arguments = (ModalRoute.of(context)?.settings.arguments ?? <String, dynamic>{}) as Map; | 
		
	
		
			
				|  |  |  |  |       currentPageNo = arguments["currentPageNo"]; | 
		
	
		
			
				|  |  |  |  |       rowID = arguments["rowID"]; | 
		
	
		
			
				|  |  |  |  |       getAnnouncementDetails(0, rowID); | 
		
	
		
			
				|  |  |  |  |       await getAnnouncementDetails(0, rowID); | 
		
	
		
			
				|  |  |  |  |     } | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   void getAnnouncementDetails(int itgAwarenessID, int itgRowID) async { | 
		
	
		
			
				|  |  |  |  |   Future getAnnouncementDetails(int itgAwarenessID, int itgRowID) async { | 
		
	
		
			
				|  |  |  |  |     try { | 
		
	
		
			
				|  |  |  |  |       Utils.showLoading(context); | 
		
	
		
			
				|  |  |  |  |       jsonResponse = await PendingTransactionsApiClient().getAnnouncements(itgAwarenessID, currentPageNo, itgRowID); | 
		
	
	
		
			
				
					|  |  |  | 
 |