|  |  |  | @ -1,5 +1,4 @@ | 
		
	
		
			
				|  |  |  |  | import 'dart:io'; | 
		
	
		
			
				|  |  |  |  | import 'dart:typed_data'; | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  | import 'package:flutter/material.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:flutter/services.dart'; | 
		
	
	
		
			
				
					|  |  |  | @ -19,14 +18,12 @@ import 'package:mohem_flutter_app/models/chat/get_single_user_chat_list_model.da | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/provider/chat_provider_model.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/ui/chat/chat_full_image_preview.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:mohem_flutter_app/ui/chat/common.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:path_provider/path_provider.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:provider/provider.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:rxdart/rxdart.dart'; | 
		
	
		
			
				|  |  |  |  | import 'package:video_player/video_player.dart'; | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  | class GroupChatBubble extends StatelessWidget { | 
		
	
		
			
				|  |  |  |  |   GroupChatBubble({Key? key, required this.dateTime, required this.cItem}) | 
		
	
		
			
				|  |  |  |  |       : super(key: key); | 
		
	
		
			
				|  |  |  |  |   GroupChatBubble({Key? key, required this.dateTime, required this.cItem}) : super(key: key); | 
		
	
		
			
				|  |  |  |  |   final String dateTime; | 
		
	
		
			
				|  |  |  |  |   final GetGroupChatHistoryAsync cItem; | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
	
		
			
				
					|  |  |  | @ -53,27 +50,15 @@ class GroupChatBubble extends StatelessWidget { | 
		
	
		
			
				|  |  |  |  |   late Offset screenOffset; | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   void makeAssign() { | 
		
	
		
			
				|  |  |  |  |     isCurrentUser = cItem.currentUserId == AppState().chatDetails!.response!.id | 
		
	
		
			
				|  |  |  |  |         ? true | 
		
	
		
			
				|  |  |  |  |         : false; | 
		
	
		
			
				|  |  |  |  |     isCurrentUser = cItem.currentUserId == AppState().chatDetails!.response!.id ? true : false; | 
		
	
		
			
				|  |  |  |  |     isSeen = cItem.isSeen == true ? true : false; | 
		
	
		
			
				|  |  |  |  |     isReplied = cItem.groupChatReplyResponse != null ? true : false; | 
		
	
		
			
				|  |  |  |  |     // isVoice = cItem.fileTypeId == 13 && cItem.voiceController != null ? true : false; | 
		
	
		
			
				|  |  |  |  |     fileTypeID = cItem.fileTypeId; | 
		
	
		
			
				|  |  |  |  |     fileTypeName = cItem.fileTypeResponse != null | 
		
	
		
			
				|  |  |  |  |         ? cItem.fileTypeResponse!.fileTypeName | 
		
	
		
			
				|  |  |  |  |         : ""; | 
		
	
		
			
				|  |  |  |  |     fileTypeDescription = cItem.fileTypeResponse != null | 
		
	
		
			
				|  |  |  |  |         ? cItem.fileTypeResponse!.fileTypeDescription | 
		
	
		
			
				|  |  |  |  |         : ""; | 
		
	
		
			
				|  |  |  |  |     isDelivered = cItem.currentUserId == AppState().chatDetails!.response!.id && | 
		
	
		
			
				|  |  |  |  |             cItem.isDelivered == true | 
		
	
		
			
				|  |  |  |  |         ? true | 
		
	
		
			
				|  |  |  |  |         : false; | 
		
	
		
			
				|  |  |  |  |     userName = AppState().chatDetails!.response!.userName == | 
		
	
		
			
				|  |  |  |  |             cItem.currentUserName.toString() | 
		
	
		
			
				|  |  |  |  |         ? "You" | 
		
	
		
			
				|  |  |  |  |         : cItem.currentUserName.toString(); | 
		
	
		
			
				|  |  |  |  |     fileTypeName = cItem.fileTypeResponse != null ? cItem.fileTypeResponse!.fileTypeName : ""; | 
		
	
		
			
				|  |  |  |  |     fileTypeDescription = cItem.fileTypeResponse != null ? cItem.fileTypeResponse!.fileTypeDescription : ""; | 
		
	
		
			
				|  |  |  |  |     isDelivered = cItem.currentUserId == AppState().chatDetails!.response!.id && cItem.isDelivered == true ? true : false; | 
		
	
		
			
				|  |  |  |  |     userName = AppState().chatDetails!.response!.userName == cItem.currentUserName.toString() ? "You" : cItem.currentUserName.toString(); | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   void playVoice( | 
		
	
	
		
			
				
					|  |  |  | @ -82,8 +67,7 @@ class GroupChatBubble extends StatelessWidget { | 
		
	
		
			
				|  |  |  |  |   }) async { | 
		
	
		
			
				|  |  |  |  |     if (data.voice != null && data.voice!.existsSync()) { | 
		
	
		
			
				|  |  |  |  |       if (Platform.isIOS) { | 
		
	
		
			
				|  |  |  |  |         Duration? duration = await data.voiceController! | 
		
	
		
			
				|  |  |  |  |             .setAudioSource(MyCustomStream(data.voice!.readAsBytesSync())); | 
		
	
		
			
				|  |  |  |  |         Duration? duration = await data.voiceController!.setAudioSource(MyCustomStream(data.voice!.readAsBytesSync())); | 
		
	
		
			
				|  |  |  |  |         await data.voiceController!.seek(duration); | 
		
	
		
			
				|  |  |  |  |         await data.voiceController!.setLoopMode(LoopMode.off); | 
		
	
		
			
				|  |  |  |  |         await data.voiceController!.setVolume(1.0); | 
		
	
	
		
			
				
					|  |  |  | @ -98,13 +82,10 @@ class GroupChatBubble extends StatelessWidget { | 
		
	
		
			
				|  |  |  |  |       } | 
		
	
		
			
				|  |  |  |  |     } else { | 
		
	
		
			
				|  |  |  |  |       Utils.showLoading(context); | 
		
	
		
			
				|  |  |  |  |       Uint8List encodedString = await ChatApiClient().downloadURL( | 
		
	
		
			
				|  |  |  |  |           fileName: data.contant!, | 
		
	
		
			
				|  |  |  |  |           fileTypeDescription: provider.getFileTypeDescription( | 
		
	
		
			
				|  |  |  |  |               data.fileTypeResponse!.fileTypeName ?? ""), fileSource: 2); | 
		
	
		
			
				|  |  |  |  |       Uint8List encodedString = | 
		
	
		
			
				|  |  |  |  |           await ChatApiClient().downloadURL(fileName: data.contant!, fileTypeDescription: provider.getFileTypeDescription(data.fileTypeResponse!.fileTypeName ?? ""), fileSource: 2); | 
		
	
		
			
				|  |  |  |  |       // try { | 
		
	
		
			
				|  |  |  |  |       File sFile = await provider.downChatVoice( | 
		
	
		
			
				|  |  |  |  |           encodedString, data.fileTypeResponse!.fileTypeName ?? "", data); | 
		
	
		
			
				|  |  |  |  |       File sFile = await provider.downChatVoice(encodedString, data.fileTypeResponse!.fileTypeName ?? "", data); | 
		
	
		
			
				|  |  |  |  |       if (sFile.path.isEmpty) { | 
		
	
		
			
				|  |  |  |  |         logger.d("Path Is Emptyyyyyyy"); | 
		
	
		
			
				|  |  |  |  |       } else { | 
		
	
	
		
			
				
					|  |  |  | @ -113,8 +94,7 @@ class GroupChatBubble extends StatelessWidget { | 
		
	
		
			
				|  |  |  |  |       data.voice = sFile; | 
		
	
		
			
				|  |  |  |  |       if (Platform.isIOS) { | 
		
	
		
			
				|  |  |  |  |         logger.d("isIOS"); | 
		
	
		
			
				|  |  |  |  |         Duration? duration = await data.voiceController! | 
		
	
		
			
				|  |  |  |  |             .setAudioSource(MyCustomStream(data.voice!.readAsBytesSync())); | 
		
	
		
			
				|  |  |  |  |         Duration? duration = await data.voiceController!.setAudioSource(MyCustomStream(data.voice!.readAsBytesSync())); | 
		
	
		
			
				|  |  |  |  |         await data.voiceController!.seek(duration); | 
		
	
		
			
				|  |  |  |  |         await data.voiceController!.setLoopMode(LoopMode.off); | 
		
	
		
			
				|  |  |  |  |         await data.voiceController!.setVolume(1.0); | 
		
	
	
		
			
				
					|  |  |  | @ -122,8 +102,7 @@ class GroupChatBubble extends StatelessWidget { | 
		
	
		
			
				|  |  |  |  |         Utils.hideLoading(context); | 
		
	
		
			
				|  |  |  |  |         data.voiceController!.play(); | 
		
	
		
			
				|  |  |  |  |       } else { | 
		
	
		
			
				|  |  |  |  |         Duration? duration = | 
		
	
		
			
				|  |  |  |  |             await data.voiceController!.setFilePath(sFile.path); | 
		
	
		
			
				|  |  |  |  |         Duration? duration = await data.voiceController!.setFilePath(sFile.path); | 
		
	
		
			
				|  |  |  |  |         await data.voiceController!.setLoopMode(LoopMode.off); | 
		
	
		
			
				|  |  |  |  |         await data.voiceController!.seek(duration); | 
		
	
		
			
				|  |  |  |  |         Utils.hideLoading(context); | 
		
	
	
		
			
				
					|  |  |  | @ -132,8 +111,7 @@ class GroupChatBubble extends StatelessWidget { | 
		
	
		
			
				|  |  |  |  |     } | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   void pausePlaying(BuildContext context, | 
		
	
		
			
				|  |  |  |  |       {required SingleUserChatModel data}) async { | 
		
	
		
			
				|  |  |  |  |   void pausePlaying(BuildContext context, {required SingleUserChatModel data}) async { | 
		
	
		
			
				|  |  |  |  |     await data.voiceController!.pause(); | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
	
		
			
				
					|  |  |  | @ -144,14 +122,8 @@ class GroupChatBubble extends StatelessWidget { | 
		
	
		
			
				|  |  |  |  |     } | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   Stream<PositionData> get _positionDataStream => | 
		
	
		
			
				|  |  |  |  |       Rx.combineLatest3<Duration, Duration, Duration?, PositionData>( | 
		
	
		
			
				|  |  |  |  |           cItem.voiceController!.positionStream, | 
		
	
		
			
				|  |  |  |  |           cItem.voiceController!.bufferedPositionStream, | 
		
	
		
			
				|  |  |  |  |           cItem.voiceController!.durationStream, | 
		
	
		
			
				|  |  |  |  |           (Duration position, Duration bufferedPosition, Duration? duration) => | 
		
	
		
			
				|  |  |  |  |               PositionData( | 
		
	
		
			
				|  |  |  |  |                   position, bufferedPosition, duration ?? Duration.zero)); | 
		
	
		
			
				|  |  |  |  |   Stream<PositionData> get _positionDataStream => Rx.combineLatest3<Duration, Duration, Duration?, PositionData>(cItem.voiceController!.positionStream, cItem.voiceController!.bufferedPositionStream, | 
		
	
		
			
				|  |  |  |  |       cItem.voiceController!.durationStream, (Duration position, Duration bufferedPosition, Duration? duration) => PositionData(position, bufferedPosition, duration ?? Duration.zero)); | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   @override | 
		
	
		
			
				|  |  |  |  |   Widget build(BuildContext context) { | 
		
	
	
		
			
				
					|  |  |  | @ -173,49 +145,26 @@ class GroupChatBubble extends StatelessWidget { | 
		
	
		
			
				|  |  |  |  |               width: double.infinity, | 
		
	
		
			
				|  |  |  |  |               decoration: BoxDecoration( | 
		
	
		
			
				|  |  |  |  |                 border: Border( | 
		
	
		
			
				|  |  |  |  |                   left: BorderSide( | 
		
	
		
			
				|  |  |  |  |                       width: 6, | 
		
	
		
			
				|  |  |  |  |                       color: isCurrentUser | 
		
	
		
			
				|  |  |  |  |                           ? MyColors.gradiantStartColor | 
		
	
		
			
				|  |  |  |  |                           : MyColors.white), | 
		
	
		
			
				|  |  |  |  |                   left: BorderSide(width: 6, color: isCurrentUser ? MyColors.gradiantStartColor : MyColors.white), | 
		
	
		
			
				|  |  |  |  |                 ), | 
		
	
		
			
				|  |  |  |  |                 color: isCurrentUser | 
		
	
		
			
				|  |  |  |  |                     ? MyColors.black.withOpacity(0.10) | 
		
	
		
			
				|  |  |  |  |                     : MyColors.black.withOpacity(0.30), | 
		
	
		
			
				|  |  |  |  |                 color: isCurrentUser ? MyColors.black.withOpacity(0.10) : MyColors.black.withOpacity(0.30), | 
		
	
		
			
				|  |  |  |  |               ), | 
		
	
		
			
				|  |  |  |  |               child: Row( | 
		
	
		
			
				|  |  |  |  |                 children: [ | 
		
	
		
			
				|  |  |  |  |                   Column( | 
		
	
		
			
				|  |  |  |  |                     crossAxisAlignment: CrossAxisAlignment.start, | 
		
	
		
			
				|  |  |  |  |                     children: <Widget>[ | 
		
	
		
			
				|  |  |  |  |                       (userName) | 
		
	
		
			
				|  |  |  |  |                           .toText12( | 
		
	
		
			
				|  |  |  |  |                               color: MyColors.gradiantStartColor, isBold: false) | 
		
	
		
			
				|  |  |  |  |                           .paddingOnly(right: 5, top: 5, bottom: 0, left: 5), | 
		
	
		
			
				|  |  |  |  |                       (userName).toText12(color: MyColors.gradiantStartColor, isBold: false).paddingOnly(right: 5, top: 5, bottom: 0, left: 5), | 
		
	
		
			
				|  |  |  |  |                       Directionality( | 
		
	
		
			
				|  |  |  |  |                         textDirection: provider.getTextDirection( | 
		
	
		
			
				|  |  |  |  |                             cItem.groupChatReplyResponse != null | 
		
	
		
			
				|  |  |  |  |                                 ? cItem.groupChatReplyResponse!.contant | 
		
	
		
			
				|  |  |  |  |                                     .toString() | 
		
	
		
			
				|  |  |  |  |                                 : ""), | 
		
	
		
			
				|  |  |  |  |                         child: (cItem.groupChatReplyResponse != null | 
		
	
		
			
				|  |  |  |  |                                 ? cItem.groupChatReplyResponse!.contant | 
		
	
		
			
				|  |  |  |  |                                     .toString() | 
		
	
		
			
				|  |  |  |  |                                 : "") | 
		
	
		
			
				|  |  |  |  |                             .toText10( | 
		
	
		
			
				|  |  |  |  |                                 color: isCurrentUser | 
		
	
		
			
				|  |  |  |  |                                     ? MyColors.grey71Color | 
		
	
		
			
				|  |  |  |  |                                     : MyColors.white.withOpacity(0.5), | 
		
	
		
			
				|  |  |  |  |                                 isBold: false, | 
		
	
		
			
				|  |  |  |  |                                 maxlines: 4) | 
		
	
		
			
				|  |  |  |  |                         textDirection: provider.getTextDirection(cItem.groupChatReplyResponse != null ? cItem.groupChatReplyResponse!.contant.toString() : ""), | 
		
	
		
			
				|  |  |  |  |                         child: (cItem.groupChatReplyResponse != null ? cItem.groupChatReplyResponse!.contant.toString() : "") | 
		
	
		
			
				|  |  |  |  |                             .toText10(color: isCurrentUser ? MyColors.grey71Color : MyColors.white.withOpacity(0.5), isBold: false, maxlines: 4) | 
		
	
		
			
				|  |  |  |  |                             .paddingOnly(right: 5, top: 5, bottom: 8, left: 5), | 
		
	
		
			
				|  |  |  |  |                       ), | 
		
	
		
			
				|  |  |  |  |                     ], | 
		
	
		
			
				|  |  |  |  |                   ).expanded, | 
		
	
		
			
				|  |  |  |  |                   if (cItem.groupChatReplyResponse != null) | 
		
	
		
			
				|  |  |  |  |                     if (cItem.groupChatReplyResponse!.fileTypeId == 12 || | 
		
	
		
			
				|  |  |  |  |                         cItem.groupChatReplyResponse!.fileTypeId == 3 || | 
		
	
		
			
				|  |  |  |  |                         cItem.groupChatReplyResponse!.fileTypeId == 4) | 
		
	
		
			
				|  |  |  |  |                     if (cItem.groupChatReplyResponse!.fileTypeId == 12 || cItem.groupChatReplyResponse!.fileTypeId == 3 || cItem.groupChatReplyResponse!.fileTypeId == 4) | 
		
	
		
			
				|  |  |  |  |                       ClipRRect( | 
		
	
		
			
				|  |  |  |  |                         borderRadius: BorderRadius.circular(8.0), | 
		
	
		
			
				|  |  |  |  |                         child: SizedBox( | 
		
	
	
		
			
				
					|  |  |  | @ -223,13 +172,8 @@ class GroupChatBubble extends StatelessWidget { | 
		
	
		
			
				|  |  |  |  |                             width: 32, | 
		
	
		
			
				|  |  |  |  |                             child: showImage( | 
		
	
		
			
				|  |  |  |  |                                 isReplyPreview: false, | 
		
	
		
			
				|  |  |  |  |                                 fileName: | 
		
	
		
			
				|  |  |  |  |                                     cItem.groupChatReplyResponse!.contant!, | 
		
	
		
			
				|  |  |  |  |                                 fileTypeDescription: cItem | 
		
	
		
			
				|  |  |  |  |                                         .groupChatReplyResponse! | 
		
	
		
			
				|  |  |  |  |                                         .fileTypeResponse! | 
		
	
		
			
				|  |  |  |  |                                         .fileTypeDescription ?? | 
		
	
		
			
				|  |  |  |  |                                     "image/jpg")), | 
		
	
		
			
				|  |  |  |  |                                 fileName: cItem.groupChatReplyResponse!.contant!, | 
		
	
		
			
				|  |  |  |  |                                 fileTypeDescription: cItem.groupChatReplyResponse!.fileTypeResponse!.fileTypeDescription ?? "image/jpg")), | 
		
	
		
			
				|  |  |  |  |                       ).paddingOnly(left: 10, right: 10, bottom: 16, top: 16), | 
		
	
		
			
				|  |  |  |  |                 ], | 
		
	
		
			
				|  |  |  |  |               ), | 
		
	
	
		
			
				
					|  |  |  | @ -246,52 +190,36 @@ class GroupChatBubble extends StatelessWidget { | 
		
	
		
			
				|  |  |  |  |               child: showImage( | 
		
	
		
			
				|  |  |  |  |                       isReplyPreview: false, | 
		
	
		
			
				|  |  |  |  |                       fileName: cItem.contant!, | 
		
	
		
			
				|  |  |  |  |                       fileTypeDescription: cItem.fileTypeResponse != null && | 
		
	
		
			
				|  |  |  |  |                               cItem.fileTypeResponse!.fileTypeDescription != | 
		
	
		
			
				|  |  |  |  |                                   null | 
		
	
		
			
				|  |  |  |  |                           ? cItem.fileTypeResponse!.fileTypeDescription | 
		
	
		
			
				|  |  |  |  |                           : cItem.fileTypeResponse!.fileTypeName) | 
		
	
		
			
				|  |  |  |  |                       fileTypeDescription: | 
		
	
		
			
				|  |  |  |  |                           cItem.fileTypeResponse != null && cItem.fileTypeResponse!.fileTypeDescription != null ? cItem.fileTypeResponse!.fileTypeDescription : cItem.fileTypeResponse!.fileTypeName) | 
		
	
		
			
				|  |  |  |  |                   .onPress(() { | 
		
	
		
			
				|  |  |  |  |                 showDialog( | 
		
	
		
			
				|  |  |  |  |                   context: context, | 
		
	
		
			
				|  |  |  |  |                   anchorPoint: screenOffset, | 
		
	
		
			
				|  |  |  |  |                   builder: (BuildContext context) => ChatImagePreviewScreen( | 
		
	
		
			
				|  |  |  |  |                       imgTitle: cItem.contant!, img: cItem.image!), | 
		
	
		
			
				|  |  |  |  |                   builder: (BuildContext context) => ChatImagePreviewScreen(imgTitle: cItem.contant!, img: cItem.image!), | 
		
	
		
			
				|  |  |  |  |                 ); | 
		
	
		
			
				|  |  |  |  |               }), | 
		
	
		
			
				|  |  |  |  |             ), | 
		
	
		
			
				|  |  |  |  |           ).paddingOnly(bottom: 4), | 
		
	
		
			
				|  |  |  |  |         if (fileTypeID == 13 && cItem.voiceController != null) | 
		
	
		
			
				|  |  |  |  |           currentWaveBubble(context, cItem), | 
		
	
		
			
				|  |  |  |  |         if (fileTypeID == 13 && cItem.voiceController != null) currentWaveBubble(context, cItem), | 
		
	
		
			
				|  |  |  |  |         if (fileTypeID == 16) | 
		
	
		
			
				|  |  |  |  |           showVideoThumb(context, cItem) | 
		
	
		
			
				|  |  |  |  |           Column( | 
		
	
		
			
				|  |  |  |  |             children: [ | 
		
	
		
			
				|  |  |  |  |               showVideoThumb(context, cItem), | 
		
	
		
			
				|  |  |  |  |               Row( | 
		
	
		
			
				|  |  |  |  |                 children: [ | 
		
	
		
			
				|  |  |  |  |                   Directionality(textDirection: provider.getTextDirection(cItem.contant ?? ""), child: (cItem.contant ?? "").toText12().expanded), | 
		
	
		
			
				|  |  |  |  |                 ], | 
		
	
		
			
				|  |  |  |  |               ), | 
		
	
		
			
				|  |  |  |  |             ], | 
		
	
		
			
				|  |  |  |  |           ) | 
		
	
		
			
				|  |  |  |  |         else | 
		
	
		
			
				|  |  |  |  |           Row( | 
		
	
		
			
				|  |  |  |  |             children: [ | 
		
	
		
			
				|  |  |  |  |               if (fileTypeID == 1 || | 
		
	
		
			
				|  |  |  |  |                       fileTypeID == 5 || | 
		
	
		
			
				|  |  |  |  |                       fileTypeID == 7 || | 
		
	
		
			
				|  |  |  |  |                       fileTypeID == 6 || | 
		
	
		
			
				|  |  |  |  |                       fileTypeID == 8 | 
		
	
		
			
				|  |  |  |  |                   //  || fileTypeID == 2 | 
		
	
		
			
				|  |  |  |  |                   ) | 
		
	
		
			
				|  |  |  |  |                 SvgPicture.asset(provider.getType(fileTypeName ?? ""), | 
		
	
		
			
				|  |  |  |  |                         height: 30, | 
		
	
		
			
				|  |  |  |  |                         width: 22, | 
		
	
		
			
				|  |  |  |  |                         alignment: Alignment.center, | 
		
	
		
			
				|  |  |  |  |                         fit: BoxFit.cover) | 
		
	
		
			
				|  |  |  |  |                     .paddingOnly(left: 0, right: 10), | 
		
	
		
			
				|  |  |  |  |               Directionality( | 
		
	
		
			
				|  |  |  |  |                   textDirection: provider.getTextDirection(cItem.contant ?? ""), | 
		
	
		
			
				|  |  |  |  |                   child: (cItem.contant ?? "").toText12().expanded), | 
		
	
		
			
				|  |  |  |  |               if (fileTypeID == 1 || | 
		
	
		
			
				|  |  |  |  |                       fileTypeID == 5 || | 
		
	
		
			
				|  |  |  |  |                       fileTypeID == 7 || | 
		
	
		
			
				|  |  |  |  |                       fileTypeID == 6 || | 
		
	
		
			
				|  |  |  |  |                       fileTypeID == 8 | 
		
	
		
			
				|  |  |  |  |                   //|| fileTypeID == 2 | 
		
	
		
			
				|  |  |  |  |                   ) | 
		
	
		
			
				|  |  |  |  |                 const Icon(Icons.remove_red_eye, size: 16) | 
		
	
		
			
				|  |  |  |  |               if (fileTypeID == 1 || fileTypeID == 5 || fileTypeID == 7 || fileTypeID == 6 || fileTypeID == 8) | 
		
	
		
			
				|  |  |  |  |                 SvgPicture.asset(provider.getType(fileTypeName ?? ""), height: 30, width: 22, alignment: Alignment.center, fit: BoxFit.cover).paddingOnly(left: 0, right: 10), | 
		
	
		
			
				|  |  |  |  |               Directionality(textDirection: provider.getTextDirection(cItem.contant ?? ""), child: (cItem.contant ?? "").toText12().expanded), | 
		
	
		
			
				|  |  |  |  |               if (fileTypeID == 1 || fileTypeID == 5 || fileTypeID == 7 || fileTypeID == 6 || fileTypeID == 8) const Icon(Icons.remove_red_eye, size: 16) | 
		
	
		
			
				|  |  |  |  |             ], | 
		
	
		
			
				|  |  |  |  |           ), | 
		
	
		
			
				|  |  |  |  |         Align( | 
		
	
	
		
			
				
					|  |  |  | @ -303,32 +231,24 @@ class GroupChatBubble extends StatelessWidget { | 
		
	
		
			
				|  |  |  |  |                 color: MyColors.grey41Color.withOpacity(.5), | 
		
	
		
			
				|  |  |  |  |               ), | 
		
	
		
			
				|  |  |  |  |               7.width, | 
		
	
		
			
				|  |  |  |  |               Icon(isDelivered ? Icons.done_all : Icons.done_all, | 
		
	
		
			
				|  |  |  |  |                   color: isSeen ? MyColors.textMixColor : MyColors.grey9DColor, | 
		
	
		
			
				|  |  |  |  |                   size: 14), | 
		
	
		
			
				|  |  |  |  |               Icon(isDelivered ? Icons.done_all : Icons.done_all, color: isSeen ? MyColors.textMixColor : MyColors.grey9DColor, size: 14), | 
		
	
		
			
				|  |  |  |  |             ], | 
		
	
		
			
				|  |  |  |  |           ), | 
		
	
		
			
				|  |  |  |  |         ), | 
		
	
		
			
				|  |  |  |  |       ], | 
		
	
		
			
				|  |  |  |  |     ) | 
		
	
		
			
				|  |  |  |  |         .paddingOnly(top: 11, left: 13, right: 13, bottom: 5) | 
		
	
		
			
				|  |  |  |  |         .objectContainerView(disablePadding: true) | 
		
	
		
			
				|  |  |  |  |         .paddingOnly(left: MediaQuery.of(context).size.width * 0.3); | 
		
	
		
			
				|  |  |  |  |     ).paddingOnly(top: 11, left: 13, right: 13, bottom: 5).objectContainerView(disablePadding: true).paddingOnly(left: MediaQuery.of(context).size.width * 0.3); | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   Widget receiptUser(BuildContext context) { | 
		
	
		
			
				|  |  |  |  |     return Container( | 
		
	
		
			
				|  |  |  |  |         padding: const EdgeInsets.only(top: 5, left: 8, right: 13, bottom: 5), | 
		
	
		
			
				|  |  |  |  |         padding: const EdgeInsets.only(top: 11, left: 13, right: 13, bottom: 5), | 
		
	
		
			
				|  |  |  |  |         decoration: BoxDecoration( | 
		
	
		
			
				|  |  |  |  |           borderRadius: BorderRadius.circular(10), | 
		
	
		
			
				|  |  |  |  |           gradient: const LinearGradient( | 
		
	
		
			
				|  |  |  |  |             transform: GradientRotation(.83), | 
		
	
		
			
				|  |  |  |  |             begin: Alignment.topRight, | 
		
	
		
			
				|  |  |  |  |             end: Alignment.bottomLeft, | 
		
	
		
			
				|  |  |  |  |             colors: <Color>[ | 
		
	
		
			
				|  |  |  |  |               MyColors.gradiantEndColor, | 
		
	
		
			
				|  |  |  |  |               MyColors.gradiantStartColor | 
		
	
		
			
				|  |  |  |  |             ], | 
		
	
		
			
				|  |  |  |  |             colors: <Color>[MyColors.gradiantEndColor, MyColors.gradiantStartColor], | 
		
	
		
			
				|  |  |  |  |           ), | 
		
	
		
			
				|  |  |  |  |         ), | 
		
	
		
			
				|  |  |  |  |         child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ | 
		
	
	
		
			
				
					|  |  |  | @ -338,51 +258,25 @@ class GroupChatBubble extends StatelessWidget { | 
		
	
		
			
				|  |  |  |  |               child: Container( | 
		
	
		
			
				|  |  |  |  |                 width: double.infinity, | 
		
	
		
			
				|  |  |  |  |                 decoration: BoxDecoration( | 
		
	
		
			
				|  |  |  |  |                   border: Border( | 
		
	
		
			
				|  |  |  |  |                       left: BorderSide( | 
		
	
		
			
				|  |  |  |  |                           width: 6, | 
		
	
		
			
				|  |  |  |  |                           color: isCurrentUser | 
		
	
		
			
				|  |  |  |  |                               ? MyColors.gradiantStartColor | 
		
	
		
			
				|  |  |  |  |                               : MyColors.white)), | 
		
	
		
			
				|  |  |  |  |                   color: isCurrentUser | 
		
	
		
			
				|  |  |  |  |                       ? MyColors.black.withOpacity(0.10) | 
		
	
		
			
				|  |  |  |  |                       : MyColors.black.withOpacity(0.30), | 
		
	
		
			
				|  |  |  |  |                   border: Border(left: BorderSide(width: 6, color: isCurrentUser ? MyColors.gradiantStartColor : MyColors.white)), | 
		
	
		
			
				|  |  |  |  |                   color: isCurrentUser ? MyColors.black.withOpacity(0.10) : MyColors.black.withOpacity(0.30), | 
		
	
		
			
				|  |  |  |  |                 ), | 
		
	
		
			
				|  |  |  |  |                 child: Row( | 
		
	
		
			
				|  |  |  |  |                   children: [ | 
		
	
		
			
				|  |  |  |  |                     Column( | 
		
	
		
			
				|  |  |  |  |                       crossAxisAlignment: CrossAxisAlignment.start, | 
		
	
		
			
				|  |  |  |  |                       children: <Widget>[ | 
		
	
		
			
				|  |  |  |  |                         (userName) | 
		
	
		
			
				|  |  |  |  |                             .toText12( | 
		
	
		
			
				|  |  |  |  |                                 color: MyColors.gradiantStartColor, | 
		
	
		
			
				|  |  |  |  |                                 isBold: false) | 
		
	
		
			
				|  |  |  |  |                             .paddingOnly(right: 5, top: 5, bottom: 0, left: 5), | 
		
	
		
			
				|  |  |  |  |                         (userName).toText12(color: MyColors.gradiantStartColor, isBold: false).paddingOnly(right: 5, top: 5, bottom: 0, left: 5), | 
		
	
		
			
				|  |  |  |  |                         Directionality( | 
		
	
		
			
				|  |  |  |  |                           textDirection: provider.getTextDirection( | 
		
	
		
			
				|  |  |  |  |                               cItem.groupChatReplyResponse != null | 
		
	
		
			
				|  |  |  |  |                                   ? cItem.groupChatReplyResponse!.contant | 
		
	
		
			
				|  |  |  |  |                                       .toString() | 
		
	
		
			
				|  |  |  |  |                                   : ""), | 
		
	
		
			
				|  |  |  |  |                           child: (cItem.groupChatReplyResponse != null | 
		
	
		
			
				|  |  |  |  |                                   ? cItem.groupChatReplyResponse!.contant | 
		
	
		
			
				|  |  |  |  |                                       .toString() | 
		
	
		
			
				|  |  |  |  |                                   : "") | 
		
	
		
			
				|  |  |  |  |                               .toText10( | 
		
	
		
			
				|  |  |  |  |                                   color: isCurrentUser | 
		
	
		
			
				|  |  |  |  |                                       ? MyColors.grey71Color | 
		
	
		
			
				|  |  |  |  |                                       : MyColors.white.withOpacity(0.5), | 
		
	
		
			
				|  |  |  |  |                                   isBold: false, | 
		
	
		
			
				|  |  |  |  |                                   maxlines: 4) | 
		
	
		
			
				|  |  |  |  |                               .paddingOnly( | 
		
	
		
			
				|  |  |  |  |                                   right: 5, top: 5, bottom: 8, left: 5), | 
		
	
		
			
				|  |  |  |  |                           textDirection: provider.getTextDirection(cItem.groupChatReplyResponse != null ? cItem.groupChatReplyResponse!.contant.toString() : ""), | 
		
	
		
			
				|  |  |  |  |                           child: (cItem.groupChatReplyResponse != null ? cItem.groupChatReplyResponse!.contant.toString() : "") | 
		
	
		
			
				|  |  |  |  |                               .toText10(color: isCurrentUser ? MyColors.grey71Color : MyColors.white.withOpacity(0.5), isBold: false, maxlines: 4) | 
		
	
		
			
				|  |  |  |  |                               .paddingOnly(right: 5, top: 5, bottom: 8, left: 5), | 
		
	
		
			
				|  |  |  |  |                         ), | 
		
	
		
			
				|  |  |  |  |                       ], | 
		
	
		
			
				|  |  |  |  |                     ).expanded, | 
		
	
		
			
				|  |  |  |  |                     if (cItem.groupChatReplyResponse != null) | 
		
	
		
			
				|  |  |  |  |                       if (cItem.groupChatReplyResponse!.fileTypeId == 12 || | 
		
	
		
			
				|  |  |  |  |                           cItem.groupChatReplyResponse!.fileTypeId == 3 || | 
		
	
		
			
				|  |  |  |  |                           cItem.groupChatReplyResponse!.fileTypeId == 4) | 
		
	
		
			
				|  |  |  |  |                       if (cItem.groupChatReplyResponse!.fileTypeId == 12 || cItem.groupChatReplyResponse!.fileTypeId == 3 || cItem.groupChatReplyResponse!.fileTypeId == 4) | 
		
	
		
			
				|  |  |  |  |                         ClipRRect( | 
		
	
		
			
				|  |  |  |  |                           borderRadius: BorderRadius.circular(8.0), | 
		
	
		
			
				|  |  |  |  |                           child: SizedBox( | 
		
	
	
		
			
				
					|  |  |  | @ -390,13 +284,8 @@ class GroupChatBubble extends StatelessWidget { | 
		
	
		
			
				|  |  |  |  |                             width: 32, | 
		
	
		
			
				|  |  |  |  |                             child: showImage( | 
		
	
		
			
				|  |  |  |  |                                 isReplyPreview: true, | 
		
	
		
			
				|  |  |  |  |                                 fileName: | 
		
	
		
			
				|  |  |  |  |                                     cItem.groupChatReplyResponse!.contant!, | 
		
	
		
			
				|  |  |  |  |                                 fileTypeDescription: cItem | 
		
	
		
			
				|  |  |  |  |                                         .groupChatReplyResponse! | 
		
	
		
			
				|  |  |  |  |                                         .fileTypeResponse! | 
		
	
		
			
				|  |  |  |  |                                         .fileTypeDescription ?? | 
		
	
		
			
				|  |  |  |  |                                     "image/jpg"), | 
		
	
		
			
				|  |  |  |  |                                 fileName: cItem.groupChatReplyResponse!.contant!, | 
		
	
		
			
				|  |  |  |  |                                 fileTypeDescription: cItem.groupChatReplyResponse!.fileTypeResponse!.fileTypeDescription ?? "image/jpg"), | 
		
	
		
			
				|  |  |  |  |                           ), | 
		
	
		
			
				|  |  |  |  |                         ).paddingOnly(left: 10, right: 10, bottom: 16, top: 16) | 
		
	
		
			
				|  |  |  |  |                   ], | 
		
	
	
		
			
				
					|  |  |  | @ -411,88 +300,55 @@ class GroupChatBubble extends StatelessWidget { | 
		
	
		
			
				|  |  |  |  |               child: SizedBox( | 
		
	
		
			
				|  |  |  |  |                 height: 140, | 
		
	
		
			
				|  |  |  |  |                 width: 227, | 
		
	
		
			
				|  |  |  |  |                 child: showImage( | 
		
	
		
			
				|  |  |  |  |                         isReplyPreview: false, | 
		
	
		
			
				|  |  |  |  |                         fileName: cItem.contant ?? "", | 
		
	
		
			
				|  |  |  |  |                         fileTypeDescription: | 
		
	
		
			
				|  |  |  |  |                             cItem.fileTypeResponse!.fileTypeDescription ?? | 
		
	
		
			
				|  |  |  |  |                                 "image/jpg") | 
		
	
		
			
				|  |  |  |  |                     .onPress(() { | 
		
	
		
			
				|  |  |  |  |                 child: showImage(isReplyPreview: false, fileName: cItem.contant ?? "", fileTypeDescription: cItem.fileTypeResponse!.fileTypeDescription ?? "image/jpg").onPress(() { | 
		
	
		
			
				|  |  |  |  |                   showDialog( | 
		
	
		
			
				|  |  |  |  |                     context: context, | 
		
	
		
			
				|  |  |  |  |                     anchorPoint: screenOffset, | 
		
	
		
			
				|  |  |  |  |                     builder: (BuildContext context) => ChatImagePreviewScreen( | 
		
	
		
			
				|  |  |  |  |                         imgTitle: cItem.contant ?? "", img: cItem.image!), | 
		
	
		
			
				|  |  |  |  |                     builder: (BuildContext context) => ChatImagePreviewScreen(imgTitle: cItem.contant ?? "", img: cItem.image!), | 
		
	
		
			
				|  |  |  |  |                   ); | 
		
	
		
			
				|  |  |  |  |                 }), | 
		
	
		
			
				|  |  |  |  |               ), | 
		
	
		
			
				|  |  |  |  |             ).paddingOnly(bottom: 4), | 
		
	
		
			
				|  |  |  |  |           if (fileTypeID == 13 && cItem.voiceController != null) | 
		
	
		
			
				|  |  |  |  |             recipetWaveBubble(context, cItem), | 
		
	
		
			
				|  |  |  |  |           if (fileTypeID == 13 && cItem.voiceController != null) recipetWaveBubble(context, cItem), | 
		
	
		
			
				|  |  |  |  |           if (fileTypeID == 16) | 
		
	
		
			
				|  |  |  |  |             showVideoThumb(context, cItem) | 
		
	
		
			
				|  |  |  |  |           else | 
		
	
		
			
				|  |  |  |  |             Column( | 
		
	
		
			
				|  |  |  |  |               crossAxisAlignment: CrossAxisAlignment.start, | 
		
	
		
			
				|  |  |  |  |               children: [ | 
		
	
		
			
				|  |  |  |  |                 cItem.currentUserName! | 
		
	
		
			
				|  |  |  |  |                     .toText10( | 
		
	
		
			
				|  |  |  |  |                       color: Colors.black, | 
		
	
		
			
				|  |  |  |  |                     ) | 
		
	
		
			
				|  |  |  |  |                     .paddingOnly(bottom: 5), | 
		
	
		
			
				|  |  |  |  |                 showVideoThumb(context, cItem), | 
		
	
		
			
				|  |  |  |  |                 Row( | 
		
	
		
			
				|  |  |  |  |                   children: [ | 
		
	
		
			
				|  |  |  |  |                     if (fileTypeID == 1 || | 
		
	
		
			
				|  |  |  |  |                             fileTypeID == 5 || | 
		
	
		
			
				|  |  |  |  |                             fileTypeID == 7 || | 
		
	
		
			
				|  |  |  |  |                             fileTypeID == 6 || | 
		
	
		
			
				|  |  |  |  |                             fileTypeID == 8 | 
		
	
		
			
				|  |  |  |  |                         // || fileTypeID == 2 | 
		
	
		
			
				|  |  |  |  |                         ) | 
		
	
		
			
				|  |  |  |  |                       SvgPicture.asset(provider.getType(fileTypeName ?? ""), | 
		
	
		
			
				|  |  |  |  |                               height: 30, | 
		
	
		
			
				|  |  |  |  |                               width: 22, | 
		
	
		
			
				|  |  |  |  |                               alignment: Alignment.center, | 
		
	
		
			
				|  |  |  |  |                               fit: BoxFit.cover) | 
		
	
		
			
				|  |  |  |  |                           .paddingOnly(left: 0, right: 10), | 
		
	
		
			
				|  |  |  |  |                     Directionality( | 
		
	
		
			
				|  |  |  |  |                         textDirection: | 
		
	
		
			
				|  |  |  |  |                             provider.getTextDirection(cItem.contant ?? ""), | 
		
	
		
			
				|  |  |  |  |                         child: (cItem.contant ?? "") | 
		
	
		
			
				|  |  |  |  |                             .toText12(color: Colors.white) | 
		
	
		
			
				|  |  |  |  |                             .expanded), | 
		
	
		
			
				|  |  |  |  |                     if (fileTypeID == 1 || | 
		
	
		
			
				|  |  |  |  |                             fileTypeID == 5 || | 
		
	
		
			
				|  |  |  |  |                             fileTypeID == 7 || | 
		
	
		
			
				|  |  |  |  |                             fileTypeID == 6 || | 
		
	
		
			
				|  |  |  |  |                             fileTypeID == 8 | 
		
	
		
			
				|  |  |  |  |                         //|| fileTypeID == 2 | 
		
	
		
			
				|  |  |  |  |                         ) | 
		
	
		
			
				|  |  |  |  |                       const Icon(Icons.remove_red_eye, | 
		
	
		
			
				|  |  |  |  |                           color: Colors.white, size: 16) | 
		
	
		
			
				|  |  |  |  |                     Directionality(textDirection: provider.getTextDirection(cItem.contant ?? ""), child: (cItem.contant ?? "").toText12(color: Colors.white).expanded), | 
		
	
		
			
				|  |  |  |  |                   ], | 
		
	
		
			
				|  |  |  |  |                 ), | 
		
	
		
			
				|  |  |  |  |                 Align( | 
		
	
		
			
				|  |  |  |  |                   alignment: Alignment.topRight, | 
		
	
		
			
				|  |  |  |  |                   child: dateTime | 
		
	
		
			
				|  |  |  |  |                       .toText10( | 
		
	
		
			
				|  |  |  |  |                         color: Colors.white.withOpacity(.71), | 
		
	
		
			
				|  |  |  |  |                       ) | 
		
	
		
			
				|  |  |  |  |                       .paddingOnly(top: 5), | 
		
	
		
			
				|  |  |  |  |                 ), | 
		
	
		
			
				|  |  |  |  |               ], | 
		
	
		
			
				|  |  |  |  |             ) | 
		
	
		
			
				|  |  |  |  |           else | 
		
	
		
			
				|  |  |  |  |             Row( | 
		
	
		
			
				|  |  |  |  |               children: [ | 
		
	
		
			
				|  |  |  |  |                 if (fileTypeID == 1 || fileTypeID == 5 || fileTypeID == 7 || fileTypeID == 6 || fileTypeID == 8 | 
		
	
		
			
				|  |  |  |  |                     // || fileTypeID == 2 | 
		
	
		
			
				|  |  |  |  |                     ) | 
		
	
		
			
				|  |  |  |  |                   SvgPicture.asset(provider.getType(fileTypeName ?? ""), height: 30, width: 22, alignment: Alignment.center, fit: BoxFit.cover).paddingOnly(left: 0, right: 10), | 
		
	
		
			
				|  |  |  |  |                 Directionality(textDirection: provider.getTextDirection(cItem.contant ?? ""), child: (cItem.contant ?? "").toText12(color: Colors.white).expanded), | 
		
	
		
			
				|  |  |  |  |                 if (fileTypeID == 1 || fileTypeID == 5 || fileTypeID == 7 || fileTypeID == 6 || fileTypeID == 8 | 
		
	
		
			
				|  |  |  |  |                     //|| fileTypeID == 2 | 
		
	
		
			
				|  |  |  |  |                     ) | 
		
	
		
			
				|  |  |  |  |                   const Icon(Icons.remove_red_eye, color: Colors.white, size: 16) | 
		
	
		
			
				|  |  |  |  |               ], | 
		
	
		
			
				|  |  |  |  |             ), | 
		
	
		
			
				|  |  |  |  |           Align( | 
		
	
		
			
				|  |  |  |  |             alignment: Alignment.centerRight, | 
		
	
		
			
				|  |  |  |  |             child: dateTime.toText10( | 
		
	
		
			
				|  |  |  |  |               color: Colors.white.withOpacity(.71), | 
		
	
		
			
				|  |  |  |  |             ), | 
		
	
		
			
				|  |  |  |  |         ])).paddingOnly(right: MediaQuery.of(context).size.width * 0.3); | 
		
	
		
			
				|  |  |  |  |           ), | 
		
	
		
			
				|  |  |  |  |         ])).paddingOnly(right: MediaQuery.of(context).size.width * 0.33); | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   Widget voiceMsg(BuildContext context) { | 
		
	
		
			
				|  |  |  |  |     return Container(); | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   Widget showImage( | 
		
	
		
			
				|  |  |  |  |       {required bool isReplyPreview, | 
		
	
		
			
				|  |  |  |  |       required String fileName, | 
		
	
		
			
				|  |  |  |  |       required String fileTypeDescription}) { | 
		
	
		
			
				|  |  |  |  |   Widget showImage({required bool isReplyPreview, required String fileName, required String fileTypeDescription}) { | 
		
	
		
			
				|  |  |  |  |     if (cItem.isImageLoaded != null && cItem.image != null) { | 
		
	
		
			
				|  |  |  |  |       return Image.memory( | 
		
	
		
			
				|  |  |  |  |         cItem.image!, | 
		
	
	
		
			
				
					|  |  |  | @ -503,8 +359,7 @@ class GroupChatBubble extends StatelessWidget { | 
		
	
		
			
				|  |  |  |  |       ); | 
		
	
		
			
				|  |  |  |  |     } else { | 
		
	
		
			
				|  |  |  |  |       return FutureBuilder<Uint8List>( | 
		
	
		
			
				|  |  |  |  |         future: ChatApiClient().downloadURL( | 
		
	
		
			
				|  |  |  |  |             fileName: fileName, fileTypeDescription: fileTypeDescription, fileSource:2), | 
		
	
		
			
				|  |  |  |  |         future: ChatApiClient().downloadURL(fileName: fileName, fileTypeDescription: fileTypeDescription, fileSource: 2), | 
		
	
		
			
				|  |  |  |  |         builder: (BuildContext context, AsyncSnapshot<dynamic> snapshot) { | 
		
	
		
			
				|  |  |  |  |           if (snapshot.connectionState != ConnectionState.waiting) { | 
		
	
		
			
				|  |  |  |  |             if (snapshot.data == null) { | 
		
	
	
		
			
				
					|  |  |  | @ -531,20 +386,14 @@ class GroupChatBubble extends StatelessWidget { | 
		
	
		
			
				|  |  |  |  |     } | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   Widget currentWaveBubble( | 
		
	
		
			
				|  |  |  |  |       BuildContext context, GetGroupChatHistoryAsync data) { | 
		
	
		
			
				|  |  |  |  |   Widget currentWaveBubble(BuildContext context, GetGroupChatHistoryAsync data) { | 
		
	
		
			
				|  |  |  |  |     return Container( | 
		
	
		
			
				|  |  |  |  |       margin: const EdgeInsets.all(0), | 
		
	
		
			
				|  |  |  |  |       decoration: BoxDecoration( | 
		
	
		
			
				|  |  |  |  |         border: Border( | 
		
	
		
			
				|  |  |  |  |           left: BorderSide( | 
		
	
		
			
				|  |  |  |  |               width: 6, | 
		
	
		
			
				|  |  |  |  |               color: | 
		
	
		
			
				|  |  |  |  |                   isCurrentUser ? MyColors.gradiantStartColor : MyColors.white), | 
		
	
		
			
				|  |  |  |  |           left: BorderSide(width: 6, color: isCurrentUser ? MyColors.gradiantStartColor : MyColors.white), | 
		
	
		
			
				|  |  |  |  |         ), | 
		
	
		
			
				|  |  |  |  |         color: isCurrentUser | 
		
	
		
			
				|  |  |  |  |             ? MyColors.black.withOpacity(0.10) | 
		
	
		
			
				|  |  |  |  |             : MyColors.black.withOpacity(0.30), | 
		
	
		
			
				|  |  |  |  |         color: isCurrentUser ? MyColors.black.withOpacity(0.10) : MyColors.black.withOpacity(0.30), | 
		
	
		
			
				|  |  |  |  |       ), | 
		
	
		
			
				|  |  |  |  |       child: Row( | 
		
	
		
			
				|  |  |  |  |         children: [ | 
		
	
	
		
			
				
					|  |  |  | @ -552,14 +401,12 @@ class GroupChatBubble extends StatelessWidget { | 
		
	
		
			
				|  |  |  |  |           //  getPlayer(player: data.voiceController!, modelData: data), | 
		
	
		
			
				|  |  |  |  |           StreamBuilder<PositionData>( | 
		
	
		
			
				|  |  |  |  |             stream: _positionDataStream, | 
		
	
		
			
				|  |  |  |  |             builder: | 
		
	
		
			
				|  |  |  |  |                 (BuildContext context, AsyncSnapshot<PositionData> snapshot) { | 
		
	
		
			
				|  |  |  |  |             builder: (BuildContext context, AsyncSnapshot<PositionData> snapshot) { | 
		
	
		
			
				|  |  |  |  |               PositionData? positionData = snapshot.data; | 
		
	
		
			
				|  |  |  |  |               return SeekBar( | 
		
	
		
			
				|  |  |  |  |                 duration: positionData?.duration ?? Duration.zero, | 
		
	
		
			
				|  |  |  |  |                 position: positionData?.position ?? Duration.zero, | 
		
	
		
			
				|  |  |  |  |                 bufferedPosition: | 
		
	
		
			
				|  |  |  |  |                     positionData?.bufferedPosition ?? Duration.zero, | 
		
	
		
			
				|  |  |  |  |                 bufferedPosition: positionData?.bufferedPosition ?? Duration.zero, | 
		
	
		
			
				|  |  |  |  |                 onChangeEnd: data.voiceController!.seek, | 
		
	
		
			
				|  |  |  |  |               ).expanded; | 
		
	
		
			
				|  |  |  |  |             }, | 
		
	
	
		
			
				
					|  |  |  | @ -570,24 +417,17 @@ class GroupChatBubble extends StatelessWidget { | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   Widget showVideoThumb(BuildContext context, GetGroupChatHistoryAsync data) { | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |       return LoadVideo(data: data); | 
		
	
		
			
				|  |  |  |  |     return LoadVideo(data: data); | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   Widget recipetWaveBubble( | 
		
	
		
			
				|  |  |  |  |       BuildContext context, GetGroupChatHistoryAsync data) { | 
		
	
		
			
				|  |  |  |  |   Widget recipetWaveBubble(BuildContext context, GetGroupChatHistoryAsync data) { | 
		
	
		
			
				|  |  |  |  |     return Container( | 
		
	
		
			
				|  |  |  |  |       margin: const EdgeInsets.all(0), | 
		
	
		
			
				|  |  |  |  |       decoration: BoxDecoration( | 
		
	
		
			
				|  |  |  |  |         border: Border( | 
		
	
		
			
				|  |  |  |  |           left: BorderSide( | 
		
	
		
			
				|  |  |  |  |               width: 6, | 
		
	
		
			
				|  |  |  |  |               color: | 
		
	
		
			
				|  |  |  |  |                   isCurrentUser ? MyColors.gradiantStartColor : MyColors.white), | 
		
	
		
			
				|  |  |  |  |           left: BorderSide(width: 6, color: isCurrentUser ? MyColors.gradiantStartColor : MyColors.white), | 
		
	
		
			
				|  |  |  |  |         ), | 
		
	
		
			
				|  |  |  |  |         color: isCurrentUser | 
		
	
		
			
				|  |  |  |  |             ? MyColors.black.withOpacity(0.10) | 
		
	
		
			
				|  |  |  |  |             : MyColors.black.withOpacity(0.30), | 
		
	
		
			
				|  |  |  |  |         color: isCurrentUser ? MyColors.black.withOpacity(0.10) : MyColors.black.withOpacity(0.30), | 
		
	
		
			
				|  |  |  |  |       ), | 
		
	
		
			
				|  |  |  |  |       child: Row( | 
		
	
		
			
				|  |  |  |  |         mainAxisSize: MainAxisSize.max, | 
		
	
	
		
			
				
					|  |  |  | @ -596,14 +436,12 @@ class GroupChatBubble extends StatelessWidget { | 
		
	
		
			
				|  |  |  |  |           //getPlayer(player: data.voiceController!, modelData: data), | 
		
	
		
			
				|  |  |  |  |           StreamBuilder<PositionData>( | 
		
	
		
			
				|  |  |  |  |             stream: _positionDataStream, | 
		
	
		
			
				|  |  |  |  |             builder: | 
		
	
		
			
				|  |  |  |  |                 (BuildContext context, AsyncSnapshot<PositionData> snapshot) { | 
		
	
		
			
				|  |  |  |  |             builder: (BuildContext context, AsyncSnapshot<PositionData> snapshot) { | 
		
	
		
			
				|  |  |  |  |               PositionData? positionData = snapshot.data; | 
		
	
		
			
				|  |  |  |  |               return SeekBar( | 
		
	
		
			
				|  |  |  |  |                 duration: positionData?.duration ?? Duration.zero, | 
		
	
		
			
				|  |  |  |  |                 position: positionData?.position ?? Duration.zero, | 
		
	
		
			
				|  |  |  |  |                 bufferedPosition: | 
		
	
		
			
				|  |  |  |  |                     positionData?.bufferedPosition ?? Duration.zero, | 
		
	
		
			
				|  |  |  |  |                 bufferedPosition: positionData?.bufferedPosition ?? Duration.zero, | 
		
	
		
			
				|  |  |  |  |                 onChangeEnd: data.voiceController!.seek, | 
		
	
		
			
				|  |  |  |  |               ).expanded; | 
		
	
		
			
				|  |  |  |  |             }, | 
		
	
	
		
			
				
					|  |  |  | @ -613,16 +451,14 @@ class GroupChatBubble extends StatelessWidget { | 
		
	
		
			
				|  |  |  |  |     ).circle(5); | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   Widget getPlayer( | 
		
	
		
			
				|  |  |  |  |       {required AudioPlayer player, required SingleUserChatModel modelData}) { | 
		
	
		
			
				|  |  |  |  |   Widget getPlayer({required AudioPlayer player, required SingleUserChatModel modelData}) { | 
		
	
		
			
				|  |  |  |  |     return StreamBuilder<PlayerState>( | 
		
	
		
			
				|  |  |  |  |       stream: player.playerStateStream, | 
		
	
		
			
				|  |  |  |  |       builder: (BuildContext context, AsyncSnapshot<PlayerState> snapshot) { | 
		
	
		
			
				|  |  |  |  |         PlayerState? playerState = snapshot.data; | 
		
	
		
			
				|  |  |  |  |         ProcessingState? processingState = playerState?.processingState; | 
		
	
		
			
				|  |  |  |  |         bool? playing = playerState?.playing; | 
		
	
		
			
				|  |  |  |  |         if (processingState == ProcessingState.loading || | 
		
	
		
			
				|  |  |  |  |             processingState == ProcessingState.buffering) { | 
		
	
		
			
				|  |  |  |  |         if (processingState == ProcessingState.loading || processingState == ProcessingState.buffering) { | 
		
	
		
			
				|  |  |  |  |           return Container( | 
		
	
		
			
				|  |  |  |  |             margin: const EdgeInsets.all(8.0), | 
		
	
		
			
				|  |  |  |  |             width: 30.0, | 
		
	
	
		
			
				
					|  |  |  | @ -661,6 +497,7 @@ class GroupChatBubble extends StatelessWidget { | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  | class LoadVideo extends StatefulWidget { | 
		
	
		
			
				|  |  |  |  |   final GetGroupChatHistoryAsync data; | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   const LoadVideo({Key? key, required this.data}) : super(key: key); | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   @override | 
		
	
	
		
			
				
					|  |  |  | @ -672,21 +509,14 @@ class _LoadVideoState extends State<LoadVideo> { | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   @override | 
		
	
		
			
				|  |  |  |  |   void initState() { | 
		
	
		
			
				|  |  |  |  |     videoController = VideoPlayerController.networkUrl(Uri.parse( | 
		
	
		
			
				|  |  |  |  |         'https://apiderichat.hmg.com/groupattachments/${widget.data.fileTypeResponse?.fileName}')) | 
		
	
		
			
				|  |  |  |  |       ..initialize().then((_) { | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |       }); | 
		
	
		
			
				|  |  |  |  |     videoController = VideoPlayerController.networkUrl(Uri.parse('https://apiderichat.hmg.com/groupattachments/${widget.data.fileTypeResponse?.fileName}'))..initialize().then((_) {}); | 
		
	
		
			
				|  |  |  |  |     super.initState(); | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   @override | 
		
	
		
			
				|  |  |  |  |   Widget build(BuildContext context) { | 
		
	
		
			
				|  |  |  |  |     return Container( | 
		
	
		
			
				|  |  |  |  |         margin: const EdgeInsets.all(10), | 
		
	
		
			
				|  |  |  |  |         decoration: BoxDecoration( | 
		
	
		
			
				|  |  |  |  |           borderRadius: BorderRadius.circular(10), | 
		
	
		
			
				|  |  |  |  |         ), | 
		
	
		
			
				|  |  |  |  |     return ClipRRect( | 
		
	
		
			
				|  |  |  |  |         borderRadius: BorderRadius.circular(5.0), | 
		
	
		
			
				|  |  |  |  |         child: AspectRatio( | 
		
	
		
			
				|  |  |  |  |           aspectRatio: videoController.value.aspectRatio, | 
		
	
		
			
				|  |  |  |  |           child: Stack( | 
		
	
	
		
			
				
					|  |  |  | 
 |