diff --git a/assets/pogdark_logo.png b/assets/pogdark_logo.png index 0b6f929..cea916c 100644 Binary files a/assets/pogdark_logo.png and b/assets/pogdark_logo.png differ diff --git a/lib/status_page.dart b/lib/status_page.dart index bc0c74c..e329ffe 100644 --- a/lib/status_page.dart +++ b/lib/status_page.dart @@ -53,7 +53,6 @@ class StatusPageState extends State with WidgetsBindingObserver { @override void didChangeAppLifecycleState(AppLifecycleState state) { if (state == AppLifecycleState.resumed) { - // Reestablish the WebSocket connection when the app returns to the foreground _reconnectWebSocket(); } } @@ -127,44 +126,73 @@ class StatusPageState extends State with WidgetsBindingObserver { } } + void _showImageDialog(BuildContext context, ImageProvider imageProvider) { + showDialog( + context: context, + builder: (BuildContext context) { + return Dialog( + backgroundColor: Colors.transparent, + child: GestureDetector( + onTap: () => Navigator.of(context).pop(), + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.black87, + ), + padding: const EdgeInsets.all(8.0), + child: Image(image: imageProvider, fit: BoxFit.contain), + ), + ), + ); + }, + ); + } + Widget _buildMessageItem(Map message) { final imageId = message['Id']; final imageProvider = _imageCache[imageId] ?? const AssetImage('assets/default_profile_image.png'); - return Padding( - padding: const EdgeInsets.symmetric(vertical: 4.0), - child: Align( - alignment: Alignment.centerLeft, - child: Container( - padding: const EdgeInsets.all(10), - decoration: BoxDecoration( - color: Colors.blue.shade50, - borderRadius: BorderRadius.circular(12), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - CircleAvatar( - radius: 20, - backgroundImage: imageProvider, - ), - const SizedBox(width: 8), - Text( - "${message['Name']}", - style: const TextStyle( - fontSize: 16, fontWeight: FontWeight.bold), - ), - ], - ), - const SizedBox(height: 4), - Text( - "Received at: ${message['Timestamp']}", - style: const TextStyle(fontSize: 12, color: Colors.grey), - ), - ], + return GestureDetector( + onTap: () { + if (_imageCache.containsKey(imageId)) { + _showImageDialog(context, imageProvider); + } + }, + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 4.0), + child: Align( + alignment: Alignment.centerLeft, + child: Container( + padding: const EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.blue.shade50, + borderRadius: BorderRadius.circular(12), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + CircleAvatar( + radius: 20, + backgroundImage: imageProvider, + ), + const SizedBox(width: 8), + Text( + "${message['Name']}", + style: const TextStyle( + fontSize: 16, fontWeight: FontWeight.bold), + ), + ], + ), + const SizedBox(height: 4), + Text( + "Received at: ${message['Timestamp']}", + style: const TextStyle(fontSize: 12, color: Colors.grey), + ), + ], + ), ), ), ),